Whitespace and meta tags.

This commit is contained in:
Fredrik Jonsson 2017-05-17 00:33:54 +02:00
commit cf5d447b87
10 changed files with 54 additions and 50 deletions

View file

@ -3,14 +3,14 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title> <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{ partialCached "meta.html" . }} {{ partialCached "meta.html" . -}}
{{ block "meta" . }}{{ end }} {{ block "meta" . }}{{ end -}}
</head> </head>
<body class="{{ if $.Param "sidebar" | default true }}one-sidebar sidebar-second{{ else }}no-sidebars{{ end }}"> <body class="{{ if $.Param "sidebar" | default true }}one-sidebar sidebar-second{{ else }}no-sidebars{{ end }}">
<div class="layout-center"> <div class="layout-center">
<header class="header" role="banner"> <header class="header" role="banner">
{{ if $.Param "logo" | default true }}<a href="{{ .Site.BaseURL }}" title="Home" rel="home" class="header__logo"><img src="/images/logo.png" alt="Home" class="header__logo-image" /></a>{{ end }} {{ if $.Param "logo" | default true }}<a href="{{ .Site.BaseURL }}" title="Home" rel="home" class="header__logo"><img src="/images/logo.png" alt="Home" class="header__logo-image" /></a>{{ end -}}
<h1 class="header__site-name"> <h1 class="header__site-name">
<a href="{{ .Site.BaseURL }}" title="Home" class="header__site-link" rel="home"><span>{{ .Site.Title }}</span></a> <a href="{{ .Site.BaseURL }}" title="Home" class="header__site-link" rel="home"><span>{{ .Site.Title }}</span></a>
</h1> </h1>
@ -18,13 +18,13 @@
</header> </header>
<div class="layout-3col layout-swap"> <div class="layout-3col layout-swap">
{{ block "main" . }}{{ end }} {{ block "main" . }}{{ end -}}
</div> </div>
<footer class="footer" role="contentinfo"> <footer class="footer" role="contentinfo">
<p>{{ with $.Param "copyright" }}{{ . | markdownify }}{{ else }}<span>&copy; {{ .Site.Title }}</span>{{ end }}</p> <p>{{ with $.Param "copyright" }}{{ . | markdownify }}{{ else }}<span>&copy; {{ .Site.Title }}</span>{{ end }}</p>
{{ with $.Param "footer" }}<p>{{ . | markdownify }}</p>{{ end }} {{ with $.Param "footer" }}<p>{{ . | markdownify }}</p>{{ end -}}
{{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a></p>{{ end }} {{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a></p>{{ end -}}
</footer> </footer>
</div> </div>
{{ partialCached "scripts.html" . }} {{ partialCached "scripts.html" . }}

View file

@ -1,19 +1,19 @@
{{ define "title" }}{{ if not .IsHome }}{{ .Title }} - {{ .Site.Title }}{{ end }}{{ end }} {{ define "title" }}{{ if not .IsHome }}{{ .Title }} - {{ .Site.Title }}{{ end }}{{ end }}
{{ define "meta" }} {{ define "meta" }}
{{ partial "section_meta.html" . }} {{ partial "section_meta.html" . -}}
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" -}}
<main class="{{ if $.Param "sidebar" | default true }}layout-3col__left-content{{ else }}layout-3col__full{{ end }}" role="main"> <main class="{{ if $.Param "sidebar" | default true }}layout-3col__left-content{{ else }}layout-3col__full{{ end }}" role="main">
{{ $paginator := .Paginate (.Data.Pages) }} {{ $paginator := .Paginate (.Data.Pages) -}}
{{ range $paginator.Pages }} {{ range $paginator.Pages -}}
{{ .Render "summary"}} {{ .Render "summary"}}
{{ end }} {{ end -}}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
</main> </main>
{{ partial "menu.html" . }} {{ partial "menu.html" . -}}
{{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . }}{{ end }} {{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . -}}{{ end }}
{{ end }} {{ end }}

View file

@ -1,14 +1,18 @@
{{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }} {{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }}
{{ define "meta" }} {{ define "meta" }}
{{ partial "single_meta.html" . }} {{ partial "single_meta.html" . -}}
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" -}}
<main class="{{ if $.Param "sidebar" | default true }}layout-3col__left-content{{ else }}layout-3col__full{{ end }}" role="main"> <main class="{{ if $.Param "sidebar" | default true }}layout-3col__left-content{{ else }}layout-3col__full{{ end }}" role="main">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
<article class="{{ with .Section }}section-{{ . | urlize }}{{ end }} single-view"> <article class="{{ with .Section }}section-{{ . | urlize }}{{ end }} single-view">
<header> <header>
<p class="submitted">
{{ with $.Param "author" }}<span class="author">{{ . }}</span> – {{ end -}}
<span class="created-date">{{ .Date.Format "2 January, 2006" }}</span>
</p>
</header> </header>
<div> <div>
{{ .Content }} {{ .Content }}
@ -16,6 +20,6 @@
</article> </article>
</main> </main>
{{ partial "menu.html" . }} {{ partial "menu.html" . -}}
{{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . }}{{ end }} {{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . -}}{{ end }}
{{ end }} {{ end }}

View file

@ -1,13 +1,13 @@
{{ define "meta" }} {{ define "meta" }}
{{ partial "single_meta.html" . }} {{ partial "single_meta.html" . -}}
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" -}}
<main class="{{ if $.Param "sidebar" | default true }}layout-3col__left-content{{ else }}layout-3col__full{{ end }}" role="main"> <main class="{{ if $.Param "sidebar" | default true }}layout-3col__left-content{{ else }}layout-3col__full{{ end }}" role="main">
<article class="{{ with .Section }}section-{{ . | urlize }}{{ end }} single-view"> <article class="{{ with .Section }}section-{{ . | urlize }}{{ end }} single-view">
{{ .Content }} {{ .Content }}
</article> </article>
</main> </main>
{{ partial "menu.html" . }} {{ partial "menu.html" . -}}
{{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . }}{{ end }} {{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . -}}{{ end }}
{{ end }} {{ end }}

View file

@ -5,15 +5,15 @@
<h2 class="visually-hidden">Main menu</h2> <h2 class="visually-hidden">Main menu</h2>
<ul class="navbar clearfix"> <ul class="navbar clearfix">
<li><a class="{{ if .IsHome }}active{{ end }}" href="/">Home</a></li> <li><a class="{{ if .IsHome }}active{{ end }}" href="/">Home</a></li>
{{ range $section, $taxonomy := .Site.Sections }} {{ range $section, $taxonomy := .Site.Sections -}}
{{ if eq $section "" }} {{ if eq $section "" -}}
{{ range $taxonomy.Pages }} {{ range $taxonomy.Pages -}}
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li> <li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end }} {{ end -}}
{{ else }} {{ else -}}
<li><a class="{{ if eq $currentSection $section }}active{{ end }}" href="/{{ urlize $section }}">{{ humanize $section }}</a></li> <li><a class="{{ if eq $currentSection $section }}active{{ end }}" href="/{{ urlize $section }}">{{ humanize $section }}</a></li>
{{ end }} {{ end -}}
{{ end }} {{ end -}}
</ul> </ul>
</nav> </nav>
</div> </div>

View file

@ -6,5 +6,8 @@
<link rel="canonical" href="{{ .Permalink }}"> <link rel="canonical" href="{{ .Permalink }}">
<link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon"> <link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon">
<link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="apple-touch-icon" href="/apple-touch-icon.png">
{{ if and (.Site.RSSLink) (not ($.Param "supressRSSLink")) }}<link rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" href="{{ .Site.RSSLink }}">{{ end }} {{ range .AlternativeOutputFormats -}}
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end }} <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" title="{{ .Name }}" href="{{ .Permalink | safeURL }}">
{{ end -}}
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end -}}

View file

@ -1,11 +1,11 @@
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) -}}
<nav class="pager"> <nav class="pager">
{{ if .Paginator.HasPrev }} {{ if .Paginator.HasPrev -}}
<a href="{{ .Paginator.Prev.URL }}" rel="prev" class="pager-item pager-prev">Prev</a> <a href="{{ .Paginator.Prev.URL }}" rel="prev" class="pager-item pager-prev">Prev</a>
{{ end }} {{ end -}}
{{ if .Paginator.HasNext }} {{ if .Paginator.HasNext -}}
<a href="{{ .Paginator.Next.URL }}" rel="next" class="pager-item pager-next">Next</a> <a href="{{ .Paginator.Next.URL }}" rel="next" class="pager-item pager-next">Next</a>
{{ end }} {{ end -}}
</nav> </nav>
{{ end }} {{ end -}}

View file

@ -1 +1,3 @@
{{ if and (.RSSLink) (not ($.Param "supressRSSLink")) }}<link rel="alternate" type="application/rss+xml" title="{{ .Title }} - {{ .Site.Title }}" href="{{ .RSSLink }}">{{ end }} {{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" title="{{ .Name }}" href="{{ .Permalink | safeURL }}">
{{ end -}}

View file

@ -1,14 +1,14 @@
{{ $currentSection := .Section }} {{ $currentSection := .Section }}
{{ $currentID := .UniqueID }} {{ $currentID := .UniqueID }}
<aside class="layout-3col__right-sidebar" role="complementary"> <aside class="layout-3col__right-sidebar" role="complementary">
{{ range $section, $taxonomy := .Site.Sections }} {{ range $section, $taxonomy := .Site.Sections -}}
{{ if ne $section "" }} {{ if ne $section "" -}}
<h4 class="menu"><a class="{{ if eq $currentSection $section }}active{{ end }}" href="/{{ urlize $section }}">{{ humanize $section }}</a></h4> <h4 class="menu"><a class="{{ if eq $currentSection $section }}active{{ end }}" href="/{{ urlize $section }}">{{ humanize $section }}</a></h4>
<ul class="menu"> <ul class="menu">
{{ range $taxonomy.Pages }} {{ range $taxonomy.Pages -}}
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li> <li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end }} {{ end -}}
</ul> </ul>
{{ end }} {{ end -}}
{{ end }} {{ end -}}
</aside> </aside>

View file

@ -1,8 +1,3 @@
<meta name="description" content="{{ replaceRE "\n" "" (.Description | default .Summary) }}"> <meta name="description" content="{{ replaceRE "\n" "" (.Description | default .Summary) }}">
<meta property="og:title" content="{{ .Title }} - {{ .Site.Title }}"> <meta name="created" content="{{ .Date.Format "2006-01-02T15:04:05-0700" }}">
<meta property="og:type" content="article"> {{ with $.Param "author" }}<meta name="author" content="{{ . }}">{{ end -}}
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:description" content="{{ replaceRE "\n" "" (.Description | default .Summary) }}">
<meta property="og:locale" content="{{ .Lang }}">
{{ with $.Param "thumbnail" }}<meta property="og:image" content="{{ .Site.BaseURL }}{{ . }}">{{ end }}