🏗️ Finish post copy right widget coding.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<meta property="og:site_name" content="{{ .Title | default .Site.Title }}" />
|
||||
<meta property="og:locale" content="{{ .Scratch.Get "lang" }}"/>
|
||||
{{- if .IsHome }}
|
||||
<meta property="article:author" content="{{ (delimit .Authors ",") | default .Site.Params.Author }}" />
|
||||
<meta property="article:author" content="{{ .Params.Author | default .Site.Params.Author }}" />
|
||||
<meta property="article:published_time" content="{{ .PublishDate }}" />
|
||||
<meta property="article:modified_time" content="{{ .Lastmod }}" />
|
||||
{{- end }}
|
||||
@@ -1,5 +1,6 @@
|
||||
{{ with .ctx }}
|
||||
<div class="post-body" itemprop="articleBody">
|
||||
{{- if not .IsHome }}
|
||||
{{- if $.IsHome }}
|
||||
{{- if .Params.Expand }}
|
||||
{{ .Content }}
|
||||
{{- else }}
|
||||
@@ -8,4 +9,5 @@
|
||||
{{- else }}
|
||||
{{ .Content }}
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
32
layouts/partials/post/post_copyright.html
Normal file
32
layouts/partials/post/post_copyright.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{{- if .Site.Params.creativeCommons.post }}
|
||||
<div class="post-copyright">
|
||||
<img src="/imgs/cc/cc.svg" width="75" height="75" align="right" />
|
||||
<ul>
|
||||
<li class="post-copyright-author">
|
||||
{{- if isset .Params "author" }}
|
||||
<strong>{{ print (T "PostCROriginAuthor") (T "SymbolColon") }} </strong>
|
||||
{{ .Params.Author }}
|
||||
{{- else }}
|
||||
<strong>{{ print (T "PostCRAuthor") (T "SymbolColon") }} </strong>
|
||||
{{ .Site.Params.author }}
|
||||
{{- end }}
|
||||
</li>
|
||||
<li class="post-copyright-link">
|
||||
{{- if isset .Params "originlink" }}
|
||||
<strong>{{ print (T "PostCROriginLink") (T "SymbolColon") }} </strong>
|
||||
<a target="_blank" href="{{ .Params.OriginLink }}" title="{{ .Title }}">{{ .Params.OriginLink }}</a>
|
||||
{{- else }}
|
||||
<strong>{{ print (T "PostCRLink") (T "SymbolColon") }}</strong>
|
||||
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Permalink }}</a>
|
||||
{{- end }}
|
||||
</li>
|
||||
<li class="post-copyright-license">
|
||||
<strong>{{ print (T "PostCRLink") (T "SymbolColon") }} </strong>
|
||||
{{- $ccText := .Site.Params.creativeCommons.license | upper }}
|
||||
{{- $lang := .Scratch.Get "lang" }}
|
||||
{{- $ccLink := printf "<a target='_blank' href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.%s'>%s</a>" (substr $lang 0 2) $ccText }}
|
||||
{{ printf (T "PostCRLicenseContent") $ccLink | safeHTML }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{- end }}
|
||||
@@ -1,4 +1,5 @@
|
||||
{{- if .Scratch.Get "IsHome" }}
|
||||
{{ with .ctx }}
|
||||
{{- if $.IsHome }}
|
||||
{{- if and .Site.Params.readMoreBtn (not .Params.Expand) }}
|
||||
<div class="post-button">
|
||||
<a class="btn" href="{{ .Permalink }}#more" rel="contents">
|
||||
@@ -8,6 +9,7 @@
|
||||
{{- end }}
|
||||
<div class="post-eof"></div>
|
||||
{{- else }}
|
||||
{{ partial "post/post_copyright.html" . }}
|
||||
<div class="post-nav">
|
||||
<div class="post-nav-next post-nav-item">
|
||||
{{- with .NextInSection }}
|
||||
@@ -25,4 +27,5 @@
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
@@ -1,3 +1,4 @@
|
||||
{{ with .ctx }}
|
||||
<link itemprop="mainEntityOfPage" href="{{ .Permalink }}">
|
||||
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
|
||||
<meta itemprop="image" content="{{ .Site.Params.avatar.url }}">
|
||||
@@ -13,30 +14,33 @@
|
||||
</span>
|
||||
<header class="post-header">
|
||||
<h2 class="post-title" itemprop="name headline">
|
||||
{{- if and (isset .Params "sticky") (gt .Params.Sticky 0) }}
|
||||
{{- if and .Weight (gt .Weight 0) }}
|
||||
<span class="post-sticky-flag" title="{{ T "PostStickyTitle" }}">
|
||||
<i class="fa fa-thumbtack"></i>
|
||||
</span>
|
||||
{{- end }}
|
||||
{{- if and (isset .Params "link") (ne .Params.Link "") }}
|
||||
<a href="{{ .Params.Link }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-title-link post-title-link-external">
|
||||
{{ .Title }}
|
||||
<i class="fa fa-external-link-alt"></i>
|
||||
</a>
|
||||
{{- if $.IsHome }}
|
||||
{{- if and (isset .Params "link") (ne .Params.Link "") }}
|
||||
<a href="{{ .Params.Link }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-title-link post-title-link-external">
|
||||
{{ .Title }}
|
||||
<i class="fa fa-external-link-alt"></i>
|
||||
</a>
|
||||
{{- else }}
|
||||
<a href="{{ .Permalink }}" itemprop="url" class="post-title-link">{{ .Title }}</a>
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
<a href="{{ .Permalink }}" itemprop="url" class="post-title-link">{{ .Title }}</a>
|
||||
{{ .Title }}
|
||||
{{- end }}
|
||||
</h2>
|
||||
{{/* TODO IsHome */}}
|
||||
{{ print "Get IsHome value in pages loop: " ($.Scratch.Get "IsHome") }}
|
||||
<div class="post-meta-container">
|
||||
{{ partial "post/post_meta/created_date.html" . }}
|
||||
{{ partial "post/post_meta/update_date.html" . }}
|
||||
{{ partial "post/post_meta/categories.html" . }}
|
||||
{{- if not (.Scratch.Get "IsHome") }}
|
||||
{{- if not $.IsHome }}
|
||||
{{ partial "post/post_meta/words.html" . }}
|
||||
{{ partial "post/post_meta/readtime.html" . }}
|
||||
{{ partial "post/post_meta/views.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</header>
|
||||
</header>
|
||||
{{ end }}
|
||||
@@ -1,10 +1,13 @@
|
||||
<div class="post-block">
|
||||
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="{{ .Scratch.Get "lang" }}">
|
||||
{{ partial "post/post_header.html" . }}
|
||||
<!-- POST BODY -->
|
||||
{{ partial "post/post_body.html" . }}
|
||||
<footer class="post-footer">
|
||||
{{ partial "post/post_footer.html" . }}
|
||||
</footer>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<div class="post-block">
|
||||
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="{{ .Scratch.Get "lang" }}">
|
||||
|
||||
{{ partial "post/post_header.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
|
||||
<!-- POST BODY -->
|
||||
{{ partial "post/post_body.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
|
||||
<footer class="post-footer">
|
||||
{{ partial "post/post_footer.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
|
||||
</footer>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user