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

View file

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

View file

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

View file

@ -1,13 +1,13 @@
{{ define "meta" }}
{{ partial "single_meta.html" . }}
{{ partial "single_meta.html" . -}}
{{ end }}
{{ define "main" }}
{{ define "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">
{{ .Content }}
</article>
</main>
{{ partial "menu.html" . }}
{{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . }}{{ end }}
{{ partial "menu.html" . -}}
{{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . -}}{{ end }}
{{ end }}

View file

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

View file

@ -6,5 +6,8 @@
<link rel="canonical" href="{{ .Permalink }}">
<link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon">
<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 }}
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end }}
{{ range .AlternativeOutputFormats -}}
<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">
{{ if .Paginator.HasPrev }}
{{ if .Paginator.HasPrev -}}
<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>
{{ end }}
{{ end -}}
</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 }}
{{ $currentID := .UniqueID }}
<aside class="layout-3col__right-sidebar" role="complementary">
{{ range $section, $taxonomy := .Site.Sections }}
{{ if ne $section "" }}
{{ range $section, $taxonomy := .Site.Sections -}}
{{ if ne $section "" -}}
<h4 class="menu"><a class="{{ if eq $currentSection $section }}active{{ end }}" href="/{{ urlize $section }}">{{ humanize $section }}</a></h4>
<ul class="menu">
{{ range $taxonomy.Pages }}
{{ range $taxonomy.Pages -}}
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
{{ end -}}
</ul>
{{ end }}
{{ end }}
{{ end -}}
{{ end -}}
</aside>

View file

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