Improve links for sitemap and taxonomies (#569)
* layouts: use absURL to construct absolute URLs instead of concatenating with .Site.BaseURL * layouts: let hugo generate URLs to taxonomy terms * layouts: link to current language's home page in the site footer
This commit is contained in:
parent
b3b4386d01
commit
5a8b531a7c
|
@ -7,13 +7,13 @@
|
||||||
</article>
|
</article>
|
||||||
<div class="mw8 center">
|
<div class="mw8 center">
|
||||||
<section class="ph4">
|
<section class="ph4">
|
||||||
{{ range $key, $value := .Data.Terms }}
|
{{ range $term := .Data.Pages }}
|
||||||
<h2 class="f1">
|
<h2 class="f1">
|
||||||
<a href="{{ "/" | relLangURL }}{{ $.Data.Plural | urlize }}/{{ $key | urlize }}" class="link blue hover-black">
|
<a href="{{ $term.RelPermalink }}" class="link blue hover-black">
|
||||||
{{ $.Data.Singular | humanize }}: {{ $key }}
|
{{ $.Data.Singular | humanize }}: {{ $term.LinkTitle }}
|
||||||
</a>
|
</a>
|
||||||
</h2>
|
</h2>
|
||||||
{{ range $value.Pages }}
|
{{ range $term.Pages }}
|
||||||
{{ .Render "summary" }}
|
{{ .Render "summary" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<footer class="{{ .Site.Params.background_color_class | default "bg-black" }} bottom-0 w-100 pa3" role="contentinfo">
|
<footer class="{{ .Site.Params.background_color_class | default "bg-black" }} bottom-0 w-100 pa3" role="contentinfo">
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="{{ .Site.BaseURL }}" >
|
<a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="{{ .Site.Home.Permalink }}" >
|
||||||
© {{ with .Site.Copyright | default .Site.Title }} {{ . | safeHTML }} {{ now.Format "2006"}} {{ end }}
|
© {{ with .Site.Copyright | default .Site.Title }} {{ . | safeHTML }} {{ now.Format "2006"}} {{ end }}
|
||||||
</a>
|
</a>
|
||||||
<div>{{ partial "social-follow.html" . }}</div>
|
<div>{{ partial "social-follow.html" . }}</div>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<ul class="pa0">
|
<ul class="pa0">
|
||||||
{{ range .Params.tags }}
|
{{ range .GetTerms "tags" }}
|
||||||
<li class="list di">
|
<li class="list di">
|
||||||
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">
|
<a href="{{ .RelPermalink }}" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">
|
||||||
{{- . -}}
|
{{- .LinkTitle -}}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
User-agent: *
|
User-agent: *
|
||||||
# robotstxt.org - if ENV production variable is false robots will be disallowed.
|
{{/* robotstxt.org - if ENV production variable is false robots will be disallowed. */ -}}
|
||||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") -}}
|
||||||
Allow: /
|
Allow: /
|
||||||
Sitemap: {{.Site.BaseURL}}/sitemap.xml
|
Sitemap: {{ "/sitemap.xml" | absURL }}
|
||||||
{{ else }}
|
{{ else -}}
|
||||||
Disallow: /
|
Disallow: /
|
||||||
{{ end }}
|
{{ end -}}
|
||||||
|
|
Loading…
Reference in a new issue