diff --git a/src/templates/default.html b/src/templates/default.html
index 8049a55..2964f0b 100644
--- a/src/templates/default.html
+++ b/src/templates/default.html
@@ -5,7 +5,9 @@
-
+ $if(desc)$
+
+ $endif$
$if(author)$
@@ -18,7 +20,9 @@
-
+ $if(desc)$
+
+ $endif$
$if(image)$
@@ -33,7 +37,9 @@
-
+ $if(desc)$
+
+ $endif$
$if(image)$
diff --git a/src/templates/gogen.html b/src/templates/gogen.html
index d32b4dd..6f72eb8 100644
--- a/src/templates/gogen.html
+++ b/src/templates/gogen.html
@@ -7,9 +7,9 @@
(updated: $updated$)
$endif$
- $if(alternative_writings)$
+ $if(alternatives)$
- $alternative_writings$
+ $alternatives$
$endif$
diff --git a/ssg/src/Formats/Gogen.hs b/ssg/src/Formats/Gogen.hs
index 40dc2ec..4ca5b4e 100644
--- a/ssg/src/Formats/Gogen.hs
+++ b/ssg/src/Formats/Gogen.hs
@@ -35,13 +35,35 @@ replaceFuriganaWithKanji :: FuriganaTemplate -> String
replaceFuriganaWithKanji = gsub [re|\[(.*?)\]\((.*?)\)|] (\(kanji:kana:_) -> kanji :: String)
replaceFuriganaWithHtml :: FuriganaTemplate -> String
-replaceFuriganaWithHtml = between "" "" . gsub [re|\[(.*?)\]\((.*?)\)|] (\(kanji:kana:_) -> "" ++ kanji ++" " :: String)
+replaceFuriganaWithHtml = between "" "" . gsub regex matchToHtml
where
+ regex = [re|\[(.*?)\]\((.*?)\)|]
+
+ between :: String -> String -> String -> String
between x y s = x ++ s ++ y
+ matchToHtml :: [String] -> String
+ matchToHtml (kanji:kana:_) =
+ let defaultKanji = if kanji == "" then "〇" else kanji
+ in foldr1 (++) ["", defaultKanji, " "]
+
+
+
+{- |
+ title: String
+ titleHtml: String
+ finished: Boolean
+ updated: String
+ lang: String
+ antonyms: Maybe [String]
+ synonyms: Maybe [String]
+ leads_here: Maybe [String]
+ alternatives: Maybe [String]
+ see_also: Maybe [String]
+-}
gogenCtx :: Context String
gogenCtx =
dateField "date" "%Y-%m-%d"
<> field "titleHtml" convertFuriganaTitleHtml
<> defaultContext
-
+ <> constField "lang" "en"
\ No newline at end of file
diff --git a/ssg/src/Main.hs b/ssg/src/Main.hs
index 27b2719..34e3e7b 100644
--- a/ssg/src/Main.hs
+++ b/ssg/src/Main.hs
@@ -85,7 +85,9 @@ main = hakyllWith config $ do
constField "type" "article"
<> field "title" convertFuriganaTitle
<> field "titleHtml" convertFuriganaTitleHtml
- <> postCtx
+ <> constField "root" root
+ <> constField "siteName" siteName
+ <> gogenCtx
route $ setExtension ".html"
compile $ do