Compare commits
6 Commits
modern_the
...
6a3b4c5f88
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a3b4c5f88 | |||
| 720a19e24d | |||
| 1789c75f18 | |||
| 3d2c5a8852 | |||
| 614de591ba | |||
| 71611b0641 |
@@ -1,6 +1,7 @@
|
||||
.theorem-environment {
|
||||
font-style: italic;
|
||||
margin-top: 1em;
|
||||
padding: 0.5em;
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
|
||||
@@ -35,6 +36,7 @@
|
||||
}
|
||||
|
||||
.Proof {
|
||||
background: none;
|
||||
font-style: normal;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ body {
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 1rem;
|
||||
line-height: 125%;
|
||||
line-height: 140%;
|
||||
color: var(--color-text);
|
||||
background-color: var(--color-bg);
|
||||
text-rendering: optimizeLegibility;
|
||||
@@ -404,6 +404,12 @@ code {
|
||||
margin-left: 0
|
||||
}
|
||||
|
||||
div#contents ul.notes-list,
|
||||
div#contents-big ul.notes-list {
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
div#contents-big ul ul {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: hakyll-blog
|
||||
name: hakysidian
|
||||
version: 0.1.0.0
|
||||
build-type: Simple
|
||||
cabal-version: >= 1.10
|
||||
12
src/site.hs
12
src/site.hs
@@ -26,6 +26,11 @@ cleanIndexHtmls = return . fmap (replaceAll pattern replacement)
|
||||
pattern :: String = "/index.html"
|
||||
replacement :: String -> String = const "/"
|
||||
|
||||
loadNoteLinks :: Compiler [Item String]
|
||||
loadNoteLinks = do
|
||||
noteIds <- sortOn toFilePath <$> getMatches "notes/*"
|
||||
pure [Item noteId "" | noteId <- noteIds]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
config :: Configuration
|
||||
@@ -103,7 +108,8 @@ main = hakyllWith config $ do
|
||||
match "notes/*" $ do
|
||||
route cleanRoute
|
||||
compile $ do
|
||||
tocCtx <- getTocCtx defaultContext
|
||||
notes <- loadNoteLinks
|
||||
tocCtx <- getTocCtx $ listField "notes" defaultContext (return notes) <> defaultContext
|
||||
chaoDocCompiler
|
||||
>>= loadAndApplyTemplate "templates/note.html" tocCtx
|
||||
>>= relativizeUrls
|
||||
@@ -111,9 +117,9 @@ main = hakyllWith config $ do
|
||||
create ["index.html"] $ do
|
||||
route idRoute
|
||||
compile $ do
|
||||
notes <- sortOn (toFilePath . itemIdentifier) <$> loadAll "notes/*"
|
||||
notes <- loadNoteLinks
|
||||
let notesCtx =
|
||||
listField "posts" defaultContext (return notes)
|
||||
listField "notes" defaultContext (return notes)
|
||||
`mappend` constField "title" "Notes"
|
||||
`mappend` defaultContext
|
||||
makeItem ""
|
||||
|
||||
@@ -11,6 +11,7 @@ $partial("templates/head.html")$
|
||||
that are big enough -->
|
||||
<div id="contents-big">
|
||||
<p class="mini-header">Notes <a id="up-arrow" href="/">←</a></p>
|
||||
$partial("templates/notes-list.html")$
|
||||
<p class="mini-header">Contents <a id="up-arrow" href="#">↑</a></p>
|
||||
$toc$
|
||||
</div>
|
||||
@@ -38,4 +39,4 @@ $partial("templates/head.html")$
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
7
templates/notes-list.html
Normal file
7
templates/notes-list.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<ul class="notes-list">
|
||||
$for(notes)$
|
||||
<li>
|
||||
<a href="$url$">$title$</a>
|
||||
</li>
|
||||
$endfor$
|
||||
</ul>
|
||||
@@ -1,8 +1,2 @@
|
||||
<h1 class="pagetitle">$title$</h1>
|
||||
<ul>
|
||||
$for(posts)$
|
||||
<li>
|
||||
<a href="$url$">$title$</a>
|
||||
</li>
|
||||
$endfor$
|
||||
</ul>
|
||||
$partial("templates/notes-list.html")$
|
||||
|
||||
Reference in New Issue
Block a user