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

github.com/runningstream/hugograyscale.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrunningstream <runningstreamllc@gmail.com>2020-02-01 23:33:29 +0300
committerrunningstream <runningstreamllc@gmail.com>2020-02-01 23:33:29 +0300
commitda6d5e7b682547243a897d150f8d5f440a1f7af5 (patch)
tree4df5478f2488dc1e3caffa9e86ce88bf47e1b2d4
parent630f5e2d1d33912d79af07a3ef1667cc5caa4296 (diff)
Used headless leaf page to make things hugonic
-rw-r--r--README.md75
-rw-r--r--exampleSite/config.toml8
-rw-r--r--exampleSite/config_for_github_pages.toml8
-rw-r--r--exampleSite/content/_index.md1
-rw-r--r--exampleSite/content/sections/index.md3
-rw-r--r--exampleSite/content/sections/section0.md (renamed from exampleSite/content/section0.md)0
-rw-r--r--exampleSite/content/sections/section1.md (renamed from exampleSite/content/section1.md)4
-rw-r--r--exampleSite/content/sections/section2.md (renamed from exampleSite/content/section2.md)0
-rw-r--r--exampleSite/content/sections/section3.md (renamed from exampleSite/content/section3.md)0
-rw-r--r--layouts/_default/index.xml24
-rw-r--r--layouts/_default/list.html0
-rw-r--r--layouts/_default/single.html0
-rw-r--r--layouts/_default/sitemap.xml22
-rw-r--r--layouts/index.html105
-rw-r--r--layouts/partials/head.html47
15 files changed, 155 insertions, 142 deletions
diff --git a/README.md b/README.md
index 0fd948f..56dca48 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,9 @@ Drop it in your site's themes folder, then modify your site config file to speci
## Configuration and Content
-The Hugo Grayscale theme is a one page theme designed to be the front page to your site. Its content is in sections with visual breaks between each. The content is contained in markdown files in the content folder, ordered by their `weight` parameter. The `exampleSite` directory is a good place to start. The page is designed to consist of, in order:
+### Description
+
+The Hugo Grayscale theme is a one page theme designed to be the front page to your site. Its content is in sections with visual breaks between each. The content is contained in markdown files in the `content/sections` directory, ordered by their `weight` parameter. The `exampleSite` directory is a good place to start. The page is designed to consist of, in order:
* a navbar at top linking to the other sections, and other arbitrary links
* an intro section presenting a header title and into text with background image
@@ -24,9 +26,76 @@ The Hugo Grayscale theme is a one page theme designed to be the front page to yo
These section names correspond to the `title` front matter parameter, and the files are ordered by their `weight` front matter parameter. The section names show up as the links in the navbar.
-The page's overall title, date, copyright and additional navbar links are specified in `content/_index.md`.
+Because this theme generates only one page, the RSS feed contains no items. The sitemap will only contain the home page.
+
+### Site Configuration
+
+Site configuration can include an author and social section, like the following:
+
+```
+[Author]
+ name = "Site Creator Name"
+ email = "Site Creator Email"
+[Social]
+ twitter = "site_twitter_handle"
+```
+
+These settings will enable proper display in the meta tags.
+
+### Content Directory Layout
+
+```
+.
+...
+├── content
+| ├── _index.md
+| └── sections
+| ├── index.md
+| ├── section_data_1.md
+| ├── section_data_2.md
+| ├── section_data_3.md
+...
+```
+
+`content/_index.md` specifies front matter for the page. `content/sections/` contains all the sections that are displayed on the page. `content/sections/index.md` should contain front matter specifying that the directory is `headless`. Other `content/sections/*.md` files can be named anything, and comprise the section content.
+
+### Front Matter
+
+The page's overall title, date, copyright and additional navbar links are specified in `content/_index.md`. Like so:
+
+```
+---
+title: "Hugo Grayscale Theme"
+date: 2018-09-09T00:00:00-00:00
+copyright: "Your Website"
+description: "A port of the Grayscale theme to Hugo"
+
+menu:
+ - {url: "https://startbootstrap.com/themes/grayscale/", name: "Original"}
+---
+```
+
+The `content/sections/index.md` front matter should specify that the directory is headless. Note that the filename has no underscore this time...
+
+```
+---
+headless: true
+---
+```
+
+Section frontmatter (files like `content/sections/*.md` other than `index.md`) should specify a `title` and `weight`, and can specify `improvecontrast`.
+
+```
+---
+title: "About"
+weight: 2
+improvecontrast: true
+---
+```
+
+The `title` property is used for link text, and `weight` determines section ordering. Specifying `improvecontrast: true` places a contrast-improving transparent box behind your text. This is most appropriate on even-numbered sections because they have background images.
-Because this theme generates only one page, it does not generate an RSS feed. The sitemap will only contain the home page.
+### Images
The background images are selected by filename and placed in the "static/img/" directory for your site.
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index b3db28b..9822681 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -8,4 +8,10 @@ disableKinds = ["taxonomy", "taxonomyTerm"]
[params]
# Provide some metadata for search and indexing services
description = "A port of the Grayscale theme to Hugo"
- author = "RunningStream"
+
+[Author]
+ name = "RunningStream"
+ email = "dco@runningstream.net"
+
+[Social]
+ twitter = "stream_running"
diff --git a/exampleSite/config_for_github_pages.toml b/exampleSite/config_for_github_pages.toml
index a33af1d..0778f27 100644
--- a/exampleSite/config_for_github_pages.toml
+++ b/exampleSite/config_for_github_pages.toml
@@ -8,4 +8,10 @@ disableKinds = ["taxonomy", "taxonomyTerm"]
[params]
# Provide some metadata for search and indexing services
description = "A port of the Grayscale theme to Hugo"
- author = "RunningStream"
+
+[Author]
+ name = "RunningStream"
+ email = "dco@runningstream.net"
+
+[Social]
+ twitter = "stream_running"
diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md
index 9504cdd..90895d0 100644
--- a/exampleSite/content/_index.md
+++ b/exampleSite/content/_index.md
@@ -2,6 +2,7 @@
title: "Hugo Grayscale Theme"
date: 2018-09-09T00:00:00-00:00
copyright: "Your Website"
+description: "A port of the Grayscale theme to Hugo"
menu:
- {url: "https://startbootstrap.com/themes/grayscale/", name: "Original"}
diff --git a/exampleSite/content/sections/index.md b/exampleSite/content/sections/index.md
new file mode 100644
index 0000000..ca03031
--- /dev/null
+++ b/exampleSite/content/sections/index.md
@@ -0,0 +1,3 @@
+---
+headless: true
+---
diff --git a/exampleSite/content/section0.md b/exampleSite/content/sections/section0.md
index 7577102..7577102 100644
--- a/exampleSite/content/section0.md
+++ b/exampleSite/content/sections/section0.md
diff --git a/exampleSite/content/section1.md b/exampleSite/content/sections/section1.md
index 730b128..70e5181 100644
--- a/exampleSite/content/section1.md
+++ b/exampleSite/content/sections/section1.md
@@ -7,8 +7,6 @@ weight: 2
Grayscale is a free Hugo theme, originally created for Bootstrap by Start Bootstrap. It can be yours right now, simply download the template from [the Github page](https://github.com/runningstream/hugograyscale/). The theme is open source, and you can use it for any purpose, personal or commercial.
-This theme was also adapted from a Jekyll version, brought to you by [Jerome Lachaud](https://github.com/jeromelachaud)
+This theme was adapted from a Jekyll version, brought to you by [Jerome Lachaud](https://github.com/jeromelachaud)
This theme features stock photos by [Gratisography](http://gratisography.com/) along with a custom Google Maps skin courtesy of [Snazzy Maps](http://snazzymaps.com/).
-
-Grayscale includes full HTML, CSS, and custom JavaScript files along with SASS and LESS files for easy customization!
diff --git a/exampleSite/content/section2.md b/exampleSite/content/sections/section2.md
index 61d08e7..61d08e7 100644
--- a/exampleSite/content/section2.md
+++ b/exampleSite/content/sections/section2.md
diff --git a/exampleSite/content/section3.md b/exampleSite/content/sections/section3.md
index b90e4de..b90e4de 100644
--- a/exampleSite/content/section3.md
+++ b/exampleSite/content/sections/section3.md
diff --git a/layouts/_default/index.xml b/layouts/_default/index.xml
deleted file mode 100644
index e039610..0000000
--- a/layouts/_default/index.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-{{- $pctx := . -}}
-{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
-{{- $pages := $pctx.RegularPages -}}
-{{- $limit := .Site.Config.Services.RSS.Limit -}}
-{{- if ge $limit 1 -}}
-{{- $pages = $pages | first $limit -}}
-{{- end -}}
-{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
- <channel>
- <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
- <link>{{ .Permalink }}</link>
- <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
- <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
- <language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
- <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
- <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
- <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
- <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
- {{ with .OutputFormats.Get "RSS" }}
- {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
- {{ end }}
- </channel>
-</rss>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
deleted file mode 100644
index e69de29..0000000
--- a/layouts/_default/list.html
+++ /dev/null
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
deleted file mode 100644
index e69de29..0000000
--- a/layouts/_default/single.html
+++ /dev/null
diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml
deleted file mode 100644
index a48ab5d..0000000
--- a/layouts/_default/sitemap.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
-<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
- xmlns:xhtml="http://www.w3.org/1999/xhtml">
- {{ with .Site.GetPage }}
- <url>
- <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
- <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
- <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
- <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
- <xhtml:link
- rel="alternate"
- hreflang="{{ .Lang }}"
- href="{{ .Permalink }}"
- />{{ end }}
- <xhtml:link
- rel="alternate"
- hreflang="{{ .Lang }}"
- href="{{ .Permalink }}"
- />{{ end }}
- </url>
- {{ end }}
-</urlset>
diff --git a/layouts/index.html b/layouts/index.html
index 2929ba3..5f1a705 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,66 +1,43 @@
-{{- define "main" -}}
- <!-- Navigation -->
- <nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
- <div class="container">
- <a class="navbar-brand js-scroll-trigger improve-contrast-box" href="#page-top">{{ $.Params.title }}</a>
- <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
- Menu
- <i class="fa fa-bars"></i>
- </button>
- <div class="collapse navbar-collapse" id="navbarResponsive">
- <ul class="navbar-nav ml-auto">
- {{- range $ind, $elem := .Pages.ByWeight }}
- {{ if ne $ind 0 }}
- <li class="nav-item">
- <a class="nav-link js-scroll-trigger improve-contrast-box" href="#sec-ind-{{ $ind }}">{{- $elem.Params.title -}}</a>
- </li>
- {{ end }}
- {{- end -}}
-
- {{- if isset $.Params "menu" -}}
- {{- range $menuitem := $.Params.menu -}}
- <li class="nav-item">
- <a class="nav-link js-scroll-trigger improve-contrast-box" href="{{ $menuitem.url | safeHTML }}">{{- default $menuitem.url $menuitem.name | safeHTML -}}</a>
- </li>
- {{- end -}}
- {{- end -}}
- </ul>
- </div>
- </div>
- </nav>
-
- {{ range $ind, $elem := .Pages.ByWeight }}
- {{ if eq $ind 0 -}}
- <header><div id="intro-body">
- {{- else -}}
- <section id="sec-ind-{{ $ind }}" class="section-{{ $ind }} content-section text-center">
- {{- end -}}
-
- <div class="container"><div class="row"><div class="col-lg-8 mx-auto">
- {{- if $elem.Params.improvecontrast -}}
- <div class="improve-contrast-box">
- {{- end -}}
- {{- default "" $elem.Content -}}
- {{- if $elem.Params.improvecontrast -}}
- </div>
- {{- end -}}
-
- {{- if eq $ind 0 -}}
- <a href="#sec-ind-1" class="btn btn-circle js-scroll-trigger" aria-label="Scroll to Next Section"><i class="fa fa-angle-double-down animated"></i></a>
- {{- end -}}
-
- </div></div></div>
-
- {{- if eq $ind 0 -}}
- </div></header>
- {{- else -}}
- </section>
- {{- end }}
- {{ end }}
-
- {{- if isset $.Params "mapsapikey" -}}
- <!-- Map Section -->
- <div id="map"></div>
+{{- define "main" }}
+
+{{- $sections := $.Site.GetPage "/sections" }}
+<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
+ <div class="container">
+ <a class="navbar-brand js-scroll-trigger improve-contrast-box" href="#page-top">{{ $.Params.title }}</a>
+ <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">Menu<i class="fa fa-bars"></i></button>
+ <div class="collapse navbar-collapse" id="navbarResponsive">
+ <ul class="navbar-nav ml-auto">
+ {{- range $ind, $elem := (sort $sections.Resources ".Params.weight") }}{{- if ne $ind 0 }}
+ <li class="nav-item">
+ <a class="nav-link js-scroll-trigger improve-contrast-box" href="#sec-ind-{{ $ind }}">{{- $elem.Params.title -}}</a>
+ </li>
+ {{- end }}{{ end }}
+
+ {{- if isset $.Params "menu" -}}
+ {{- range $menuitem := $.Params.menu -}}
+ <li class="nav-item">
+ <a class="nav-link js-scroll-trigger improve-contrast-box" href="{{ $menuitem.url | safeHTML }}">{{- default $menuitem.url $menuitem.name | safeHTML -}}</a>
+ </li>
{{- end -}}
-
+ {{- end -}}
+ </ul>
+ </div>
+ </div>
+</nav>
+
+{{ range $ind, $elem := (sort $sections.Resources ".Params.weight") }}
+ {{- if eq $ind 0 -}}<header><div id="intro-body">
+ {{- else }}<section id="sec-ind-{{ $ind }}" class="section-{{ $ind }} content-section text-center">{{ end }}
+ <div class="container"><div class="row"><div class="col-lg-8 mx-auto">
+ {{- if $elem.Params.improvecontrast }}<div class="improve-contrast-box">{{ end }}
+ {{ default "" $elem.Content }}
+ {{- if $elem.Params.improvecontrast }}</div>{{ end }}
+ {{ if eq $ind 0 }}<a href="#sec-ind-1" class="btn btn-circle js-scroll-trigger" aria-label="Scroll to Next Section"><i class="fa fa-angle-double-down animated"></i></a>{{ end -}}
+ </div></div></div>
+
+ {{ if eq $ind 0 }}</div></header>
+ {{- else -}}</section>{{- end }}
+{{ end }}
+
+{{- if isset $.Params "mapsapikey" }}<div id="map"></div>{{ end }}
{{- end -}}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 990277e..488318a 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,29 +1,28 @@
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <meta name="description" content="{{ $.Param "description" }}">
- <meta name="author" content="{{ $.Param "author" }}">
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+{{ $description := $.Param "description" }}
+{{- with $description }}<meta name="description" content="{{ . }}">{{ end }}
+{{ $author := .Params.author.name | default .Site.Author.name }}
+<meta name="author" content="{{ $author }}">
- <title>{{- $.Param "title" -}}</title>
- <link rel="icon" href="/favicon.ico">
+<title>{{- $.Param "title" -}}</title>
+<link rel="icon" href="/favicon.ico">
- <!-- SEO Prefs -->
- <meta name="robots" content="index,follow">
- <meta name="referrer" content="origin-when-cross-origin">
- {{- if isset .Site.Params "googlesiteverification" -}}<meta name="google-site-verification" content="{{ .Site.Params.googleSiteVerification }}">{{- end -}}
- {{- if isset .Site.Params "msvalidate" -}}<meta name="msvalidate.01" content="{{ .Site.Params.msValidate }}">{{- end -}}
+<meta name="robots" content="index,follow">
+<meta name="referrer" content="origin-when-cross-origin">
+{{- with .Site.Params.googlesiteverification }}
+<meta name="google-site-verification" content="{{ . }}">{{ end }}
+{{- with .Site.Params.msvalidate }}
+<meta name="msvalidate.01" content="{{ . }}">{{ end }}
+{{ hugo.Generator }}
+{{ template "_internal/opengraph.html" . }}
+{{ template "_internal/twitter_cards.html" . }}
- <!-- Site Generator -->
- <meta name="generator" content="Hugo {{ hugo.Version }}">
+<link href="{{ "vendor/bootstrap/css/bootstrap.min.css" | absURL }}" rel="stylesheet">
+<link href="{{ "vendor/font-awesome/css/font-awesome.min.css" | absURL }}" rel="stylesheet" type="text/css">
+<link href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
+<link href='https://fonts.googleapis.com/css?family=Cabin:700' rel='stylesheet' type='text/css'>
- <!-- Bootstrap core CSS -->
- <link href="{{ "vendor/bootstrap/css/bootstrap.min.css" | absURL }}" rel="stylesheet">
+<link href="{{ "css/grayscale.css" | absURL }}" rel="stylesheet">
- <!-- Custom fonts for this template -->
- <link href="{{ "vendor/font-awesome/css/font-awesome.min.css" | absURL }}" rel="stylesheet" type="text/css">
- <link href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
- <link href='https://fonts.googleapis.com/css?family=Cabin:700' rel='stylesheet' type='text/css'>
-
- <!-- Custom styles for this template -->
- <link href="{{ "css/grayscale.css" | absURL }}" rel="stylesheet">
-
- {{ template "_internal/google_analytics_async.html" . }}
+{{ template "_internal/google_analytics_async.html" . }}