add subdomains to footer

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2022-05-12 05:27:23 +05:30
parent 156a3b1b63
commit 216ca60d6c
10 changed files with 47 additions and 6 deletions

View File

@@ -63,6 +63,19 @@ article .header {
text-decoration: none; text-decoration: none;
} }
.subdomains {
list-style-type: none;
}
.subdomains li {
display: inline-block;
}
.subdomains img {
width: 30px;
height: 30px;
}
@media (max-width: 319px) { @media (max-width: 319px) {
body { body {
width: 90%; width: 90%;

BIN
images/logos/ci.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
images/logos/consul.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

1
images/logos/git.png Symbolic link
View File

@@ -0,0 +1 @@
gitea.png

BIN
images/logos/gitea.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
images/logos/nomad.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/logos/radio.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
images/logos/vault.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

32
site.hs
View File

@@ -19,7 +19,7 @@ main = hakyllWith config $ do
route $ setExtension "html" route $ setExtension "html"
compile $ compile $
pandocCompiler pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext >>= loadAndApplyTemplate "templates/default.html" defaultCtx
>>= relativizeUrls >>= relativizeUrls
match "posts/*org" $ do match "posts/*org" $ do
@@ -36,8 +36,8 @@ main = hakyllWith config $ do
posts <- recentFirst =<< loadAll "posts/*" posts <- recentFirst =<< loadAll "posts/*"
let archiveCtx = let archiveCtx =
listField "posts" postCtx (return posts) listField "posts" postCtx (return posts)
`mappend` constField "title" "Archives" <> constField "title" "Archives"
`mappend` defaultContext <> defaultCtx
makeItem "" makeItem ""
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx >>= loadAndApplyTemplate "templates/archive.html" archiveCtx
@@ -50,7 +50,7 @@ main = hakyllWith config $ do
posts <- recentFirst =<< loadAll "posts/*" posts <- recentFirst =<< loadAll "posts/*"
let indexCtx = let indexCtx =
listField "posts" postCtx (return posts) listField "posts" postCtx (return posts)
`mappend` defaultContext <> defaultCtx
getResourceBody getResourceBody
>>= applyAsTemplate indexCtx >>= applyAsTemplate indexCtx
@@ -64,7 +64,7 @@ config =
defaultConfiguration defaultConfiguration
{ deployCommand = { deployCommand =
"rsync --checksum -ave 'ssh -p 22001' \ "rsync --checksum -ave 'ssh -p 22001' \
\result/* \ \_site/* \
\root@weirdnatto.in:/var/lib/site/", \root@weirdnatto.in:/var/lib/site/",
previewPort = 3333 previewPort = 3333
} }
@@ -72,4 +72,24 @@ config =
postCtx :: Context String postCtx :: Context String
postCtx = postCtx =
dateField "date" "%B %e, %Y" dateField "date" "%B %e, %Y"
`mappend` defaultContext <> defaultCtx
defaultCtx :: Context String
defaultCtx =
listField "subdomains" subCtx (return subdomains)
<> domainCtx
<> defaultContext
where
domain :: String
domain = "weirdnatto.in"
subCtx :: Context String
subCtx =
field "name" (return . itemBody)
<> domainCtx
domainCtx :: Context String
domainCtx = constField "domain" domain
subdomains :: [Item String]
subdomains = map mkItem ["git", "nomad", "consul", "vault", "ci", "radio"]
where
mkItem :: a -> Item a
mkItem a = Item {itemIdentifier = "subdomain", itemBody = a}

View File

@@ -31,6 +31,13 @@
Site proudly generated by Site proudly generated by
<a href="http://jaspervdj.be/hakyll">Hakyll</a><br> <a href="http://jaspervdj.be/hakyll">Hakyll</a><br>
PGP Fingerprint: 53EC 089E F230 E47A 83BA 8F81 9594 9BD4 B853 F559 PGP Fingerprint: 53EC 089E F230 E47A 83BA 8F81 9594 9BD4 B853 F559
<ul class="subdomains">
$for(subdomains)$
<li>
<a href="https://$name$.$domain$"> <img src="/images/logos/$name$.png" alt="https://$name$.$domain$"/> </a>
</li>
$endfor$
</ul>
</footer> </footer>
</body> </body>
</html> </html>