add microdata

This commit is contained in:
nek0 2019-09-24 04:38:11 +02:00
parent 286a142e4e
commit 1f477797f5
3 changed files with 27 additions and 19 deletions

View File

@ -91,8 +91,7 @@ main =
let ctx = (postCtx tags) <> pageCtx <> flattrCtx
full <- loadAndApplyTemplate "templates/post.html" ctx compiled
_ <- saveSnapshot "content" compiled
loadAndApplyTemplate "templates/default.html" baseCtx full
>>= relativizeUrls
loadAndApplyTemplate "templates/default.html" (baseCtx <> ctx) full
-- Post tags
tagsRules tags $ \tag pattern -> do

View File

@ -25,7 +25,7 @@
<link rel="icon" type="image/x-icon" href="/images/nekonet.ico">
<!--<script type="text/javascript">document.domain="nek0.eu"</script>-->
</head>
<body class="site">
<body itemscope itemtype="https://schema.org/Blog" class="site">
<div class="wrapper">
<header>
<a href="/">Nek0's Blog</a>
@ -86,8 +86,13 @@
</ul>
</div>
</div>
$if(datetime)$
<article itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<h1 itemprop="headline">$title$</h1>
$else$
<article>
<h1>$title$</h1>
$endif$
$body$
</article>

View File

@ -1,14 +1,18 @@
<div class="info">
Posted on <time datetime="$datetime$">$date$</time>
Posted on <time itemprop="datePublished" datetime="$datetime$">$date$</time>
$if(author)$
by $author$
by <span itemprop="publisher author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name ">$author$</span>
</span>
$endif$
$if(tags)$
in $tags$
$endif$
</div>
$body$
<div itemprop="articleBody">
$body$
</div>
<a class="liberapay" href="https://liberapay.com/nek0/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>