cleanup and variablization
This commit is contained in:
		
							
								
								
									
										13
									
								
								config.toml
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								config.toml
									
									
									
									
									
								
							@@ -1,11 +1,8 @@
 | 
				
			|||||||
 | 
					title = "Website Name"
 | 
				
			||||||
baseURL = 'https://example.org'
 | 
					baseURL = 'https://example.org'
 | 
				
			||||||
languageCode = 'en-us'
 | 
					languageCode = 'en-us'
 | 
				
			||||||
title = "Website Name"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# [menu]
 | 
					[params]
 | 
				
			||||||
# [[menu.main]]
 | 
					  #relatedtext = "Related:"
 | 
				
			||||||
#   identifier = 'home'
 | 
					  favicon = "/favicon.ico"
 | 
				
			||||||
#   name = 'Home'
 | 
					  stylesheet = "/style.css"
 | 
				
			||||||
#   pre = "🏡"
 | 
					 | 
				
			||||||
#   url = '/index.html'
 | 
					 | 
				
			||||||
#   weight = -110
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,22 +1,14 @@
 | 
				
			|||||||
{{ partial "header.html" . }}
 | 
					{{ partial "header.html" . }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
<header><h1>{{ .Title }}</h1></header>
 | 
					<header><h1>{{ .Title }}</h1></header>
 | 
				
			||||||
 | 
					 | 
				
			||||||
<article>
 | 
					<article>
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ .Content }}
 | 
					{{ .Content }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
<ul>
 | 
					<ul>
 | 
				
			||||||
{{ range.Pages }}
 | 
					{{ range.Pages }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
<li>
 | 
					<li>
 | 
				
			||||||
    <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006 Jan 02" }}</time> –
 | 
					    <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006 Jan 02" }}</time> –
 | 
				
			||||||
    <a href="{{ .RelPermalink }}">{{ .Title }}</a>
 | 
					    <a href="{{ .RelPermalink }}">{{ .Title }}</a>
 | 
				
			||||||
</li>
 | 
					</li>
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ end }}
 | 
					{{ end }}
 | 
				
			||||||
</ul>
 | 
					</ul>
 | 
				
			||||||
 | 
					 | 
				
			||||||
</article>
 | 
					</article>
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ partial "footer.html" . }}
 | 
					{{ partial "footer.html" . }}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,6 @@
 | 
				
			|||||||
{{ partial "header.html" . }}
 | 
					{{ partial "header.html" . }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
<header><h1>{{ with .Params.icon }}<img src="/pix/{{ . }}" class=titleicon>{{ end }}{{ .Title }}</h1></header>
 | 
					<header><h1>{{ with .Params.icon }}<img src="/pix/{{ . }}" class=titleicon>{{ end }}{{ .Title }}</h1></header>
 | 
				
			||||||
 | 
					 | 
				
			||||||
<article>{{ with .Params.img }}<img src="/pix/{{ . }}" class=titleimg>{{ end }}
 | 
					<article>{{ with .Params.img }}<img src="/pix/{{ . }}" class=titleimg>{{ end }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ .Content }}
 | 
					{{ .Content }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
</article>
 | 
					</article>
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ partial "footer.html" . }}
 | 
					{{ partial "footer.html" . }}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,14 +1,9 @@
 | 
				
			|||||||
{{ partial "header.html" . }}
 | 
					{{ partial "header.html" . }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
<header><h1 id="tag_{{ .Title }}">{{ .Title | title }}</h1></header>
 | 
					<header><h1 id="tag_{{ .Title }}">{{ .Title | title }}</h1></header>
 | 
				
			||||||
 | 
					 | 
				
			||||||
<article>
 | 
					<article>
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ .Content }}
 | 
					{{ .Content }}
 | 
				
			||||||
<ul class=tagartlist>
 | 
					<ul class=tagartlist>
 | 
				
			||||||
{{ range.Pages }}<li><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006 Jan 02" }}</time> – <a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
 | 
					{{ range.Pages }}<li><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006 Jan 02" }}</time> – <a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
 | 
				
			||||||
{{ end }}</ul>
 | 
					{{ end }}</ul>
 | 
				
			||||||
 | 
					 | 
				
			||||||
</article>
 | 
					</article>
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ partial "footer.html" . }}
 | 
					{{ partial "footer.html" . }}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,4 @@
 | 
				
			|||||||
{{ partial "header.html" . }}
 | 
					{{ partial "header.html" . -}}
 | 
				
			||||||
 | 
					 | 
				
			||||||
<header><h1>{{ if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}</h1></header>
 | 
					<header><h1>{{ if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}</h1></header>
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ .Content }}
 | 
					{{ .Content }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ partial "footer.html" . }}
 | 
					{{ partial "footer.html" . }}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,17 +1,20 @@
 | 
				
			|||||||
        {{ if isset .Params "tags" }}
 | 
					        {{- if isset .Params "tags" -}}
 | 
				
			||||||
            {{ $tagsLen := len .Params.tags }}
 | 
					            {{- $tagsLen := len .Params.tags -}}
 | 
				
			||||||
            {{ if gt $tagsLen 0 }}
 | 
					            {{- if gt $tagsLen 0 -}}
 | 
				
			||||||
        <div class=taglist>
 | 
					        <div class=taglist>
 | 
				
			||||||
            See related:<br>
 | 
							{{ with .Site.Params.relatedtext }}{{ . }}<br>{{ end }}
 | 
				
			||||||
                {{ range $k, $v := .Params.tags }}
 | 
					                {{- range $k, $v := .Params.tags -}}
 | 
				
			||||||
                {{ $url := printf "tags/%s" (. | urlize | lower) }}
 | 
					                {{- $url := printf "tags/%s" (. | urlize | lower) -}}
 | 
				
			||||||
                <a href="{{ $url | absURL }}">{{ . | title }}</a>
 | 
					                <a id="tag_{{ . }}" href="{{ $url | absURL }}">{{ . | title }}</a>
 | 
				
			||||||
                {{ if lt $k (sub $tagsLen 1) }}·{{ end }}
 | 
					                {{- if lt $k (sub $tagsLen 1) }}·{{ end -}}
 | 
				
			||||||
                {{ end }}
 | 
					                {{- end -}}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            {{ end }}
 | 
					            {{- end -}}
 | 
				
			||||||
        {{ end }}
 | 
					        {{- end -}}
 | 
				
			||||||
    </main>
 | 
					</main>
 | 
				
			||||||
    <footer><a href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a></footer>
 | 
					<footer>
 | 
				
			||||||
 | 
						<a href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a></br>
 | 
				
			||||||
 | 
						<a href="/index.xml"><img src="/pix/rss.svg" style="max-height:.9em;display:inline" alt=""> Subscribe via RSS for Updates.</a></footer>
 | 
				
			||||||
 | 
					</footer>
 | 
				
			||||||
