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>
<h1 class="post-title">{{ i18n .Title }}</h1> <div class="articles h-feed">
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} <h1 class="post-title">{{ i18n .Title }}</h1>
{{ range $pages }} {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
<div class="post-short-list"> {{ range $pages }}
<header class="post-header"> <div class="post-short-list h-entry">
<h2 class="post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2> <header class="post-header">
</header> <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>
{{ partial "postInfo.html" . }} </header>
</div> {{ partial "postInfo.html" . }}
{{ end }} </div>
{{ end }}
</div>
{{ end }} {{ end }}

View File

@ -2,16 +2,16 @@
{{ if .Menus }} {{ if .Menus }}
<nav class="post-navigation"> <nav class="post-navigation">
{{ range .Menus }} {{ range .Menus }}
<a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a> <a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
{{ end }} {{ end }}
</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>
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} <div class="articles h-feed">
{{ range (.Paginate $pages).Pages }} {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ partial "postSummary.html" . }} {{ range (.Paginate $pages).Pages }}
{{ end }} {{ partial "postSummary.html" . }}
{{ partial "pagination.html" . }} {{ end }}
{{ 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 }}