mirror of
https://github.com/dillonzq/LoveIt.git
synced 2025-01-07 11:15:44 +01:00
76 lines
2.9 KiB
HTML
76 lines
2.9 KiB
HTML
{{ $cdn_url := .Scratch.Get "cdn_url" }}
|
|
|
|
<div class="post-warp">
|
|
<div class="intro">
|
|
{{ $avatar := "" }}
|
|
{{ if or .Params.gravatar.Email (and .Site.Params.gravatar.Email (ne .Params.gravatar.Email false)) }}
|
|
{{ $avatar = (printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" (md5 .Site.Params.gravatar.email)) }}
|
|
{{ else if .Site.Params.avatar }}
|
|
{{ $avatar = (printf "%s%s" $cdn_url .) }}
|
|
{{ end }}
|
|
{{ if $avatar }}
|
|
<div class="avatar">
|
|
<a href="/posts/"> <img src={{ $avatar }} alt="avatar"></a>
|
|
</div>
|
|
{{ end }}
|
|
|
|
{{ with .Site.Params.subtitle }}
|
|
<h2 class="description">
|
|
<div id="subtitle"></div>
|
|
</h2>
|
|
<script>
|
|
var typeitMap = window.typeitMap || {};
|
|
typeitMap["#subtitle"] = "{{ . }}";
|
|
</script>
|
|
{{ end }}
|
|
</div>
|
|
|
|
{{ range (.Paginate .Pages).Pages }}
|
|
<article class="post" itemscope itemscope="" itemtype="http://schema.org/Article">
|
|
|
|
<header class="post-header">
|
|
<h1 class="post-title" itemprop="name headline"><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
|
|
</header>
|
|
<div class="post-content">
|
|
<!--featured_image-->
|
|
{{ with .Params.featured_image }}
|
|
{{- $img := . -}}
|
|
<p><img src="{{ printf "%s%s" $cdn_url $img }}" class="featured_image"></p>
|
|
{{ end }}
|
|
<!-- end featured_image-->
|
|
|
|
{{ .Summary }}
|
|
</div>
|
|
<div class="post-footer">
|
|
<div class="post-meta">
|
|
<span class="post-time">
|
|
<time datetime={{.Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
|
|
itemprop="datePublished">{{ .Date.Format (.Site.Params.dateFormatToUse | default "2 January 2006") }}</time>
|
|
</span>
|
|
in
|
|
{{ with .Params.categories -}}
|
|
<i class="iconfont icon-folder"></i>
|
|
<span class="post-category">
|
|
{{ range . }}
|
|
{{- $name := . -}}
|
|
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
|
|
<a href="{{ .Permalink }}"> {{ $name }} </a>
|
|
{{ end -}}
|
|
{{ end }}
|
|
</span>
|
|
{{- end }}
|
|
</div>
|
|
{{ with .Params.tags }}
|
|
<div class="post-tags">
|
|
{{ range . }}
|
|
<span class="tag"><a href="{{ "tags/" | absURL }}{{ . | urlize }}/">
|
|
#{{.}}</a></span>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
</article>
|
|
{{ end }}
|
|
|
|
{{ partial "paginator.html" . }}
|
|
</div>
|