</body>
 | 
					</body>
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,16 +1,19 @@
 | 
				
			|||||||
<!DOCTYPE html>
 | 
					<!DOCTYPE html>
 | 
				
			||||||
<html lang="{{ .Site.Language }}">
 | 
					<html lang="{{ .Site.Language }}">
 | 
				
			||||||
    <head>
 | 
					<head>
 | 
				
			||||||
	<title>{{ if not .IsHome }}{{ .Title | title }} | {{ end }}{{ .Site.Title }}</title>
 | 
						<title>{{ if not .IsHome }}{{ .Title | title }} | {{ end }}{{ .Site.Title }}</title>
 | 
				
			||||||
        <meta charset="utf-8"/>
 | 
					 | 
				
			||||||
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
 | 
					 | 
				
			||||||
        <link rel='stylesheet' type='text/css' href='/style.css'>
 | 
					 | 
				
			||||||
        <meta name="viewport" content="width=device-width, initial-scale=1">
 | 
					 | 
				
			||||||
        <meta name="keywords" content="{{ with .Params.tags }}{{ delimit . ", " }}{{ end }}">
 | 
					 | 
				
			||||||
        <link rel='alternate' type='application/rss+xml' title="{{ .Site.Title }} RSS" href='/rss.xml'>
 | 
					 | 
				
			||||||
	<link rel="canonical" href="{{ .Site.BaseURL }}">
 | 
						<link rel="canonical" href="{{ .Site.BaseURL }}">
 | 
				
			||||||
 | 
						<link rel='alternate' type='application/rss+xml' title="{{ .Site.Title }} RSS" href='/index.xml'>
 | 
				
			||||||
 | 
						{{ with .Site.Params.stylesheet }}<link rel='stylesheet' type='text/css' href='{{ . }}'>
 | 
				
			||||||
 | 
						{{ end -}}
 | 
				
			||||||
 | 
						{{ with .Site.Params.favicon }}<link rel="icon" href="{{ . }}">
 | 
				
			||||||
 | 
						{{ end -}}
 | 
				
			||||||
	<meta name="description" content="{{ with .Params.description }}{{ . }}{{ else }}{{ .Summary }}{{ end }}">
 | 
						<meta name="description" content="{{ with .Params.description }}{{ . }}{{ else }}{{ .Summary }}{{ end }}">
 | 
				
			||||||
    </head>
 | 
						<meta name="keywords" content="{{ with .Params.tags }}{{ delimit . ", " }}{{ end }}">
 | 
				
			||||||
 | 
						<meta name="viewport" content="width=device-width, initial-scale=1">
 | 
				
			||||||
 | 
						<meta name="robots" content="index, follow">
 | 
				
			||||||
 | 
						<meta charset="utf-8">
 | 
				
			||||||
 | 
					</head>
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
    {{ partial "nav.html" . }}
 | 
					{{- partial "nav.html" . -}}
 | 
				
			||||||
    <main>
 | 
					<main>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,10 @@
 | 
				
			|||||||
 | 
					{{- if .Site.Menus.main }}
 | 
				
			||||||
<nav>
 | 
					<nav>
 | 
				
			||||||
    <ul>{{ $sec := .Page.Section }}{{ $file := .File.TranslationBaseName }}
 | 
					    <ul>
 | 
				
			||||||
 | 
						{{- $sec := .Page.Section }}{{ $file := .File.TranslationBaseName -}}
 | 
				
			||||||
        {{ range.Site.Menus.main }}{{ $base := path.Base .URL }}
 | 
					        {{ range.Site.Menus.main }}{{ $base := path.Base .URL }}
 | 
				
			||||||
        <a {{ if or ( eq $sec $base ) ( eq $file $base ) ( and (eq $sec "") ( eq $file "_index") (eq $base "/") ) }}class="menuactive" {{ end }}href="{{ .URL }}"><li><span class=pre>{{ .Pre }}</span><span class=menuname>{{ .Name }}</span></li></a>
 | 
					        <a {{ if or ( eq $sec $base ) ( eq $file $base ) ( and (eq $sec "") ( eq $file "_index") (eq $base "/") ) }}class="menuactive" {{ end }}href="{{ .URL }}"><li><span class=pre>{{ .Pre }}</span><span class=menuname>{{ .Name }}</span></li></a>
 | 
				
			||||||
        {{ end }}
 | 
					        {{- end }}
 | 
				
			||||||
    </ul>
 | 
					    </ul>
 | 
				
			||||||
</nav>
 | 
					</nav>
 | 
				
			||||||
 | 
					{{- end }}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user