mirror of
https://github.com/alexandrev/xslt-lab.git
synced 2026-09-22 05:33:16 +00:00
SEO: robots.txt with sitemap, related posts links, canonical tags, better CTR snippet
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.subtitle }}{{ end }}">
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
<meta property="og:title" content="{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}">
|
||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.subtitle }}{{ end }}">
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
{{ partial "adsense/head.html" . }}
|
||||
<link rel="stylesheet" href="{{ "css/main.css" | relURL }}">
|
||||
</head>
|
||||
|
||||
@@ -9,5 +9,6 @@
|
||||
{{ .Content }}
|
||||
</div>
|
||||
<p class="muted back-link"><a href="{{ .CurrentSection.RelPermalink }}">← Back to {{ .CurrentSection.Title }}</a></p>
|
||||
{{ partial "related-posts.html" . }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{{- $related := first 4 (where (where .Site.RegularPages "Section" "posts") "Permalink" "ne" .Permalink) -}}
|
||||
{{- if $related -}}
|
||||
<aside class="related-posts">
|
||||
<h3>Related articles</h3>
|
||||
<ul>
|
||||
{{- range $related }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
<p class="related-cta">Try the examples in <a href="https://xsltplayground.com">XSLT Playground</a> — free online XSLT editor and tester.</p>
|
||||
</aside>
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,4 @@
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
||||
Sitemap: {{ .Site.BaseURL }}sitemap.xml
|
||||
Reference in New Issue
Block a user