Simplified setting the title tag, added author and date to posts, TODO make optional. Ordering of meta tags. Fixes for alternate outputs like RSS.

This commit is contained in:
Fredrik Jonsson 2017-05-17 22:44:15 +02:00
commit 90cb79d78a
7 changed files with 14 additions and 12 deletions

View file

@ -2,9 +2,9 @@
<html lang="{{ .Site.Language.Lang }}">
<head>
<meta charset="utf-8">
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
<title>{{ block "title" . }}{{ .Title }} – {{ .Site.Title }}{{ end }}</title>
{{ 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 }}">

View file

@ -1,6 +1,10 @@
<article class="{{ with .Section }}section-{{ . | urlize }}{{ end }} full-view">
<header>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a><h2>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
<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 }}

View file

@ -1,5 +1,3 @@
{{ define "title" }}{{ if not .IsHome }}{{ .Title }} - {{ .Site.Title }}{{ end }}{{ end }}
{{ define "meta" }}
{{ partial "section_meta.html" . -}}
{{ end }}

View file

@ -1,5 +1,3 @@
{{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }}
{{ define "meta" }}
{{ partial "single_meta.html" . -}}
{{ end }}

View file

@ -1,6 +1,10 @@
<article class="{{ with .Section }}section-{{ . | urlize }}{{ end }} list-view">
<header>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a><h2>
<p class="submitted">
{{ with $.Param "author" }}<span class="author">{{ . }}</span> – {{ end -}}
<span class="created-date">{{ .Date.Format "2 January, 2006" }}</span>
</p>
</header>
<div>
{{ .Summary }}

View file

@ -1,3 +1,5 @@
{{ define "title" }}{{ .Site.Title }}{{ end }}
{{ define "meta" }}
{{ partial "single_meta.html" . -}}
{{ end }}

View file

@ -2,12 +2,8 @@
<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
{{ .Hugo.Generator }}
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end }}
<link rel="stylesheet" href="/css/styles.css{{ if $.Param "cacheBustCSS" }}?{{ readFile "/public/css/styles.css" | sha1 }}{{ end }}">
<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">
{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" title="{{ .Name }}" href="{{ .Permalink | safeURL }}">
{{ end -}}
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end -}}