diff options
author | Mickael <mckmonster@mailo.com> | 2019-09-08 20:01:25 +0300 |
---|---|---|
committer | Mickael <mckmonster@mailo.com> | 2019-09-08 20:01:25 +0300 |
commit | daa0bcb0e553af829de0a090d3156a574d6d063a (patch) | |
tree | 4287670e29221e02db7b80558ad4bcd35bbcdaed /layouts | |
parent | b71c2754dc32bb8690fabe795c300a7432243191 (diff) |
To have the same display on each pages
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/list.html | 33 | ||||
-rw-r--r-- | layouts/index.html | 35 | ||||
-rw-r--r-- | layouts/partials/post_preview.html | 34 |
3 files changed, 36 insertions, 66 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 5e52b60..e08da36 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -9,38 +9,7 @@ {{ end }} <div class="posts-list"> {{ range .Paginator.Pages }} - <article class="post-preview"> - <a href="{{ .Permalink }}"> - <h2 class="post-title">{{ .Title }}</h2> - - {{ if .Params.subtitle }} - <h3 class="post-subtitle"> - {{ .Params.subtitle }} - </h3> - {{ end }} - </a> - - <p class="post-meta"> - {{ partial "post_meta.html" . }} - </p> - <div class="post-entry"> - {{ if .Truncated }} - {{ .Summary }} - <a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a> - {{ else }} - {{ .Content }} - {{ end }} - </div> - - {{ if .Params.tags }} - <div class="blog-tags"> - {{ range .Params.tags }} - <a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a> - {{ end }} - </div> - {{ end }} - - </article> + {{ partial "post_preview.html" .}} {{ end }} </div> {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} diff --git a/layouts/index.html b/layouts/index.html index d72364a..cc15000 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -11,40 +11,7 @@ <div class="posts-list"> {{ $pag := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }} {{ range $pag.Pages }} - <article class="post-preview"> - <a href="{{ .Permalink }}"> - <h2 class="post-title">{{ .Title }}</h2> - {{ if .Params.subtitle }} - <h3 class="post-subtitle"> - {{ .Params.subtitle }} - </h3> - {{ end }} - {{ if .Params.image }} - <img src="{{ .Params.image }}" alt="{{ .Title }}" class="img-title" /> - {{ end }} - {{ if .Params.video }} - <video src="{{ .Params.video }}" loop autoplay muted playsinline class="img-title" /> - {{ end }} - </a> - - {{ partial "post_meta.html" . }} - <div class="post-entry"> - {{ if .Truncated }} - {{ if .Params.summary }}{{ .Params.summary }}{{ else }}{{ .Summary }}{{ end }} - <a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a> - {{ else }} - {{ .Content }} - {{ end }} - </div> - - {{ if .Params.tags }} - <div class="blog-tags"> - {{ range .Params.tags }} - <a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a> - {{ end }} - </div> - {{ end }} - </article> + {{ partial "post_preview" . }} {{ end }} </div> diff --git a/layouts/partials/post_preview.html b/layouts/partials/post_preview.html new file mode 100644 index 0000000..0a7c0a7 --- /dev/null +++ b/layouts/partials/post_preview.html @@ -0,0 +1,34 @@ +<article class="post-preview"> + <a href="{{ .Permalink }}"> + <h2 class="post-title">{{ .Title }}</h2> + {{ if .Params.subtitle }} + <h3 class="post-subtitle"> + {{ .Params.subtitle }} + </h3> + {{ end }} + {{ if .Params.image }} + <img src="{{ .Params.image }}" alt="{{ .Title }}" class="img-title" /> + {{ end }} + </a> + + <p class="post-meta"> + {{ partial "post_meta.html" . }} + </p> + <div class="post-entry"> + {{ if .Truncated }} + {{ .Summary }} + <a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a> + {{ else }} + {{ .Content }} + {{ end }} + </div> + + {{ if .Params.tags }} + <div class="blog-tags"> + {{ range .Params.tags }} + <a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a> + {{ end }} + </div> + {{ end }} + +</article>
\ No newline at end of file |