Add h-entry and h-feed microformats

* Add h-entry microformat markup to single page template
* Add h-feed wrapper around list of articles in list template
* Add h-entry to summary template
master
Kevin C. Coram 2019-12-07 13:51:12 -05:00
parent 911f999379
commit dccbceb218
Signed by: kevin
GPG Key ID: 0342351B3D61AD35
4 changed files with 17 additions and 9 deletions

View File

@ -29,7 +29,7 @@
{{- end }} {{- end }}
</nav> </nav>
</header> </header>
<main> <main {{ if eq .Kind "page" }}class="h-entry"{{ else if eq .Kind "section" }}class="h-feed"{{ end }}>
<header> <header>
{{- block "content-header" . -}} {{- block "content-header" . -}}
{{- end -}} {{- end -}}

View File

@ -3,10 +3,10 @@
{{ .Title }} &ndash; {{ .Site.Title }} {{ .Title }} &ndash; {{ .Site.Title }}
{{ end }} {{ end }}
{{ define "content-header" }} {{ define "content-header" }}
<h1 id="title">{{ .Title }}</h1> <h1 class="p-name">{{ .Title }}</h1>
{{ end }} {{ end }}
{{ define "content" }} {{ define "content" }}
<header class="list-content"> <header class="list-content e-content">
{{ .Content }} {{ .Content }}
</header> </header>
{{ range $index, $page := (.Paginate (where .Pages ".Params.hidden" "!=" "true")).Pages }} {{ range $index, $page := (.Paginate (where .Pages ".Params.hidden" "!=" "true")).Pages }}

View File

@ -3,10 +3,14 @@
{{ .Title }} &ndash; {{ .Site.Title }} {{ .Title }} &ndash; {{ .Site.Title }}
{{ end }} {{ end }}
{{ define "content-header" }} {{ define "content-header" }}
<h1>{{ .Title }}</h1> <h1 class="p-name">{{ .Title }}</h1>
<p>
Published by <a class="p-author h-card" href="{{ .Site.BaseURL }}">{{ .Site.Params.Card.Author }}</a> on
<time class="dt-published" datetime="{{ .Date }}">{{ .Date.Format "January 2, 2006" }}</time>
</p>
{{ end }} {{ end }}
{{ define "content" }} {{ define "content" }}
<article> <article class="e-content">
{{ .Content }} {{ .Content }}
</article> </article>
{{ end }} {{ end }}

View File

@ -1,9 +1,13 @@
<article class="post"> <article class="h-entry">
<header> <header>
<h2><a href='{{ .Permalink }}'>{{ .Title }}</a> </h2> <h2 class="p-name u-url"><a href='{{ .Permalink }}'>{{ .Title }}</a> </h2>
<div class="post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} Words </div> <p>
Published by <a class="p-author h-card" href="{{ .Site.BaseURL }}">{{ .Site.Params.Card.Author }}</a> on
<time class="dt-published" datetime="{{ .Date }}">{{ .Date.Format "January 2, 2006" }}</time>
&ndash; {{ .FuzzyWordCount }} Words
</p>
</header> </header>
<section> <section class="p-summary">
{{ .Summary }} {{ .Summary }}
</section> </section>
{{- if .Truncated }} {{- if .Truncated }}