fix: PermaLink to RelPermalink
This commit is contained in:
parent
f774d2689d
commit
9f33764cff
@ -9,7 +9,7 @@
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<link>{{ .RelPermalink }}</link>
|
||||
<description>{{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
||||
@ -18,15 +18,15 @@
|
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .RelPermalink .MediaType | safeHTML }}
|
||||
{{ end }}
|
||||
{{ range $pages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<link>{{ .RelPermalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<guid>{{ .RelPermalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
</item>
|
||||
{{ end }}
|
||||
|
@ -2,21 +2,21 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
{{ range where .Data.Pages "Params.hidden" "!=" true }}
|
||||
{{- if .Permalink -}}
|
||||
{{- if .RelPermalink -}}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||
<loc>{{ .RelPermalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Language.LanguageCode }}"
|
||||
href="{{ .Permalink }}"
|
||||
href="{{ .RelPermalink }}"
|
||||
/>{{ end }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Language.LanguageCode }}"
|
||||
href="{{ .Permalink }}"
|
||||
href="{{ .RelPermalink }}"
|
||||
/>{{ end }}
|
||||
</url>
|
||||
{{- end -}}
|
||||
|
@ -16,7 +16,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
{{ partial "favicons.html" . }}
|
||||
@ -56,8 +56,6 @@
|
||||
|
||||
|
||||
{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
|
||||
|
||||
|
||||
{{ range site.Params.customCSS }}
|
||||
{{ with resources.Get . | toCSS $opts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
|
@ -9,7 +9,7 @@
|
||||
{{ if eq .Lang $pageLang }}
|
||||
<li>{{ .Language.LanguageName }}</li>
|
||||
{{ else }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
@ -18,7 +18,7 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<a class="post-hidden-url u-url" href="{{ .Permalink }}">{{ .Permalink }}</a>
|
||||
<a class="post-hidden-url u-url" href="{{ .RelPermalink }}">{{ .RelPermalink }}</a>
|
||||
<a href="{{ .Site.BaseURL }}" class="p-name p-author post-hidden-author h-card" rel="me">{{ .Params.author | default .Site.Params.author }}</a>
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<ul class="post-categories">
|
||||
{{ range $cat_name := .Params.categories }}
|
||||
{{ $cat := ($.Site.GetPage (printf "/categories/%s" $cat_name | urlize )) }}
|
||||
<li><a href="{{ $cat.Permalink }}">{{ $cat.Title | default $cat_name }}</a></li>
|
||||
<li><a href="{{ $cat.RelPermalink }}">{{ $cat.Title | default $cat_name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
@ -35,7 +35,7 @@
|
||||
<ul class="post-tags">
|
||||
{{ range $tag_name := .Params.tags }}
|
||||
{{ $tag := ($.Site.GetPage (printf "/tags/%s" $tag_name | urlize )) }}
|
||||
<li><a href="{{ $tag.Permalink }}">#{{ $tag.Title | default $tag_name }}</a></li>
|
||||
<li><a href="{{ $tag.RelPermalink }}">#{{ $tag.Title | default $tag_name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
@ -43,7 +43,7 @@
|
||||
<ul class="post-authors">
|
||||
{{ range $author_name := .Params.authors }}
|
||||
{{ $author := ($.Site.GetPage (printf "/authors/%s" $author_name | urlize )) }}
|
||||
<li><a href="{{ $author.Permalink }}">@{{ $author_name }}</a></li>
|
||||
<li><a href="{{ $author.RelPermalink }}">@{{ $author_name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
@ -15,9 +15,9 @@
|
||||
{{ $resource = $resource | resources.Fingerprint "sha256" }}
|
||||
|
||||
{{ if eq .type "css" }}
|
||||
<link rel="stylesheet" href="{{ $resource.Permalink }}" integrity="{{ $resource.Data.Integrity }}">
|
||||
<link rel="stylesheet" href="{{ $resource.RelPermalink }}" integrity="{{ $resource.Data.Integrity }}">
|
||||
{{ else if eq .type "js" }}
|
||||
<script src="{{ $resource.Permalink }}" type="text/javascript" charset="utf-8" integrity="{{ $resource.Data.Integrity }}"></script>
|
||||
<script src="{{ $resource.RelPermalink }}" type="text/javascript" charset="utf-8" integrity="{{ $resource.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
<!-- For backward compatibility -->
|
||||
{{ else }}
|
||||
|
@ -27,7 +27,7 @@
|
||||
{{ if .Site.Params.rssAsSocialIcon }}
|
||||
{{ with .Site.Home.OutputFormats.Get "rss" -}}
|
||||
<li>
|
||||
<a {{ printf "href=%q" .Permalink | safeHTMLAttr }} title="RSS" rel="me">
|
||||
<a {{ printf "href=%q" .RelPermalink | safeHTMLAttr }} title="RSS" rel="me">
|
||||
{{ partial "font-awesome.html" (dict "iconName" "rss" "custom" false) }}
|
||||
</a>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user