Skip to content
Snippets Groups Projects
Commit d9213fd8 authored by Olivia206's avatar Olivia206
Browse files

reset config and made some adjustments to posts large and hightlight

parent 61518b48
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +81,12 @@ params:
show_description: true
truncate_description: 200 # Set to 0 to disable truncate
layout: list # grid | list
options:
hide_image: false
hide_summary: false
hide_category: false
hide_author: false
hide_date: false
share_links:
facebook: true
twitter: true
......
......@@ -3,6 +3,7 @@
{{- $term := false -}}
{{- $layout := .block.data.layout | default "grid" -}}
{{- with .block.data }}
{{- $options := dict
"hide_image" .hide_image
......
......@@ -32,10 +32,10 @@
<a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a>
{{ $heading_tag.close }}
{{ if and site.Params.posts.index.show_categories (eq $options.hide_cathegory false) }}
{{ if eq $options.hide_cathegory false }}
{{- partial "posts/categories" . -}}
{{ end }}
{{ if and site.Params.posts.index.show_description (eq $options.hide_summary false) }}
{{ if eq $options.hide_summary false }}
{{- if (partial "GetTextFromHTML" .Params.summary) -}}
<p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
......@@ -48,7 +48,7 @@
{{- if eq $options.hide_date false -}}
<time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format site.Params.posts.date_format }}</time>
{{ end }}
{{ if and site.Params.posts.index.show_author (eq $options.hide_author false) }}
{{ if eq $options.hide_author false }}
{{- partial "posts/author" . -}}
{{ end }}
</div>
......
......@@ -25,19 +25,19 @@
{{ $heading_tag.close }}
<div class="post-meta">
{{ if and site.Params.posts.index.show_author (eq $options.hide_author false) }}
{{ if eq $options.hide_author false }}
{{- partial "posts/author" . -}}
{{ end }}
{{ if eq $options.hide_date false }}
<time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format site.Params.posts.date_format }}</time>
{{ end }}
{{ if and site.Params.posts.index.show_categories (eq $options.hide_cathegory false) }}
{{ if eq $options.hide_cathegory false }}
{{- partial "posts/categories" . -}}
{{ end }}
</div>
{{ if and site.Params.posts.index.show_description (eq $options.hide_summary false) }}
{{ if eq $options.hide_summary false }}
{{- if (partial "GetTextFromHTML" .Params.summary) -}}
<p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
......
......@@ -15,56 +15,54 @@
{{ with $post }}
{{ if .Params.image }}
{{- $direction = partial "GetImageDirection" .Params.image -}}
{{ end }}
{{ if .Params.image }}
{{- $direction = partial "GetImageDirection" .Params.image -}}
{{ end }}
<article class='post {{ if $alternate }} {{- if (not (isset .Params "image")) -}} without-image {{- end -}}{{ $direction }} {{if not (modBool $index 2)}}left{{ else}}right{{end}}{{end}}' itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting">
<div class="post-content">
{{- $title := partial "PrepareHTML" .Title -}}
<article class='post {{ if $alternate }} {{- if (not (isset .Params "image")) -}} without-image {{- end -}}{{ $direction }} {{if not (modBool $index 2)}}left{{ else}}right{{end}}{{end}}' itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting">
<div class="post-content">
{{- $title := partial "PrepareHTML" .Title -}}
{{ $heading_tag.open }}
<a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a>
{{ $heading_tag.close }}
{{ $heading_tag.open }}
<a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a>
{{ $heading_tag.close }}
{{ if and site.Params.posts.index.show_categories $show_category }}
{{- partial "posts/categories" . -}}
{{ end }}
{{ if $show_category }}
{{- partial "posts/categories" . -}}
{{ end }}
{{ if and site.Params.posts.index.show_description $show_summary }}
{{- if (partial "GetTextFromHTML" .Params.summary) -}}
<p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
"length" site.Params.posts.index.truncate_description
) }}</p>
{{- end -}}
{{- end -}}
{{ if or $show_author $show_date }}
<div class="post-meta">
{{ if $show_date }}
<time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format site.Params.posts.date_format }}</time>
{{ end }}
{{ if and site.Params.posts.index.show_author $show_author }}
{{- partial "posts/author" . -}}
{{ end }}
</div>
{{ end }}
</div>
{{ if $show_image }}
<div class="media">
{{- if and .Params.image -}}
{{- partial "commons/image.html"
(dict
"image" .Params.image
"sizes" site.Params.image_sizes.sections.posts.item
) -}}
{{- else -}}
{{- partial "commons/image-default.html" "posts" -}}
{{ if $show_summary }}
{{- if (partial "GetTextFromHTML" .Params.summary) -}}
<p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
"length" site.Params.posts.index.truncate_description
) }}</p>
{{- end -}}
{{- end -}}
{{ if or $show_author $show_date }}
<div class="post-meta">
{{ if $show_date }}
<time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format site.Params.posts.date_format }}</time>
{{ end }}
{{ if $show_author }}
{{- partial "posts/author" . -}}
{{ end }}
</div>
{{ end }}
</div>
{{- end -}}
</article>
{{ if $show_image }}
<div class="media">
{{- if and .Params.image -}}
{{- partial "commons/image.html"
(dict
"image" .Params.image
"sizes" site.Params.image_sizes.sections.posts.item
) -}}
{{- else -}}
{{- partial "commons/image-default.html" "posts" -}}
{{- end -}}
</div>
{{- end -}}
</article>
{{ end }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment