From a357477aaa6b6896766c72196b10c90cf17d09c6 Mon Sep 17 00:00:00 2001 From: Calin Tataru Date: Thu, 10 Oct 2019 17:06:02 +0100 Subject: Small changes to layouts --- archetypes/default.md | 2 +- exampleSite/config.toml | 15 ++++++++++----- exampleSite/content/about/index.md | 11 +++++++++++ exampleSite/content/project/project1.md | 2 +- exampleSite/content/project/project2.md | 2 +- exampleSite/content/project/project3.md | 2 +- exampleSite/content/project/project4.md | 2 +- layouts/404.html | 7 +------ layouts/_default/list.html | 5 +++-- layouts/_default/single.html | 30 +++--------------------------- layouts/_default/terms.html | 5 +++-- layouts/index.html | 12 +----------- layouts/page/single.html | 11 ----------- layouts/partials/body-open.html | 4 ++-- layouts/partials/footer.html | 6 ++---- layouts/partials/head-open.html | 4 ++-- layouts/partials/header.html | 14 +------------- layouts/partials/js.html | 8 +++----- layouts/partials/list-item.html | 10 ++++------ layouts/partials/paginator.html | 18 ++++++++++-------- layouts/partials/tags.html | 3 +++ layouts/post/single.html | 28 ++++++++++++++++++++++++++++ 22 files changed, 92 insertions(+), 109 deletions(-) create mode 100644 exampleSite/content/about/index.md delete mode 100644 layouts/page/single.html create mode 100644 layouts/partials/tags.html create mode 100644 layouts/post/single.html diff --git a/archetypes/default.md b/archetypes/default.md index 8c7c756..a628182 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,5 +1,5 @@ --- title: "{{ replace .TranslationBaseName "-" " " | title }}" -date: {{ dateFormat "2006-01-02" .Date }} +description: "" draft: true --- diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 9f87860..c312afc 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -22,19 +22,24 @@ googleAnalytics = "" name = "Home" weight = 1 +[[menu.main]] + url = "/about/" + name = "About" + weight = 2 + [[menu.main]] url = "/post/" name = "Posts" - weight = 2 + weight = 3 [[menu.main]] url = "/project/" name = "Projects" - weight = 3 + weight = 4 -# Social icons to be shown on the right-hand side of the navigation bar -# The "name" field should match the name of the icon to be used -# The list of available icons can be found at http://fontawesome.io/icons/ +# Social icons to be shown on the right-hand side of the navigation bar. +# The "name" field should match the name of the icon in Font Awesome. +# The list of available icons can be found at http://fontawesome.io/icons. [[menu.icon]] url = "mailto:me@example.com" diff --git a/exampleSite/content/about/index.md b/exampleSite/content/about/index.md new file mode 100644 index 0000000..4d4898b --- /dev/null +++ b/exampleSite/content/about/index.md @@ -0,0 +1,11 @@ +--- +title: About +description: What is Hugo? +--- + +Hugo is a fast and modern static site generator written in Go, and designed to make website creation fun again. +Hugo is a general-purpose website framework. Technically speaking, Hugo is a static site generator. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website’s end users and an ideal writing experience for website authors. + +Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including Netlify, Heroku, GoDaddy, DreamHost, GitHub Pages, GitLab Pages, Surge, Aerobatic, Firebase, Google Cloud Storage, Amazon S3, Rackspace, Azure, and CloudFront and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP. + +We think of Hugo as the ideal website creation tool with nearly instant build times, able to rebuild whenever a change is made. diff --git a/exampleSite/content/project/project1.md b/exampleSite/content/project/project1.md index 54d5138..2d7e1f9 100644 --- a/exampleSite/content/project/project1.md +++ b/exampleSite/content/project/project1.md @@ -1,7 +1,7 @@ --- title: "Project 1" description: "Lorem ipsum dolor sit amet" -repo: "#" # delete this line if you want blog-like posts for projects +repo: "#" # delete this line if you want a blog-like page tags: ["go", "golang", "hugo"] weight: 1 draft: false diff --git a/exampleSite/content/project/project2.md b/exampleSite/content/project/project2.md index c62e896..e7a32e5 100644 --- a/exampleSite/content/project/project2.md +++ b/exampleSite/content/project/project2.md @@ -1,7 +1,7 @@ --- title: "Project 2" description: "Consectetur adipiscing elit" -repo: "#" # delete this line if you want blog-like posts for projects +repo: "#" # delete this line if you want a blog-like page tags: ["html", "css", "js"] weight: 2 draft: false diff --git a/exampleSite/content/project/project3.md b/exampleSite/content/project/project3.md index 0eac5cd..2923e0b 100644 --- a/exampleSite/content/project/project3.md +++ b/exampleSite/content/project/project3.md @@ -1,7 +1,7 @@ --- title: "Project 3" description: "Cras felis sapien" -repo: "#" # delete this line if you want blog-like posts for projects +repo: "#" # delete this line if you want a blog-like page tags: ["bootstrap", "responsive"] weight: 3 draft: false diff --git a/exampleSite/content/project/project4.md b/exampleSite/content/project/project4.md index 86b502d..89d3786 100644 --- a/exampleSite/content/project/project4.md +++ b/exampleSite/content/project/project4.md @@ -1,7 +1,7 @@ --- title: "Project 4" description: "Pellentesque eu lacinia id" -repo: "#" # delete this line if you want blog-like posts for projects +repo: "#" # delete this line if you want a blog-like page tags: ["highlight-js", "syntax-highlighting"] weight: 4 draft: false diff --git a/layouts/404.html b/layouts/404.html index 11cef1c..8a686ff 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,15 +1,10 @@ {{ partial "header" . }}
-
-

