Added param submitted to control display of author and date on posts.

This commit is contained in:
Fredrik Jonsson 2017-05-18 14:05:07 +02:00
commit a0e3be452c
6 changed files with 14 additions and 15 deletions

View file

@ -1,12 +1,11 @@
<article class="{{ with .Section }}section-{{ . | urlize }}{{ end }} full-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>
<h2 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . -}}{{ end }}
</header>
<div>
{{ .Content }}
</div>
</article>

View file

@ -7,10 +7,7 @@
<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>
{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . -}}{{ end }}
</header>
<div>
{{ .Content }}

View file

@ -1,10 +1,7 @@
<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>
<h2 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . -}}{{ end }}
</header>
<div>
{{ .Summary }}

View file

@ -1,6 +1,6 @@
{{ $domain := .Site.BaseURL | replaceRE "^https?://(www\\.)?([^/]+)/?" "$2" }}
<form class="search-form" method="get" action="https://duckduckgo.com/">
<input type="search" name="q" class="search-text" placeholder="Search this site…" title="Enter the terms you wish to search for." size="{{ $.Param "searchSize" | default "20" }}" maxlength="128">
<input type="search" name="q" class="search-text" placeholder="Search" title="Enter the terms you wish to search for." size="{{ $.Param "searchSize" | default "20" }}" maxlength="128">
<input type="hidden" name="sites" value="{{ $domain }}">
<input type="submit" value="DuckDuckGo Search" class="hidden">
</form>

View file

@ -3,12 +3,14 @@
<aside class="layout-3col__right-sidebar" role="complementary">
{{ range $section, $taxonomy := .Site.Sections -}}
{{ if ne $section "" -}}
<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 -}}
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end -}}
</ul>
</section>
{{ end -}}
{{ end -}}
</aside>

View file

@ -0,0 +1,4 @@
<p class="submitted">
{{ with $.Param "author" }}<span class="author">{{ . }}</span> – {{ end -}}
<span class="created-date">{{ .Date.Format "2 January, 2006" }}</span>
</p>