diff --git a/src/css/styles.css b/src/css/styles.css
index 9aa6830..b1024c2 100644
--- a/src/css/styles.css
+++ b/src/css/styles.css
@@ -1,9 +1,11 @@
/* https://github.com/pure-css/pure/blob/master/site/static/layouts/side-menu/styles.css */
+
+
body {
color: #777;
- font-size: 20px;
+ --bs-body-font-size: 20px
}
#navbar-image {
@@ -356,4 +358,35 @@ Hides the menu at `48em`, but modify this based on your app's needs.
.nani_card-link:hover {
filter: brightness(90%);
+}
+
+.nani_logo-link {
+ display: inline-block;
+}
+
+.nani_logo-link img {
+ height: var(--bs-body-font-size);
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.nani_logo-link-color-inverted img {
+ filter: invert(1);
+}
+
+.nani_logo-link:hover {
+ filter: brightness(90%);
+}
+
+.nani_youtube {
+ position: relative;
+ padding-bottom: 56.25%; /* 16:9 */
+ height: 0;
+}
+.nani_youtube iframe {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
}
\ No newline at end of file
diff --git a/src/images/logos/dart.svg b/src/images/logos/dart.svg
new file mode 100644
index 0000000..0bf93ab
--- /dev/null
+++ b/src/images/logos/dart.svg
@@ -0,0 +1,30 @@
+
+
+
diff --git a/src/images/logos/gitea.svg b/src/images/logos/gitea.svg
new file mode 100644
index 0000000..8da0753
--- /dev/null
+++ b/src/images/logos/gitea.svg
@@ -0,0 +1,493 @@
+
+
+
+
+
+
+
+
+
+
+]>
+
diff --git a/src/images/logos/github.svg b/src/images/logos/github.svg
new file mode 100644
index 0000000..15e4ede
--- /dev/null
+++ b/src/images/logos/github.svg
@@ -0,0 +1,63 @@
+
+
+
+
diff --git a/src/images/logos/gitlab.svg b/src/images/logos/gitlab.svg
new file mode 100644
index 0000000..edb193b
--- /dev/null
+++ b/src/images/logos/gitlab.svg
@@ -0,0 +1,69 @@
+
+
+
diff --git a/src/images/logos/haskell_orange.svg b/src/images/logos/haskell_orange.svg
new file mode 100644
index 0000000..f1f83cb
--- /dev/null
+++ b/src/images/logos/haskell_orange.svg
@@ -0,0 +1,12 @@
+
+
+
diff --git a/src/images/logos/haskell_purple.svg b/src/images/logos/haskell_purple.svg
new file mode 100644
index 0000000..c08bdc7
--- /dev/null
+++ b/src/images/logos/haskell_purple.svg
@@ -0,0 +1,8 @@
+
+
diff --git a/src/images/logos/nani.svg b/src/images/logos/nani.svg
new file mode 100644
index 0000000..c5a9961
--- /dev/null
+++ b/src/images/logos/nani.svg
@@ -0,0 +1,71 @@
+
+
+
+
diff --git a/src/images/logos/nix_options.svg b/src/images/logos/nix_options.svg
new file mode 100644
index 0000000..443f9d8
--- /dev/null
+++ b/src/images/logos/nix_options.svg
@@ -0,0 +1,48 @@
+
+
diff --git a/src/images/logos/nix_packages.svg b/src/images/logos/nix_packages.svg
new file mode 100644
index 0000000..9a70a14
--- /dev/null
+++ b/src/images/logos/nix_packages.svg
@@ -0,0 +1,513 @@
+
+
+
+
diff --git a/src/images/logos/npm.svg b/src/images/logos/npm.svg
new file mode 100644
index 0000000..af80f67
--- /dev/null
+++ b/src/images/logos/npm.svg
@@ -0,0 +1,6 @@
+
diff --git a/src/images/logos/reddit.svg b/src/images/logos/reddit.svg
new file mode 100644
index 0000000..222028a
--- /dev/null
+++ b/src/images/logos/reddit.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/images/logos/rust.svg b/src/images/logos/rust.svg
new file mode 100644
index 0000000..b486919
--- /dev/null
+++ b/src/images/logos/rust.svg
@@ -0,0 +1,2 @@
+
+
diff --git a/src/images/logos/stack_overflow.svg b/src/images/logos/stack_overflow.svg
new file mode 100644
index 0000000..5298d4c
--- /dev/null
+++ b/src/images/logos/stack_overflow.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/images/logos/wikipedia.svg b/src/images/logos/wikipedia.svg
new file mode 100644
index 0000000..a6c3159
--- /dev/null
+++ b/src/images/logos/wikipedia.svg
@@ -0,0 +1,59 @@
+
+
+
diff --git a/ssg/src/Main.hs b/ssg/src/Main.hs
index d6e08f1..70dc7c9 100644
--- a/ssg/src/Main.hs
+++ b/ssg/src/Main.hs
@@ -24,6 +24,7 @@ import Formats.Posts
import Util.Hakyll.Routes
import Util.Hakyll.Context
import Util.Hash
+import Preprocessing.Replacement
--------------------------------------------------------------------------------
-- CONFIG
@@ -59,7 +60,7 @@ main = hakyllWith config $ do
[ "CNAME"
, "favicon.ico"
, "_config.yml"
- , "images/*"
+ , "images/**"
, "js/*"
, "fonts/*"
]
@@ -81,7 +82,9 @@ main = hakyllWith config $ do
route $ postRoute fileHashes
compile $
- pandocCompilerCustom
+ getResourceBody
+ >>= replaceLogoLinks
+ >>= pandocRendererCustom
>>= loadAndApplyTemplate "templates/post.html" ctx
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/default.html" ctx
@@ -95,7 +98,6 @@ main = hakyllWith config $ do
route $ setExtension ".html"
compile $ do
-
pandocCompilerCustom
>>= loadAndApplyTemplate "templates/gogen.html" ctx
>>= saveSnapshot "content"
@@ -204,6 +206,10 @@ pandocCompilerCustom :: Compiler (Item String)
pandocCompilerCustom =
pandocCompilerWith pandocReaderOpts pandocWriterOpts
+pandocRendererCustom :: Item String -> Compiler (Item String)
+pandocRendererCustom =
+ renderPandocWith pandocReaderOpts pandocWriterOpts
+
pandocExtensionsCustom :: Extensions
pandocExtensionsCustom =
githubMarkdownExtensions
diff --git a/ssg/src/Preprocessing/Replacement.hs b/ssg/src/Preprocessing/Replacement.hs
new file mode 100644
index 0000000..43642e3
--- /dev/null
+++ b/ssg/src/Preprocessing/Replacement.hs
@@ -0,0 +1,138 @@
+{-# LANGUAGE QuasiQuotes, FlexibleContexts #-}
+module Preprocessing.Replacement where
+
+import Hakyll
+import Text.Regex.PCRE.Heavy (Regex, re, gsub)
+import Debug.Trace
+
+type Html = String
+type LLConverter = String -> String -> Html
+
+replaceLogoLinks :: Item String -> Compiler (Item String)
+replaceLogoLinks = return . fmap replaceAllLogoLinks
+
+
+fullLogoLinkRegex :: Regex
+fullLogoLinkRegex = [re|\[(.*?)\|(.*?)\]\((.*?)\)|]
+
+shortLogoLinkRegex :: Regex
+shortLogoLinkRegex = [re|\[(.*?)\|(.*?)\](?!\()|]
+
+replaceAllLogoLinks :: Html -> Html
+replaceAllLogoLinks = gsub fullLogoLinkRegex f . gsub shortLogoLinkRegex g
+ where
+ g (key:s1:_)
+ | key == "gh" = github s1 ("https://github.com/" ++ s1)
+ | key == "gl" = gitlab s1 ("https://gitlab.com/" ++ s1)
+ | key == "ga" = gitea s1 ("https://gitea.com/" ++ s1)
+ | key == "nani" = nani s1 ("https://git.nani.wtf/" ++ s1)
+ | key == "pub" = pub s1 ("https://pub.dev/packages/" ++ s1)
+ | key == "nxp" = nixpackages s1 ("https://search.nixos.org/packages?query=" ++ s1)
+ | key == "nxo" = nixoptions s1 ("https://search.nixos.org/options?query=" ++ s1)
+ | key == "npm" = npm s1 ("https://www.npmjs.com/package/" ++ s1)
+ | key == "crt" = crates s1 ("https://crates.io/crates/" ++ s1)
+ | key == "hk" = hackage s1 ("https://hackage.haskell.org/package/" ++ s1)
+ | key == "hg" = hoogle s1 ("https://hoogle.haskell.org/?hoogle=" ++ s1)
+ | key == "yt" = youtube s1 ("https://www.youtube.com/embed/" ++ s1)
+ -- Reconstruct the original text
+ | otherwise = foldr1 (++) ["[", key, "|", s1, "]"]
+
+ f (key:s1:s2:_)
+ | key == "kan" = kan s1 s2
+ | key == "so" = stackoverflow s1 s2
+ | key == "rd" = reddit s1 s2
+ | key == "wiki" = wikipedia s1 s2
+ | key == "jisho" = jisho s1 s2
+ -- Reconstruct the original text
+ | otherwise = foldr1 (++) ["[", key, "|", s1, "](", s2, ")"]
+
+{- This should be removed once all icons are added, and all functions are implemented -}
+generateGenericLink :: String -> LLConverter
+generateGenericLink linkTitle = f
+ where
+ f name link = foldr1 (++) ["", linkTitle, ": ", name, ""]
+
+
+badgeLinkWithCustomClasses :: String -> [String] -> LLConverter
+badgeLinkWithCustomClasses imageName classes = f
+ where
+ f name link = foldr1 (++) [
+ "",
+ "",
+ "" ++ name ++ "",
+ "",
+ ""
+ ]
+
+badgeLink :: String -> LLConverter
+badgeLink imageName = badgeLinkWithCustomClasses imageName []
+
+
+kan :: LLConverter
+kan kanji kana = foldr1 (++) ["