mirror of https://github.com/jkjoy/hugoblog.git
44 lines
3.3 KiB
HTML
44 lines
3.3 KiB
HTML
|
<article class="post--item" itemtype="http://schema.org/Article" itemscope="itemscope">
|
||
|
<div class="content">
|
||
|
<h2 class="post--title" itemprop="headline">
|
||
|
<a href="{{ .Permalink }}">
|
||
|
{{ .Title }}
|
||
|
{{ if .Params.weight }}
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||
|
class="icon--sticky" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||
|
stroke-linejoin="round" class="w-4 h-4 text-red-400">
|
||
|
<path
|
||
|
d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z">
|
||
|
</path>
|
||
|
</svg>
|
||
|
{{ end }}
|
||
|
</a>
|
||
|
</h2>
|
||
|
<div class="description" itemprop="about">{{ .Summary | truncate 60 }}</div>
|
||
|
<div class="meta">
|
||
|
<svg class="icon" viewBox="0 0 1024 1024" width="16" height="16">
|
||
|
<path
|
||
|
d="M512 97.52381c228.912762 0 414.47619 185.563429 414.47619 414.47619s-185.563429 414.47619-414.47619 414.47619S97.52381 740.912762 97.52381 512 283.087238 97.52381 512 97.52381z m0 73.142857C323.486476 170.666667 170.666667 323.486476 170.666667 512s152.81981 341.333333 341.333333 341.333333 341.333333-152.81981 341.333333-341.333333S700.513524 170.666667 512 170.666667z m36.571429 89.697523v229.86362h160.865523v73.142857H512a36.571429 36.571429 0 0 1-36.571429-36.571429V260.388571h73.142858z">
|
||
|
</path>
|
||
|
</svg><time datetime='{{.Date.Format "2006-01-02 15:04:01" }}' class="humane--time"
|
||
|
itemprop="datePublished">{{ .Date |
|
||
|
time.Format ":date_long"
|
||
|
}}</time>
|
||
|
{{ if .Params.categories }}
|
||
|
<svg class="icon" viewBox="0 0 1024 1024" width="16" height="16">
|
||
|
<path
|
||
|
d="M408.551619 97.52381a73.142857 73.142857 0 0 1 51.736381 21.430857L539.306667 197.973333A73.142857 73.142857 0 0 0 591.067429 219.428571H804.571429a73.142857 73.142857 0 0 1 73.142857 73.142858v560.761904a73.142857 73.142857 0 0 1-73.142857 73.142857H219.428571a73.142857 73.142857 0 0 1-73.142857-73.142857V170.666667a73.142857 73.142857 0 0 1 73.142857-73.142857h189.123048z m0 73.142857H219.428571v682.666666h585.142858V292.571429h-213.504a146.285714 146.285714 0 0 1-98.499048-38.13181L487.619048 249.734095 408.551619 170.666667zM365.714286 633.904762v73.142857h-73.142857v-73.142857h73.142857z m365.714285 0v73.142857H414.47619v-73.142857h316.952381z m-365.714285-195.047619v73.142857h-73.142857v-73.142857h73.142857z m365.714285 0v73.142857H414.47619v-73.142857h316.952381z">
|
||
|
</path>
|
||
|
</svg>
|
||
|
{{ range (.GetTerms "categories") }}
|
||
|
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
</div>
|
||
|
</div>
|
||
|
{{ if .Content }}
|
||
|
{{ $urls := findRE "<img src=\"[^\"|\\\"]*\"" .Content }} {{ if $urls }} {{ $url :=index ($urls) 0 }} {{ $url
|
||
|
:=(strings.TrimPrefix "<img src=\"" $url) }}
|
||
|
{{ $url := strings.TrimRight " \"" $url }} <img src="{{ $url }}" class="cover" itemprop="image" /> {{ end }} {{
|
||
|
end }}
|
||
|
</article>
|