Enhance CSS link styles and refactor variable names in site.hs for clarity
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
--color-tag2: darkolivegreen;
|
--color-tag2: darkolivegreen;
|
||||||
--color-bg: white;
|
--color-bg: white;
|
||||||
--color-notice: #fb4f4f;
|
--color-notice: #fb4f4f;
|
||||||
|
--color-link: #0645ad;
|
||||||
|
--color-link-visited: #551a8b;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
@@ -25,9 +27,18 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body a {
|
body a {
|
||||||
|
color: var(--color-link);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body a:visited {
|
||||||
|
color: var(--color-link-visited);
|
||||||
|
}
|
||||||
|
|
||||||
|
body a[href^="#"]:visited {
|
||||||
|
color: var(--color-link);
|
||||||
|
}
|
||||||
|
|
||||||
body a:hover {
|
body a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
@@ -321,18 +332,18 @@ code {
|
|||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
list-style-type: decimal;
|
|
||||||
margin-left: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
div#contents-big ul ul {
|
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
margin-left: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
div#contents-big li+li {
|
div#contents-big li+li {
|
||||||
margin-top: 0.5em
|
margin-top: 0.5em
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div#contents-big .toc-section-number {
|
||||||
|
margin-right: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
div#contents-big {
|
div#contents-big {
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
|
|||||||
57
src/site.hs
57
src/site.hs
@@ -9,29 +9,29 @@ import Hakyll
|
|||||||
import System.FilePath
|
import System.FilePath
|
||||||
import Text.Pandoc
|
import Text.Pandoc
|
||||||
|
|
||||||
notesPattern :: Pattern
|
mdfiles :: Pattern
|
||||||
notesPattern = "main.md"
|
mdfiles = "main.md"
|
||||||
|
|
||||||
imagesPattern :: Pattern
|
images :: Pattern
|
||||||
imagesPattern = "images/**"
|
images = "images/**"
|
||||||
|
|
||||||
mathMacrosPath :: FilePath
|
mathMacro :: FilePath
|
||||||
mathMacrosPath = "assets/math-macros.tex"
|
mathMacro = "assets/math-macros.tex"
|
||||||
|
|
||||||
bibStylePath :: FilePath
|
cslfile :: FilePath
|
||||||
bibStylePath = "assets/bib_style.csl"
|
cslfile = "assets/bib_style.csl"
|
||||||
|
|
||||||
bibliographyPath :: FilePath
|
reference :: FilePath
|
||||||
bibliographyPath = "ref.bib"
|
reference = "ref.bib"
|
||||||
|
|
||||||
fontsPattern :: Pattern
|
fonts :: Pattern
|
||||||
fontsPattern = "assets/fonts/*"
|
fonts = "assets/fonts/*"
|
||||||
|
|
||||||
faviconPath :: FilePath
|
favicon :: FilePath
|
||||||
faviconPath = "assets/favicon.ico"
|
favicon = "assets/favicon.ico"
|
||||||
|
|
||||||
cssPattern :: Pattern
|
css :: Pattern
|
||||||
cssPattern = "assets/css/*"
|
css = "assets/css/*"
|
||||||
|
|
||||||
templatesPattern :: Pattern
|
templatesPattern :: Pattern
|
||||||
templatesPattern = "assets/templates/*"
|
templatesPattern = "assets/templates/*"
|
||||||
@@ -45,9 +45,9 @@ templatePostlist = fromFilePath "assets/templates/post-list.html"
|
|||||||
chaoDocFiles :: ChaoDocFiles
|
chaoDocFiles :: ChaoDocFiles
|
||||||
chaoDocFiles =
|
chaoDocFiles =
|
||||||
ChaoDocFiles
|
ChaoDocFiles
|
||||||
{ chaoDocCslFile = bibStylePath,
|
{ chaoDocCslFile = cslfile,
|
||||||
chaoDocBibFile = bibliographyPath,
|
chaoDocBibFile = reference,
|
||||||
chaoDocMacroFile = mathMacrosPath
|
chaoDocMacroFile = mathMacro
|
||||||
}
|
}
|
||||||
|
|
||||||
config :: Configuration
|
config :: Configuration
|
||||||
@@ -60,29 +60,29 @@ config =
|
|||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = hakyllWith config $ do
|
main = hakyllWith config $ do
|
||||||
match imagesPattern $ do
|
match images $ do
|
||||||
route idRoute
|
route idRoute
|
||||||
compile copyFileCompiler
|
compile copyFileCompiler
|
||||||
|
|
||||||
match (fromGlob mathMacrosPath) $ compile getResourceBody
|
match (fromGlob mathMacro) $ compile getResourceBody
|
||||||
|
|
||||||
match (fromGlob bibStylePath) $ compile cslCompiler
|
match (fromGlob cslfile) $ compile cslCompiler
|
||||||
|
|
||||||
match (fromGlob bibliographyPath) $ compile biblioCompiler
|
match (fromGlob reference) $ compile biblioCompiler
|
||||||
|
|
||||||
match fontsPattern $ do
|
match fonts $ do
|
||||||
route $ gsubRoute "assets/fonts/" (const "fonts/")
|
route $ gsubRoute "assets/fonts/" (const "fonts/")
|
||||||
compile copyFileCompiler
|
compile copyFileCompiler
|
||||||
|
|
||||||
match (fromGlob faviconPath) $ do
|
match (fromGlob favicon) $ do
|
||||||
route $ constRoute "favicon.ico"
|
route $ constRoute "favicon.ico"
|
||||||
compile copyFileCompiler
|
compile copyFileCompiler
|
||||||
|
|
||||||
match cssPattern $ do
|
match css $ do
|
||||||
route $ gsubRoute "assets/css/" (const "css/")
|
route $ gsubRoute "assets/css/" (const "css/")
|
||||||
compile compressCssCompiler
|
compile compressCssCompiler
|
||||||
|
|
||||||
match notesPattern $ do
|
match mdfiles $ do
|
||||||
route $ setExtension "html"
|
route $ setExtension "html"
|
||||||
compile $ do
|
compile $ do
|
||||||
tocCtx <- getTocCtx defaultContext
|
tocCtx <- getTocCtx defaultContext
|
||||||
@@ -93,7 +93,7 @@ main = hakyllWith config $ do
|
|||||||
create ["index.html"] $ do
|
create ["index.html"] $ do
|
||||||
route idRoute
|
route idRoute
|
||||||
compile $ do
|
compile $ do
|
||||||
posts <- loadAll notesPattern
|
posts <- loadAll mdfiles
|
||||||
let indexCtx =
|
let indexCtx =
|
||||||
constField "title" ""
|
constField "title" ""
|
||||||
`mappend` constField "toc" ""
|
`mappend` constField "toc" ""
|
||||||
@@ -131,6 +131,7 @@ getTocCtx ctx = do
|
|||||||
pure $
|
pure $
|
||||||
writerOpts
|
writerOpts
|
||||||
{ writerTableOfContents = True,
|
{ writerTableOfContents = True,
|
||||||
|
writerNumberSections = True,
|
||||||
writerTOCDepth = 2,
|
writerTOCDepth = 2,
|
||||||
writerTemplate = tmpl,
|
writerTemplate = tmpl,
|
||||||
writerHTMLMathMethod = MathML
|
writerHTMLMathMethod = MathML
|
||||||
|
|||||||
Reference in New Issue
Block a user