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 let ctx = (postCtx tags) <> pageCtx <> flattrCtx
full <- loadAndApplyTemplate "templates/post.html" ctx compiled full <- loadAndApplyTemplate "templates/post.html" ctx compiled
_ <- saveSnapshot "content" compiled _ <- saveSnapshot "content" compiled
loadAndApplyTemplate "templates/default.html" baseCtx full loadAndApplyTemplate "templates/default.html" (baseCtx <> ctx) full
>>= relativizeUrls
-- Post tags -- Post tags
tagsRules tags $ \tag pattern -> do tagsRules tags $ \tag pattern -> do

View file

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

View file

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