Now that we have conditional static templating, get rid of redundant templating variables (allTaggedPage + latestTaggedPage)
This commit is contained in:
parent
049576154a
commit
e136b97746
4 changed files with 8 additions and 20 deletions
|
@ -1,12 +1,10 @@
|
|||
allLink = See all
|
||||
allPage = All articles
|
||||
allTaggedPage = All articles tagged ${tag}
|
||||
allPage = All articles{? tagged ${tag}?}
|
||||
commentsLink = Comment on the fediverse
|
||||
commentsSection = Comments
|
||||
dateFormat = en-US
|
||||
latestLink = See only latest
|
||||
latestPage = Latest articles
|
||||
latestTaggedPage = Latest articles tagged ${tag}
|
||||
latestPage = Latest articles{? tagged ${tag}?}
|
||||
metadata = {?by ${author} ?}on ${date}{? tagged ${tags}?}
|
||||
rssLink = Subscribe
|
||||
rssTitle = Follow all articles{? tagged ${tag}?}
|
||||
|
|
|
@ -66,12 +66,7 @@ function DomRenderer(modules) {
|
|||
}
|
||||
|
||||
function pageTitle(tag, all) {
|
||||
if(tag != undefined) {
|
||||
var template = all ? 'allTaggedPage' : 'latestTaggedPage';
|
||||
return modules.template.render(template, {tag: tag});
|
||||
} else {
|
||||
return blog.wording[all ? 'allPage' : 'latestPage'];
|
||||
}
|
||||
return modules.template.render(all ? 'allPage' : 'latestPage', {tag: tag});
|
||||
}
|
||||
|
||||
function otherUrl(tag, all) {
|
||||
|
|
|
@ -34,13 +34,10 @@ otherURL (ArticlesList {full, collection}) = absoluteLink $
|
|||
|
||||
description :: Renderer m => ArticlesList -> m Text
|
||||
description (ArticlesList {full, collection}) =
|
||||
getDescription (full, tag collection)
|
||||
template page . environment $ tag collection
|
||||
where
|
||||
getDescription (True, Nothing) = template "allPage" []
|
||||
getDescription (True, Just tag) = template "allTaggedPage" [("tag", pack tag)]
|
||||
getDescription (False, Nothing) = template "latestPage" []
|
||||
getDescription (False, Just tag) =
|
||||
template "latestTaggedPage" [("tag", pack tag)]
|
||||
page = if full then "allPage" else "latestPage"
|
||||
environment = maybe [] $ \value -> [("tag", pack value)]
|
||||
|
||||
rssLinkTexts :: Renderer m => ArticlesList -> m (Text, Text)
|
||||
rssLinkTexts (ArticlesList {collection}) = do
|
||||
|
|
|
@ -25,14 +25,12 @@ newtype Wording = Wording (Map String Text)
|
|||
variables :: Map String [Text]
|
||||
variables = Map.fromList [
|
||||
("allLink", [])
|
||||
, ("allPage", [])
|
||||
, ("allTaggedPage", ["tag"])
|
||||
, ("allPage", ["tag"])
|
||||
, ("commentsLink", [])
|
||||
, ("commentsSection", [])
|
||||
, ("dateFormat", [])
|
||||
, ("latestLink", [])
|
||||
, ("latestPage", [])
|
||||
, ("latestTaggedPage", ["tag"])
|
||||
, ("latestPage", ["tag"])
|
||||
, ("metadata", ["author", "date", "tags"])
|
||||
, ("rssLink", [])
|
||||
, ("rssTitle", ["tag"])
|
||||
|
|
Loading…
Reference in a new issue