mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
refactor(layouts): simplify alternative output format link rendering
- Use AlternativeOutputFormats to render all links including manifest - Add rel field to manifest output format config - Skip manifest link when PWA is disabled - Remove hardcoded JSON feed link in favor of AlternativeOutputFormats - Comment out unused mediaTypes section
This commit is contained in:
@@ -310,9 +310,10 @@ privacyEnhanced = true
|
||||
# See: https://gohugo.io/configuration/media-types/
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
[mediaTypes]
|
||||
# [mediaTypes]
|
||||
|
||||
# [mediaTypes."application/feed+json"]
|
||||
# suffixes = ["json"]
|
||||
# suffixes = [ "json" ]
|
||||
|
||||
# -------------------------------------------------------------------------------------
|
||||
# Output Format Configuration
|
||||
@@ -380,6 +381,7 @@ permalinkable = true
|
||||
[outputFormats.manifest]
|
||||
baseName = "site"
|
||||
mediaType = "application/manifest+json"
|
||||
rel = "manifest"
|
||||
isPlainText = true
|
||||
isHTML = false
|
||||
|
||||
|
||||
@@ -85,9 +85,6 @@
|
||||
{{- with .Site.Params.app.mask_color -}}
|
||||
<link rel="mask-icon" href="{{ $relURL }}safari-pinned-tab.svg" color="{{ . }}">
|
||||
{{- end -}}
|
||||
{{- with .OutputFormats.Get "manifest" -}}
|
||||
{{- if eq $.Site.Params.app.pwa true -}}<link rel="manifest" href="{{ .RelPermalink }}">{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Canonical and pagination links */ -}}
|
||||
@@ -99,14 +96,12 @@
|
||||
<link rel="next" type="text/html" href="{{ .Permalink }}" title="{{ .Title }}" />
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Alternative output formats (Atom, RSS, etc.) */ -}}
|
||||
{{- /* Alternative output formats (Atom, RSS, manifest etc.) */ -}}
|
||||
{{- range .AlternativeOutputFormats -}}
|
||||
{{- printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink $title | safeHTML -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* JSON Feed support */ -}}
|
||||
{{- with .OutputFormats.Get "jsonfeed" -}}
|
||||
<link rel="alternate" type="application/feed+json" href="{{ .Permalink }}" title="{{ $title }}" />
|
||||
{{- if (eq .Name "manifest") | and (not $.Site.Params.app.pwa) -}}
|
||||
{{- continue -}}
|
||||
{{- end -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
||||
{{- end -}}
|
||||
|
||||
{{- /* CSS: base + page-specific */ -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mqorjc8q" -}}
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mqt0ysyp" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user