feat: friend page
This commit is contained in:
43
layouts/page/links.html
Normal file
43
layouts/page/links.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{{ define "body-class" }}article-page keep-sidebar{{ end }}
|
||||
{{ define "main" }}
|
||||
{{ partial "article/article.html" . }}
|
||||
|
||||
<div class="article-list--compact links">
|
||||
{{ $siteResources := resources }}
|
||||
{{ range $i, $link := $.Site.Data.links }}
|
||||
<article>
|
||||
<a href="{{ $link.website }}" target="_blank" rel="noopener">
|
||||
<div class="article-details">
|
||||
<h2 class="article-title">
|
||||
{{- $link.title -}}
|
||||
</h2>
|
||||
<footer class="article-time">
|
||||
{{ with $link.description }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
{{ $link.website }}
|
||||
{{ end }}
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
{{ if $link.image }}
|
||||
{{ $image := $siteResources.Get (delimit (slice "link-img/" $link.image) "") | resources.Fingerprint "md5" }}
|
||||
{{ $imageResized := $image.Resize "120x120" }}
|
||||
<div class="article-image">
|
||||
<img src="{{ $imageResized.RelPermalink }}" width="{{ $imageResized.Width }}" height="{{ $imageResized.Height }}"
|
||||
loading="lazy" data-key="links-{{ $link.website }}" data-hash="{{ $image.Data.Integrity }}">
|
||||
</div>
|
||||
{{ end }}
|
||||
</a>
|
||||
</article>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if or (not (isset .Params "comments")) (eq .Params.comments "true")}}
|
||||
{{ partial "comments/include" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partialCached "footer/footer" . }}
|
||||
|
||||
{{ partialCached "article/components/photoswipe" . }}
|
||||
{{ end }}
|
||||
19
layouts/shortcodes/link.html
Normal file
19
layouts/shortcodes/link.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{$URL := .Get 0}}
|
||||
{{ with .Site.GetPage $URL }}
|
||||
<div class="post-preview">
|
||||
<div class="post-preview--meta" style="width:100%;">
|
||||
<div class="post-preview--middle">
|
||||
<h4 class="post-preview--title">
|
||||
<a target="_blank" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</h4>
|
||||
<time class="post-preview--date">{{ .Date.Format ( default "2006-01-02") }}</time>
|
||||
{{ if .Params.tags }}
|
||||
<small>{{ range .Params.tags }}#{{ . }} {{ end }}</small>
|
||||
{{ end }}
|
||||
<section style="max-height:105px;overflow:hidden;" class="post-preview--excerpt">
|
||||
{{ .Summary | plainify}}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user