mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 07:18:57 +00:00
3ffef8acb0
* 🔍 Refactor: add JSON feed support and refactor output formats build in FixIt Close #475 * 🚚 Feat: migrate index templates to layouts/_default folder and home.[name].html * 📝 Style(ignore): fix typo * 🚚 Chore: migrate index templates to default home templates * 🚚 Chore: migrate section templates to layouts/section folder * ✨ Feat: add JSON feed support for section pages (#475) * 🚧 Feat: add common template for JSON feed (#475) * 🚧 Feat: add JSON feed support for section and term list pages * 🚀 Chore: fix git stage error in update-version script * ⚡ Perf: add front matter hiddenFromFeed for JSON feed (#475) * 🔍 Feat: add tags attribute for JSON feed (#475) * ♻️ Refactor: refactor RSS feed templates Close #488 * 🚧 WIP: rename json-feed.html to json.html * 🚧 Feat: revert single.md * ⚡ Perf: enhance JSON feed 1.1 compatibility * ♻️ Refactor: refactor post author map getting * ✨ WIP: add featured image support in feed * 📝 Docs: update README and screenshot * 🔧 Chore: update changelog template * 🚧 WIP: add feed scoped config for section and list * 🔥 Feat: migrate JSON feed to hugo-fixit/hugo-json-feed Close hugo-fixit/hugo-json-feed#1 * 🚚 Feat: remove front matter hiddenFromRss and rssFullText, add front matter hiddenFromFeed
79 lines
3.0 KiB
HTML
79 lines
3.0 KiB
HTML
{{- $params := .Params | merge .Site.Params.page -}}
|
|
|
|
<article class="single summary" itemscope itemtype="http://schema.org/Article">
|
|
{{- /* Featured image */ -}}
|
|
{{- $image := $params.featuredimagepreview | default $params.featuredimage -}}
|
|
{{- with $image }}
|
|
{{- if not (hasPrefix . "/") }}
|
|
{{- $image = (printf "%s%s" $.RelPermalink .) | safeURL }}
|
|
{{- end }}
|
|
{{- $image = $image | relURL }}
|
|
{{- end }}
|
|
{{- with .Resources.GetMatch "featured-image" -}}
|
|
{{- $image = .RelPermalink -}}
|
|
{{- end -}}
|
|
{{- with .Resources.GetMatch "featured-image-preview" -}}
|
|
{{- $image = .RelPermalink -}}
|
|
{{- end -}}
|
|
{{- with $image -}}
|
|
<div class="featured-image-preview">
|
|
<a href="{{ $.RelPermalink }}" aria-label="{{ $.Title }}">
|
|
{{- dict "Src" . "Title" $.Description "Alt" $.Title "Resources" $.Resources "Width" "50%" "Height" "50%" | partial "plugin/image.html" -}}
|
|
</a>
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- /* Title */ -}}
|
|
<h2 class="single-title" itemprop="name headline">
|
|
{{- with $params.weight -}}
|
|
{{- $icon := dict "Class" "fa-solid fa-thumbtack fa-fw" -}}
|
|
<span title="{{ T "single.pin" }}" class="icon-pin">{{- $icon | partial "plugin/icon.html" -}}</span>
|
|
{{- end -}}
|
|
{{- $repost := $params.repost | default dict -}}
|
|
{{- with $repost -}}
|
|
{{- if eq .Enable true -}}
|
|
{{- $icon := dict "Class" "fa-solid fa-share fa-fw" -}}
|
|
{{- $title := cond (hasPrefix .Url "http") (printf "%v -> %v" (T "single.repost") .Url ) (T "single.repost") -}}
|
|
<span title="{{ $title }}" class="icon-repost">{{- $icon | partial "plugin/icon.html" -}}</span>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
<a href="{{ .RelPermalink }}">{{ title .Title }}</a>
|
|
</h2>
|
|
|
|
{{- /* Meta */ -}}
|
|
<div class="post-meta">
|
|
{{- partial "single/post-author.html" . -}}
|
|
|
|
{{- with .PublishDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}}
|
|
<span class="post-publish" title='{{ "2006-01-02 15:04:05" | $.PublishDate.Format }}'>
|
|
{{- printf `<time datetime="%v">%v</time>` . . | dict "Date" | T "single.publishedOnDate" | safeHTML -}}
|
|
</span>
|
|
{{- end -}}
|
|
|
|
{{- partial "single/post-included-in.html" . -}}
|
|
</div>
|
|
|
|
{{- /* Summary content */ -}}
|
|
<div class="content">
|
|
{{- with .Summary -}}
|
|
{{- dict "Content" . "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
|
{{- else -}}
|
|
{{- .Description | safeHTML -}}
|
|
{{- end -}}
|
|
</div>
|
|
|
|
{{- /* Footer */ -}}
|
|
<div class="post-footer">
|
|
<a href="{{ .RelPermalink }}">{{ T "single.readMore" }}</a>
|
|
{{- $tagTerms := .GetTerms "tags" -}}
|
|
{{- if $tagTerms -}}
|
|
<div class="post-tags">
|
|
{{- dict "Class" "fa-solid fa-tags fa-fw me-1" | partial "plugin/icon.html" -}}
|
|
{{- range $tagTerms -}}
|
|
<a href='{{ partial "function/escapeurl.html" .RelPermalink }}' class="post-tag">{{ .LinkTitle }}</a>
|
|
{{- end -}}
|
|
</div>
|
|
{{- end -}}
|
|
</div>
|
|
</article>
|