Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tomáš Zemanovič
tzemanovic.gitlab.io
Commits
7d856348
Verified
Commit
7d856348
authored
Sep 03, 2019
by
Tomáš Zemanovič
Browse files
add metadata field for canonical url
parent
605d2613
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Main.hs
View file @
7d856348
...
...
@@ -101,16 +101,19 @@ postCtx =
dateField
"date"
"%B %e, %Y"
<>
constField
"active-blog"
"y"
<>
ertField
"ert"
<>
metaKeywordCtx
<>
metaKeywordsCtx
<>
canonicalUrlCtx
<>
defaultContext
metaKeywordCtx
::
Context
String
metaKeywordCtx
=
field
"metaKeywords"
$
\
item
->
do
tags
<-
getMetadataField
(
itemIdentifier
item
)
"tags"
return
$
maybe
""
showMetaTags
tags
where
showMetaTags
t
=
"<meta name=
\"
keywords
\"
content=
\"
"
++
t
++
"
\"
/>
\n
"
metaKeywordsCtx
::
Context
String
metaKeywordsCtx
=
field
"meta-keywords"
$
\
item
->
do
getMetadataField'
(
itemIdentifier
item
)
"tags"
canonicalUrlCtx
::
Context
String
canonicalUrlCtx
=
field
"canonical-url"
$
\
item
->
do
getMetadataField'
(
itemIdentifier
item
)
"canonical-url"
-- estimated reading time
...
...
src/templates/default.html
View file @
7d856348
...
...
@@ -6,7 +6,11 @@
<meta
name=
"description"
content=
""
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<meta
name=
"author"
content=
"Tomáš Zemanovič"
/>
$if(metaKeywords)$ $metaKeywords$ $endif$
$if(meta-keywords)$
<meta
name=
"keywords"
content=
"$meta-keywords$"
/>
$endif$ $if(canonical-url)$
<link
rel=
"canonical"
href=
"$canonical-url$"
/>
$endif$
<meta
name=
"theme-color"
content=
"#10151f"
/>
<meta
name=
"google-site-verification"
...
...
src/templates/post.html
View file @
7d856348
...
...
@@ -14,7 +14,11 @@
$ert$
</div>
</div>
<div
id=
"post-body"
class=
"pure-u"
>
$body$
</div>
<div
id=
"post-body"
class=
"pure-u"
>
$if(canonical-url)$
<em>
Originally posted at
<a
href=
"$canonical-url$"
>
$canonical-url$
</a>
.
</em
><br
/>
$endif$ $body$
</div>
<div
id=
"post-footer"
class=
"social-share tooltips"
>
<a
href=
"/"
title=
"back"
><i
class=
"fas fa-arrow-circle-left"
></i>
back
</a>
<a
...
...
src/tzemanovic.cabal
View file @
7d856348
name: tzemanovic
version: 1.0.
0
.0
version: 1.0.
1
.0
synopsis: Blog website
description: Please see README.md
homepage: https://gitlab.com/tzemanovic/tzemanovic.gitlab.io
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment