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;
}
.post-hidden-url {
display: none;
}
.post-hidden-author {
display: none;
}
.post-date {
white-space: nowrap;
}

View File

@ -3,15 +3,17 @@
{{ .Content }}
</div>
<h1 class="post-title">{{ i18n .Title }}</h1>
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range $pages }}
<div class="post-short-list">
<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>
</header>
{{ partial "postInfo.html" . }}
</div>
{{ end }}
<div class="articles h-feed">
<h1 class="post-title">{{ i18n .Title }}</h1>
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range $pages }}
<div class="post-short-list h-entry">
<header class="post-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>
</header>
{{ partial "postInfo.html" . }}
</div>
{{ end }}
</div>
{{ end }}

View File

@ -2,16 +2,16 @@
{{ if .Menus }}
<nav class="post-navigation">
{{ range .Menus }}
<a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
<a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
{{ end }}
</nav>
{{ end }}
<article class="post">
<article class="post h-entry">
<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>
<div class="content">
<div class="content e-content">
{{ .Content }}
</div>
{{ partial "postInfo.html" . }}

View File

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

View File

@ -5,8 +5,12 @@
<div class="post-info">
{{ if .Params.date }}
<div class="post-date">{{ .Params.date.Format $dateFormat }}</div>
<div class="post-date dt-published">{{ .Params.date.Format $dateFormat }}</div>
{{ 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">
{{ if .Params.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">
<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>
<div class="content post-summary">
<div class="content post-summary p-summary">
{{ .Summary | safeHTML }}
</div>
{{ if and (.Truncated) (.Site.Params.readMore) }}
<div class="read-more">
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
<a class="u-url" href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
</div>
{{ end }}