Add meta data for SEO. Add favicon. Allow removing bottom URL. Fix newlines at end of HTML files causing whitespace.
This commit is contained in:
@@ -1 +1 @@
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if or (strings.HasPrefix .Destination "http") (strings.HasPrefix .Destination "https") }} target="_blank"{{ end }}>{{ .Text | safeHTML }}</a>
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if or (strings.HasPrefix .Destination "http") (strings.HasPrefix .Destination "https") }} target="_blank"{{ end }}>{{ .Text | safeHTML }}</a>
|
46
layouts/_default/baseof.html
Normal file
46
layouts/_default/baseof.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.Language }}">
|
||||
<head>
|
||||
<title>{{ if not .IsHome }}{{ .Title | title }} | {{ end }}{{ .Site.Title }}</title>
|
||||
<link rel="canonical" href="{{ .Site.BaseURL }}">
|
||||
<link rel='alternate' type='application/rss+xml' title="{{ .Site.Title }} RSS" href='/index.xml'>
|
||||
<link rel='stylesheet' type='text/css' href='/style.css'>{{
|
||||
$favicon := .Param "favicon" }}{{
|
||||
$faviconSizes := .Param "faviconSizes" }}{{
|
||||
range $i := $faviconSizes }}{{
|
||||
$resource := resources.GetMatch ($favicon) }}{{
|
||||
$image := $resource.Resize (printf "%dx%d CatmullRom" $i $i) }}
|
||||
<link rel="icon" type="image/png" sizes="{{ $i }}x{{ $i }}" href="{{ $image.Permalink }}">{{
|
||||
end }}
|
||||
<meta name="description" content="{{ with .Param "description" }}{{ . }}{{ else }}{{ .Summary }}{{ end }}">
|
||||
<meta name="keywords" content="{{
|
||||
$tags := .Param "tags" }}{{
|
||||
$categories := .Param "categories" }}{{
|
||||
$combined := union $categories $tags }}{{
|
||||
delimit $combined ", "
|
||||
}}">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="index, follow">
|
||||
<meta charset="utf-8">
|
||||
{{ partial "meta.html" . }}
|
||||
</head>
|
||||
<body>
|
||||
{{ if .Site.Menus.main }}{{ partial "nav.html" . }}{{ end -}}
|
||||
<main>
|
||||
<header><h1 id="tag_{{ .Title }}">{{ block "title" . }}{{ end }}</h1></header>
|
||||
<article>
|
||||
{{ block "main" . }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{ if .Param "nextprev" }}{{ partial "nextprev.html" . -}}{{ end -}}
|
||||
{{ if .Param "taglist" }}{{ partial "taglist.html" . }}{{ end -}}
|
||||
</article>
|
||||
</main>
|
||||
{{ block "footer" . }}
|
||||
<footer>
|
||||
{{- if .Param "showurl" }}<a href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a>{{ end }}
|
||||
{{- if .Param "showrss" }}<br><br><a href="/index.xml"><img src="/rss.svg" style="max-height:1.5em" alt="RSS Feed" title="Subscribe via RSS for updates."></a>{{ end }}
|
||||
</footer>
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
@@ -1,3 +0,0 @@
|
||||
<meta property="og:site_name" content="{{ .Site.Params.sitename }}" />
|
||||
|
||||
<meta name="description" content="{{ if .Params.description }}{{ .Params.description }}{{ else if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}" />
|
7
layouts/partials/meta.html
Normal file
7
layouts/partials/meta.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<meta property="og:title" content="{{ .Site.Title }}"/>
|
||||
<meta property="og:description" content="{{ .Site.Params.Description }}"/>
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}"/>
|
||||
<meta property="og:url" content="{{ .Site.BaseURL }}/"/>
|
||||
<meta property="og:type" content="{{ .Site.Params.Type }}"/>
|
||||
<meta property="og:image" content="https://hyperling.com/files/media/icons/favicon.ico"/>
|
||||
<meta name="referrer" content="same-origin"/>
|
Reference in New Issue
Block a user