¯\_(ツ)_/¯

- -

Page not found

- +

Nothing here

-
{{ partial "footer" . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 74f57fb..0596fc6 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -2,12 +2,13 @@
-

{{ .Title }}

+
+

{{ .Title }}

+
{{ range (.Paginator 5).Pages }} {{ partial "list-item" . }} {{ end }}
{{ partial "paginator" . }} - {{ partial "footer" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index cc4aa29..49a33bc 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,38 +2,14 @@
- {{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "subtitle" }} - {{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }} -

{{ .Title }}

-
{{ $.Scratch.Get "subtitle" }}
- {{ range .Params.tags }} - {{ . }} - {{ end }} +
{{ .Description }}
+ {{ partial "tags" . }}

{{ .Content }}
- - {{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }} - - {{ if $related }} - - - - {{ range $related }} {{ partial "list-item" . }} {{ end }} - - {{ end }} - - {{ if and .Site.DisqusShortname (not .Params.disableComments) }} - - - - {{ template "_internal/disqus.html" . }} - - {{ end }} -
-{{ partial "footer.html" . }} +{{ partial "footer" . }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 74f57fb..0596fc6 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -2,12 +2,13 @@
-

{{ .Title }}

+
+

{{ .Title }}

+
{{ range (.Paginator 5).Pages }} {{ partial "list-item" . }} {{ end }}
{{ partial "paginator" . }} - {{ partial "footer" . }} diff --git a/layouts/index.html b/layouts/index.html index 75943a0..f94ba2d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,22 +1,12 @@ {{ partial "header" . }}
-
- {{ with .Site.Params.profilePic }} {{ end }} -

{{ .Site.Title }}

-

{{ markdownify .Site.Params.Description }}

- - {{ with .Content }} -
- {{ . }} -
- {{ end }} + {{ with .Content }}
{{ . }}
{{ end }}
-
{{ partial "footer" . }} diff --git a/layouts/page/single.html b/layouts/page/single.html deleted file mode 100644 index 463fcf2..0000000 --- a/layouts/page/single.html +++ /dev/null @@ -1,11 +0,0 @@ -{{ partial "header" . }} - -
- -

{{ .Title }}

- -
{{ .Content }}
- -
- -{{ partial "footer.html" . }} diff --git a/layouts/partials/body-open.html b/layouts/partials/body-open.html index 11b798a..87b95b8 100644 --- a/layouts/partials/body-open.html +++ b/layouts/partials/body-open.html @@ -1,2 +1,2 @@ - \ No newline at end of file + diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 8a0706f..07cead4 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,9 +1,7 @@ - + diff --git a/layouts/partials/head-open.html b/layouts/partials/head-open.html index 9828a89..d4fb2c2 100644 --- a/layouts/partials/head-open.html +++ b/layouts/partials/head-open.html @@ -1,2 +1,2 @@ - \ No newline at end of file + diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 2172213..d5fd837 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -21,7 +21,6 @@ window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments)}; gtag('js', new Date()); - gtag('config', '{{ .Site.GoogleAnalytics }}'); {{ end }} @@ -29,7 +28,7 @@ {{ if .Site.Params.MathJax | default true }} {{ end }} @@ -37,23 +36,16 @@ {{ partial "body-open" . }} diff --git a/layouts/partials/js.html b/layouts/partials/js.html index 356b8e4..0495077 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -1,12 +1,10 @@ {{ if .Site.Params.highlight | default false }} - - - {{ range .Site.Params.highlightLanguages }} {{ end }} - + {{ range .Site.Params.highlightLanguages }} + + {{ end }} - {{ end }} diff --git a/layouts/partials/list-item.html b/layouts/partials/list-item.html index e6a2106..1b6fc95 100644 --- a/layouts/partials/list-item.html +++ b/layouts/partials/list-item.html @@ -13,13 +13,11 @@ {{ end }} {{ with .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }} - {{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "subtitle" }} - {{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }} + {{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "subheader" }} + {{ with .Description }} {{ $.Scratch.Set "subheader" . }} {{ end }}

{{ .Title }}

-
{{ $.Scratch.Get "subtitle" }}
- {{ range .Params.tags }} - {{ . }} - {{ end }} +
{{ $.Scratch.Get "subheader" }}
+ {{ partial "tags" . }} diff --git a/layouts/partials/paginator.html b/layouts/partials/paginator.html index d6128f4..24444d2 100644 --- a/layouts/partials/paginator.html +++ b/layouts/partials/paginator.html @@ -3,15 +3,17 @@
{{ if .Paginator.HasPrev }} - - {{ end }} {{ if .Paginator.HasNext }} - + + {{ end }} + + {{ if .Paginator.HasNext }} + {{ end }}
-{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000..e6a91d5 --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,3 @@ +{{ range .Params.tags }} +{{ . }} +{{ end }} diff --git a/layouts/post/single.html b/layouts/post/single.html new file mode 100644 index 0000000..8cbaa72 --- /dev/null +++ b/layouts/post/single.html @@ -0,0 +1,28 @@ +{{ partial "header" . }} + +
+ +
+

{{ .Title }}

+
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") }}
+ {{ partial "tags" . }} +
+ +
{{ .Content }}
+ + + {{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }} + {{ if $related }} + + {{ range $related }} {{ partial "list-item" . }} {{ end }} + {{ end }} + + + {{ if and .Site.DisqusShortname (not .Params.disableComments) }} + + {{ template "_internal/disqus.html" . }} + {{ end }} + +
+ +{{ partial "footer" . }} -- cgit v1.2.3