Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pjbakker/flexible-seo-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul <paul@brainspark.nl>2019-11-15 22:53:02 +0300
committerPaul <paul@brainspark.nl>2019-11-15 22:53:02 +0300
commit8f077962b88fcc02519c8d60ccbd3d92703ed716 (patch)
tree7c1851c8a3f39df39c988433b12f0a619b121baa
parent2cc6eff3314e4770ff2b6b03635ad65d262aa8ad (diff)
Add simple header, nav and footer, and base structure shortcodes
-rw-r--r--archetypes/page.md11
-rw-r--r--layouts/_default/baseof.html2
-rw-r--r--layouts/_default/single.html10
-rw-r--r--layouts/index.html10
-rw-r--r--layouts/no_structure/single.html7
-rw-r--r--layouts/partials/footers/simple.html2
-rw-r--r--layouts/partials/head.html38
-rw-r--r--layouts/partials/headers/simple.html2
-rw-r--r--layouts/partials/navs/simple.html12
-rw-r--r--layouts/partials/seo/main.html9
-rw-r--r--layouts/partials/seo/schema.html6
-rw-r--r--layouts/partials/social/main.html5
-rw-r--r--layouts/shortcodes/structure/column_end.html2
-rw-r--r--layouts/shortcodes/structure/column_next.html3
-rw-r--r--layouts/shortcodes/structure/column_start.html4
-rw-r--r--layouts/shortcodes/structure/row_end.html2
-rw-r--r--layouts/shortcodes/structure/row_start.html5
-rw-r--r--layouts/shortcodes/toc.html11
18 files changed, 92 insertions, 49 deletions
diff --git a/archetypes/page.md b/archetypes/page.md
new file mode 100644
index 0000000..cdc5f68
--- /dev/null
+++ b/archetypes/page.md
@@ -0,0 +1,11 @@
+---
+title: "{{ replace .Name "-" " " | title }}"
+subtitle: ""
+description: ""
+date: {{ .Date }}
+publishdate: {{ .Date }}
+lastmod: {{ .Date }}
+draft: true
+type: page
+---
+
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index ecc5280..1e0653f 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -4,7 +4,7 @@
{{- partial "head.html" . -}}
</head>
<body>
- {{- partial "nav.html" . -}}
+{{ partial "nav.html" . -}}
{{- block "header" . }}{{- partial "header.html" . -}}{{ end }}
<div id="content">
{{- block "main" . }}{{- end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index de17d92..cd1f46e 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,11 +1,11 @@
{{ define "main" }}
<div class="container" role="main">
- <div class="row">
- <div class="py-5 text-center">
- <article>
+ <article>
+ <div class="row justify-content-md-center">
+ <div class="col-8">
{{ .Content }}
- </article>
+ </div>
</div>
- </div>
+ </article>
</div>
{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index ccb8f7e..9e50639 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,11 +1,7 @@
{{ define "main" }}
<div role="main" class="container">
- <div class="row">
- <div class="py-5 text-center">
- {{ with .Content }}
- {{.}}
- {{ end }}
- </div>
- </div>
+ {{ with .Content }}
+ {{.}}
+ {{ end }}
</div>
{{ end }}
diff --git a/layouts/no_structure/single.html b/layouts/no_structure/single.html
new file mode 100644
index 0000000..6779b07
--- /dev/null
+++ b/layouts/no_structure/single.html
@@ -0,0 +1,7 @@
+{{ define "main" }}
+<div class="container" role="main">
+ <article>
+ {{ .Content }}
+ </article>
+</div>
+{{ end }}
diff --git a/layouts/partials/footers/simple.html b/layouts/partials/footers/simple.html
index ddd92f9..ca215a0 100644
--- a/layouts/partials/footers/simple.html
+++ b/layouts/partials/footers/simple.html
@@ -1,5 +1,5 @@
<footer class="my-5 pt-5 text-muted text-center text-small">
- <p class="mb-1">&copy;
+ <p class="mb-1 small">&copy;
{{- if .Site.Params.since }}
{{ .Site.Params.since }} -
{{- end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 545afdd..6933782 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,9 +1,9 @@
-{{- if eq .Kind "home" }}
- {{- $.Scratch.Set "Description" ( .Site.Params.description | default "The main page" ) }}
- {{- $.Scratch.Set "Title" .Site.Title }}
-{{- else }}
- {{- $.Scratch.Set "Description" ( .Description | default .Params.subtitle | default .Summary | default .Kind ) }}
- {{- $.Scratch.Set "Title" ( .Title | default .Site.Title ) }}
+{{- if eq .Kind "home" -}}
+ {{- $.Scratch.Set "Description" ( .Site.Params.description | default "The main page" ) -}}
+ {{- $.Scratch.Set "Title" .Site.Title -}}
+{{- else -}}
+ {{- $.Scratch.Set "Description" ( .Description | default .Params.subtitle | default .Summary | default .Kind ) -}}
+ {{- $.Scratch.Set "Title" ( .Title | default .Site.Title ) -}}
{{- end }}
<meta charset="utf-8" />
@@ -12,27 +12,27 @@
<!-- Site Title, Description, Author, and Favicon -->
{{- with ($.Scratch.Get "Title") }}
- <title>{{ print . }} - {{ $.Site.Title }}</title>
-{{- end }}
+ <title>{{ print . }} - {{ $.Site.Title }}</title>
+{{- end -}}
{{- with ($.Scratch.Get "Description") }}
- <meta name="description" content="{{ . }}">
-{{- end }}
+ <meta name="description" content="{{ . }}">
+{{- end -}}
{{- with .Site.Author.name }}
- <meta name="author" content="{{ . }}"/>
-{{- end }}
+ <meta name="author" content="{{ . }}"/>
+{{- end -}}
{{- with .Site.Params.favicon }}
- <link href='{{ . | absURL }}' rel='icon' type='image/x-icon'/>
+ <link href='{{ . | absURL }}' rel='icon' type='image/x-icon'/>
{{- end -}}
<!-- SEO -->
-{{- partial "seo/main.html" . }}
+{{- partial "seo/main.html" . -}}
<!-- Social Media Tags -->
-{{- partial "social/main.html" . }}
+{{- partial "social/main.html" . -}}
<!-- Links and stylesheets -->
- <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+ <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
-{{- partial "head_custom.html" . }}
-{{ template "_internal/google_analytics_async.html" . }}
+{{- partial "head_custom.html" . -}}
+{{ template "_internal/google_analytics_async.html" . -}}
diff --git a/layouts/partials/headers/simple.html b/layouts/partials/headers/simple.html
index cf5c400..8bc510d 100644
--- a/layouts/partials/headers/simple.html
+++ b/layouts/partials/headers/simple.html
@@ -1,5 +1,5 @@
<div class="py-5 text-center">
- <h2>{{ .Title }}</h2>
+ <h1>{{ .Params.page_title | default .Title }}</h1>
{{- with .Params.subtitle }}
<p class="lead">{{ . }}</p>
{{- end }}
diff --git a/layouts/partials/navs/simple.html b/layouts/partials/navs/simple.html
index 36ffd66..2d98379 100644
--- a/layouts/partials/navs/simple.html
+++ b/layouts/partials/navs/simple.html
@@ -1,13 +1,13 @@
<div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom shadow-sm">
<h5 class="my-0 mr-md-auto font-weight-normal">
- <a class="text-decoration-none" href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></h5>
+ <a class="text-decoration-none" href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></h5>
<nav class="my-2 my-md-0 mr-md-3">
-{{ range .Site.Menus.main.ByWeight }}
- {{ if .HasChildren }}
+{{- range .Site.Menus.main.ByWeight -}}
+ {{- if .HasChildren -}}
NO HANDLING FOR CHILDREN
- {{ else }}
+ {{- else }}
<a class="p-2 text-dark" title="{{ .Name }}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
- {{ end }}
-{{ end }}
+ {{- end }}
+{{- end -}}
</nav>
</div>
diff --git a/layouts/partials/seo/main.html b/layouts/partials/seo/main.html
index bbf7e6d..14e76cb 100644
--- a/layouts/partials/seo/main.html
+++ b/layouts/partials/seo/main.html
@@ -1 +1,8 @@
-{{- partial "seo/schema" . }}
+{{- range .Params.schemas -}}
+ {{- partial ( printf "seo/%s" . ) $ }}
+{{- end -}}
+{{- if .IsPage }}
+ {{- range .Params.page_schemas -}}
+ {{- partial ( printf "seo/%s" . ) $ }}
+ {{- end -}}
+{{- end -}}
diff --git a/layouts/partials/seo/schema.html b/layouts/partials/seo/schema.html
deleted file mode 100644
index a44260d..0000000
--- a/layouts/partials/seo/schema.html
+++ /dev/null
@@ -1,6 +0,0 @@
-{{- partial "seo/structured/website" . }}
-{{- partial "seo/structured/organization" . }}
-{{- if .IsPage }}
-{{- partial "seo/structured/breadcrumb" . }}
-{{- partial "seo/structured/article" . }}
-{{- end }}
diff --git a/layouts/partials/social/main.html b/layouts/partials/social/main.html
index 2d26caa..1ebf428 100644
--- a/layouts/partials/social/main.html
+++ b/layouts/partials/social/main.html
@@ -1,2 +1,3 @@
-{{- partial "social/opengraph" . }}
-{{- partial "social/twitter" . }}
+{{- range .Params.seo -}}
+ {{- partial ( printf "social/%s" . ) $ }}
+{{- end -}}
diff --git a/layouts/shortcodes/structure/column_end.html b/layouts/shortcodes/structure/column_end.html
new file mode 100644
index 0000000..b0f2d2f
--- /dev/null
+++ b/layouts/shortcodes/structure/column_end.html
@@ -0,0 +1,2 @@
+ </div>
+</div>
diff --git a/layouts/shortcodes/structure/column_next.html b/layouts/shortcodes/structure/column_next.html
new file mode 100644
index 0000000..24bc30b
--- /dev/null
+++ b/layouts/shortcodes/structure/column_next.html
@@ -0,0 +1,3 @@
+{{- $col_definition := .Get "width" | default "col" -}}
+ </div>
+ <div class="{{ $col_definition }}">
diff --git a/layouts/shortcodes/structure/column_start.html b/layouts/shortcodes/structure/column_start.html
new file mode 100644
index 0000000..e2cbd16
--- /dev/null
+++ b/layouts/shortcodes/structure/column_start.html
@@ -0,0 +1,4 @@
+{{- $col_definition := .Get "width" | default "col" -}}
+{{- $justify_definition := .Get "justify" | default "justify-content-md-center" -}}
+<div class="row {{ $justify_definition }}">
+ <div class="{{ $col_definition }}">
diff --git a/layouts/shortcodes/structure/row_end.html b/layouts/shortcodes/structure/row_end.html
new file mode 100644
index 0000000..b0f2d2f
--- /dev/null
+++ b/layouts/shortcodes/structure/row_end.html
@@ -0,0 +1,2 @@
+ </div>
+</div>
diff --git a/layouts/shortcodes/structure/row_start.html b/layouts/shortcodes/structure/row_start.html
new file mode 100644
index 0000000..2c6aa76
--- /dev/null
+++ b/layouts/shortcodes/structure/row_start.html
@@ -0,0 +1,5 @@
+{{- $col_definition := .Get "width" | default "col" -}}
+{{- $justify_definition := .Get "justify" | default "justify-content-md-center" -}}
+{{- $align_definition := .Get "align" | default "" -}}
+<div class="row {{ $justify_definition }}">
+ <div class="{{ $col_definition }} {{ $align_definition }}">
diff --git a/layouts/shortcodes/toc.html b/layouts/shortcodes/toc.html
new file mode 100644
index 0000000..ab89f11
--- /dev/null
+++ b/layouts/shortcodes/toc.html
@@ -0,0 +1,11 @@
+<style>
+nav#TableOfContents > ul {
+ list-style-type: none;
+ padding-inline-start: 0px;
+}
+nav#TableOfContents > ul > li > ul{
+ list-style-type: disc;
+}
+</style>
+
+{{ .Page.TableOfContents }}