microformats: add h-entry and h-feed #75

This commit is contained in:
Dmitry Kolosov 2021-01-20 22:12:50 +03:00
parent c1dce73359
commit 3620926038
6 changed files with 40 additions and 24 deletions

View File

@ -319,6 +319,14 @@ article header h1 a {
display: inline; display: inline;
} }
.post-hidden-url {
display: none;
}
.post-hidden-author {
display: none;
}
.post-date { .post-date {
white-space: nowrap; white-space: nowrap;
} }

View File

@ -3,15 +3,17 @@
{{ .Content }} {{ .Content }}
</div> </div>
<div class="articles h-feed">
<h1 class="post-title">{{ i18n .Title }}</h1> <h1 class="post-title">{{ i18n .Title }}</h1>
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range $pages }} {{ range $pages }}
<div class="post-short-list"> <div class="post-short-list h-entry">
<header class="post-header"> <header class="post-header">
<h2 class="post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2> <h2 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2>
</header> </header>
{{ partial "postInfo.html" . }} {{ partial "postInfo.html" . }}
</div> </div>
{{ end }} {{ end }}
</div>
{{ end }} {{ end }}

View File

@ -7,11 +7,11 @@
</nav> </nav>
{{ end }} {{ end }}
<article class="post"> <article class="post h-entry">
<header class="post-header"> <header class="post-header">
<h1 class="post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " }}</h1> <h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " }}</h1>
</header> </header>
<div class="content"> <div class="content e-content">
{{ .Content }} {{ .Content }}
</div> </div>
{{ partial "postInfo.html" . }} {{ partial "postInfo.html" . }}

View File

@ -3,10 +3,12 @@
{{ .Content }} {{ .Content }}
</div> </div>
<div class="articles h-feed">
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range (.Paginate $pages).Pages }} {{ range (.Paginate $pages).Pages }}
{{ partial "postSummary.html" . }} {{ partial "postSummary.html" . }}
{{ end }} {{ end }}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
</div>
{{ end }} {{ end }}

View File

@ -5,8 +5,12 @@
<div class="post-info"> <div class="post-info">
{{ if .Params.date }} {{ if .Params.date }}
<div class="post-date">{{ .Params.date.Format $dateFormat }}</div> <div class="post-date dt-published">{{ .Params.date.Format $dateFormat }}</div>
{{ end }} {{ end }}
<a class="post-hidden-url u-url" href="{{ .Permalink }}">{{ .Permalink }}</a>
<div class="post-hidden-author p-author">{{ .Params.author | default .Site.Params.author }}</div>
<div class="post-taxonomies"> <div class="post-taxonomies">
{{ if .Params.categories }} {{ if .Params.categories }}
<ul class="post-categories"> <ul class="post-categories">

View File

@ -1,14 +1,14 @@
<article class="post-list"> <article class="post-list h-feed">
<header class="post-header"> <header class="post-header">
<h1 class="post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h1> <h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h1>
</header> </header>
<div class="content post-summary"> <div class="content post-summary p-summary">
{{ .Summary | safeHTML }} {{ .Summary | safeHTML }}
</div> </div>
{{ if and (.Truncated) (.Site.Params.readMore) }} {{ if and (.Truncated) (.Site.Params.readMore) }}
<div class="read-more"> <div class="read-more">
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a> <a class="u-url" href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
</div> </div>
{{ end }} {{ end }}