Compare commits

...

6 Commits

Author SHA1 Message Date
Kevin C. Coram d7f52b0d64
Use h-feed for section, taxonomy, and taxonomyTerm 2019-12-07 21:48:06 -05:00
Kevin C. Coram 779f3c20e0
Wrap homepage list in h-feed microformat 2019-12-07 14:34:57 -05:00
Kevin C. Coram 7de183f6c6
Add an example config for header for home page list section 2019-12-07 14:32:52 -05:00
Kevin C. Coram f44ae3d46d
Add a u-url link to the Permalink to the page 2019-12-07 14:07:47 -05:00
Kevin C. Coram 1a2aa49bbf
Make list content block optional
* Only generate a content block if there is content to show
* Change to use a <div> instead of <header> for the list conent
2019-12-07 14:07:29 -05:00
Kevin C. Coram dccbceb218
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
2019-12-07 13:51:12 -05:00
6 changed files with 33 additions and 17 deletions

View File

@ -10,6 +10,7 @@ paginate = 5
[params] [params]
subtitle = "A theme with no CSS and only basic layouts" subtitle = "A theme with no CSS and only basic layouts"
homepageSectionTitle = "What's New"
mainSections = [ "posts" ] mainSections = [ "posts" ]
# Configuration Parameters for IndieWeb h-card # Configuration Parameters for IndieWeb h-card

View File

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

View File

@ -3,12 +3,14 @@
{{ .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"> {{ if .Content }}
<div class="list-content e-content">
{{ .Content }} {{ .Content }}
</header> </div>
{{ end }}
{{ range $index, $page := (.Paginate (where .Pages ".Params.hidden" "!=" "true")).Pages }} {{ range $index, $page := (.Paginate (where .Pages ".Params.hidden" "!=" "true")).Pages }}
{{ if ne $index 0 }} {{ if ne $index 0 }}
{{ end }} {{ end }}

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 u-url"><a href="{{ .Permalink }}">{{ .Title }}</a></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 }}

View File

@ -1,14 +1,19 @@
{{ define "content" }} {{ define "content" }}
<article class="homepage-content"> <article class="homepage-content h-entry e-content">
<!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md --> <!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
{{.Content}} {{.Content}}
</article> </article>
<!-- Note that .Pages is the same as .Site.RegularPages on the homepage template. --> <section class="h-feed">
{{ range $index, $page := (.Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.hidden" "!=" "true" )).Pages }} {{ if .Site.Params.homepageSectionTitle }}
{{ if ne $index 0 }} <h2 class="p-name u-url"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.homepageSectionTitle }}</a></h2>
{{ end }} {{ end }}
{{ .Render "summary" }} <!-- Note that .Pages is the same as .Site.RegularPages on the homepage template. -->
{{ end }} {{ range $index, $page := (.Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.hidden" "!=" "true" )).Pages }}
{{ if ne $index 0 }}
{{ end }}
{{ .Render "summary" }}
{{ end }}
</section>
{{ end }} {{ end }}
{{ define "content-footer" }} {{ define "content-footer" }}
{{ partial "paginator.html" .Paginator }} {{ partial "paginator.html" .Paginator }}