summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-01-29 16:17:09 +0100
committerMateja <mail@matejamaric.com>2021-01-29 16:17:09 +0100
commitdfce7e8e7a7ea9120ea18f5b50643dc12aaec331 (patch)
treedbe794088cf2b8e378aebe4ce624df90f98674e9
parentefa71ff90fb0fe6727d9b2fc2cb496a1ea514951 (diff)
downloadblog-dfce7e8e7a7ea9120ea18f5b50643dc12aaec331.tar.gz
blog-dfce7e8e7a7ea9120ea18f5b50643dc12aaec331.zip
Using Schema.org microdata.
-rw-r--r--layouts/_default/baseof.html8
-rw-r--r--layouts/blog/single.html18
2 files changed, 15 insertions, 11 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 4a0c152..56e582c 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -5,17 +5,9 @@
<meta name="yandex-xverification" content="fc9dd63070a12909">
<meta charset="UTF-8" />
<meta author="Mateja Maric" />
-
{{ if .Description }}
<meta name="description" content="{{ .Description }}">
{{ end }}
- {{ if .PublishDate }}
- <meta property="article:published_time" content="{{ .Date.Format `2006-01-02T15:04:05Z0700` }}" />
- {{ end }}
- {{ if .Lastmod }}
- <meta property="article:modified_time" content="{{ .Lastmod.Format `2006-01-02T15:04:05Z0700` }}" />
- {{ end }}
-
<link rel="canonical" href="{{ .Permalink }}" />
<meta name="viewport" content="width=device-width initial-scale=1.0" />
<link href="/style.css" rel="stylesheet" type="text/css" />
diff --git a/layouts/blog/single.html b/layouts/blog/single.html
index 4db531d..50ec4d8 100644
--- a/layouts/blog/single.html
+++ b/layouts/blog/single.html
@@ -1,7 +1,19 @@
{{ define "main" }}
-<h1>{{ .Title }}</h1>
+<div itemscope itemtype="http://schema.org/Article">
+ <h1 itemprop="headline">{{ .Title }}</h1>
-<em>{{ .Date.Format "2 Jan 2006" }}</em>
+ <em>
+ Published:
+ <time itemprop="dateCreated" datetime="{{ .Date.Format `2006-01-02` }}">{{ .Date.Format "2 Jan 2006" }}</time>
+ {{ if not (eq .Lastmod .Date) }}
+ <br>Modified:
+ <time itemprop="dateModified"
+ datetime="{{ .Lastmod.Format `2006-01-02` }}">{{ .Lastmod.Format "2 Jan 2006" }}</time>
+ {{ end }}
+ </em>
-{{ .Content }}
+ <div itemprop="articleBody">
+ {{ .Content }}
+ </div>
+</div>
{{ end }}