diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 00a055046676a04f31809b5a47f3cd7d8fbc239a..90505f7e2f9509abd72778be2001759ceecbf7d9 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -7,35 +7,7 @@ {{ range $index, $element := $paginator.Pages }} <article class='post'> - <header class='post-header'> - <h2 class='post-title'> - <a href="{{ .Permalink }}">{{ .Title}}</a> - {{ if .Params.link }} — <a href="{{.Params.link}}">🔗</a>{{end}} - </h2> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_list.html" . }} <section class='post-content'> {{.Content }} </section> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 5006d29216a1c2906b78bed953e04ff14f6d8a38..74cb360abd68430d3ae1c9c4bc6b3f08e254e0d5 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,31 +2,7 @@ <div class='row'> <div class='col-md-8'> <article class='post'> - <header class='post-header'> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_single.html" . }} <section class='post-content'> {{ if isset .Params "toc" }}{{ .TableOfContents }}{{ end}} {{ .Content }} diff --git a/layouts/entry/single.html b/layouts/entry/single.html index 2cca777570220ac6f9a907b9b81ddd9ec7d51a00..b3d308d1eac28fa7d4c2f393e883e80787e315ef 100644 --- a/layouts/entry/single.html +++ b/layouts/entry/single.html @@ -3,31 +3,7 @@ <div class='row'> <div class='col-md-8'> <article class='post'> - <header class='post-header'> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_single.html" . }} <section class='post-content'> {{ if isset .Params "toc" }}{{ .TableOfContents }}{{ end}} {{ .Content }} diff --git a/layouts/news/list.html b/layouts/news/list.html index de0b3b753d89cae1c7ef219ecedd34e4be4308be..5776753b2e79c5ca1a71af238e2ac9338e667bc1 100644 --- a/layouts/news/list.html +++ b/layouts/news/list.html @@ -7,35 +7,7 @@ {{ range $index, $element := $paginator.Pages }} <article class='post'> - <header class='post-header'> - <h2 class='post-title'> - <a href="{{ .Permalink }}">{{ .Title}}</a> - {{ if .Params.link }} — <a href="{{.Params.link}}">🔗</a>{{end}} - </h2> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_list.html" . }} <section class='post-content'> {{.Content }} </section> diff --git a/layouts/news/single.html b/layouts/news/single.html index 70ecde8b261549bf07f2f081dc0bb6ae6767948b..83b1f4fa2cb50276d3d65b8c5bef928a65a41d54 100644 --- a/layouts/news/single.html +++ b/layouts/news/single.html @@ -2,31 +2,7 @@ <div class='row'> <div class='col-md-8'> <article class='post'> - <header class='post-header'> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_single.html" . }} <section class='post-content'> {{ if isset .Params "toc" }}{{ .TableOfContents }}{{ end}} {{ .Content }} diff --git a/layouts/partials/post_header_list.html b/layouts/partials/post_header_list.html new file mode 100644 index 0000000000000000000000000000000000000000..d8ac98b792799f2366f593141c5d4ce7e6be1654 --- /dev/null +++ b/layouts/partials/post_header_list.html @@ -0,0 +1,7 @@ +<header class='post-header'> + <h2 class='post-title'> + <a href="{{ .Permalink }}">{{ .Title}}</a> + {{ if .Params.link }} — <a href="{{.Params.link}}">🔗</a>{{end}} + </h2> + {{ partial "post_subheader.html" . }} +</header> diff --git a/layouts/partials/post_header_single.html b/layouts/partials/post_header_single.html new file mode 100644 index 0000000000000000000000000000000000000000..9db761a899e0c8303350e5dd659034bac8de3380 --- /dev/null +++ b/layouts/partials/post_header_single.html @@ -0,0 +1,3 @@ +<header class='post-header'> + {{ partial "post_subheader.html" . }} +</header> diff --git a/layouts/partials/post_subheader.html b/layouts/partials/post_subheader.html new file mode 100644 index 0000000000000000000000000000000000000000..e4fa69032bfe24f90e0839a04d3e8c46f7db0157 --- /dev/null +++ b/layouts/partials/post_subheader.html @@ -0,0 +1,23 @@ +<section class='post-meta text-muted'> + <ul class='list-inline'> + <li> + <i class='fa fa-calendar'></i> + <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> + </li> + <li> + <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> + <span class='hidden'>Book icon</span> + </a> + <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> + </li> + <li> + <i class='fa fa-folder-open'></i> + {{ $tags := .Params.tags}} + {{ with $tags }} + {{ range . }} + <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> + {{ end }} + {{ end }} + </li> + </ul> +</section> diff --git a/layouts/projects/list.html b/layouts/projects/list.html index 686e7faae1e1a8e5f1a62ae2373f2face9f045d3..46577b7b466af1eb568985ed392b399412077308 100644 --- a/layouts/projects/list.html +++ b/layouts/projects/list.html @@ -7,35 +7,7 @@ {{ range $index, $element := $paginator.Pages }} <article class='post'> - <header class='post-header'> - <h2 class='post-title'> - <a href="{{ .Permalink }}">{{ .Title}}</a> - {{ if .Params.link }} — <a href="{{.Params.link}}">🔗</a>{{end}} - </h2> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_list.html" . }} <section class='post-content'> {{.Content }} </section> diff --git a/layouts/projects/single.html b/layouts/projects/single.html index 57bc84a0bbf33132ff0097913a3061ba1fb6d550..8f085ba041abc11d1595994d50920b192ccc16c5 100644 --- a/layouts/projects/single.html +++ b/layouts/projects/single.html @@ -2,31 +2,7 @@ <div class='row'> <div class='col-md-8'> <article class='post'> - <header class='post-header'> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_single.html" . }} <section class='post-content'> {{ .Content }} diff --git a/layouts/resource/list.html b/layouts/resource/list.html index 7ab135e1c1e1dd8b6594873eaad3488be215b84c..7f25cb96073e0911d8b488ae545831a03b981f82 100644 --- a/layouts/resource/list.html +++ b/layouts/resource/list.html @@ -7,35 +7,7 @@ {{ range $index, $element := $paginator.Pages }} <article class='post'> - <header class='post-header'> - <h2 class='post-title'> - <a href="{{ .Permalink }}">{{ .Title}}</a> - {{ if .Params.link }} — <a href="{{.Params.link}}">🔗</a>{{end}} - </h2> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_list.html" . }} <section class='post-content'> {{.Content }} </section> diff --git a/layouts/resource/single.html b/layouts/resource/single.html index 3d92db957dfbc23461aa29e729c18843ec508612..79d99931f8d346cbc86a513c6b27afabc268341b 100644 --- a/layouts/resource/single.html +++ b/layouts/resource/single.html @@ -2,31 +2,7 @@ <div class='row'> <div class='col-md-8'> <article class='post'> - <header class='post-header'> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_single.html" . }} <section class='post-content'> {{ if isset .Params "toc" }}{{ .TableOfContents }}{{ end}} {{ .Content }} diff --git a/layouts/taxonomy/tag.html b/layouts/taxonomy/tag.html index 957f1f86d56981b86d455c7ecfb8c11a39cc1d33..d7a22a8f8be12189f01a87bb9c0b23a296797899 100644 --- a/layouts/taxonomy/tag.html +++ b/layouts/taxonomy/tag.html @@ -7,35 +7,7 @@ {{ range $index, $element := $paginator.Pages }} <article class='post'> - <header class='post-header'> - <h2 class='post-title'> - <a href="{{ .Permalink }}">{{ .Title}}</a> - {{ if .Params.link }} — <a href="{{.Params.link}}">🔗</a>{{end}} - </h2> - <section class='post-meta text-muted'> - <ul class='list-inline'> - <li> - <i class='fa fa-calendar'></i> - <time class='post-date' datetime='{{ .Date.Format "2020-09-10" }}'> {{ .Date.Format "January 2 2006" }} </time> - </li> - <li> - <a class='fa-solid fa-book-open' href='{{ .Permalink }}'> - <span class='hidden'>Book icon</span> - </a> - <a href='{{ .Permalink }}'>Reading time: {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}</a> - </li> - <li> - <i class='fa fa-folder-open'></i> - {{ $tags := .Params.tags}} - {{ with $tags }} - {{ range . }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - {{ end }} - </li> - </ul> - </section> - </header> + {{ partial "post_header_list.html" . }} <section class='post-content'> {{.Content }} </section>