From 4236a00d7a5404c2a63a3ea4e08553745cdcaa67 Mon Sep 17 00:00:00 2001 From: Vincent Tam Date: Sat, 24 Aug 2019 19:50:05 +0200 Subject: [PATCH 1/5] Updated Site Intro to remove a debug line in #80 --- layouts/partials/site-intro.html | 1 - 1 file changed, 1 deletion(-) diff --git a/layouts/partials/site-intro.html b/layouts/partials/site-intro.html index 486b7e6f..ef041b79 100644 --- a/layouts/partials/site-intro.html +++ b/layouts/partials/site-intro.html @@ -14,5 +14,4 @@ {{ end }} -

{{ .Site.Languages }}

From 1236b044c872d9c8c91d83b8079a653ec2b3a225 Mon Sep 17 00:00:00 2001 From: Vincent Tam Date: Sat, 24 Aug 2019 21:43:57 +0200 Subject: [PATCH 2/5] Updated Menu Syntax to suit Hugo Docs (#83) --- exampleSite/config.toml | 75 ++++++++++++++++++++----------- layouts/partials/site-header.html | 12 ++++- 2 files changed, 61 insertions(+), 26 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b8ab2f1b..214abce8 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -109,32 +109,37 @@ disableLanguages = [""] # Identifier prepends a Font Awesome icon to the menu item [[menu.main]] name = "Home" + identifier = "home" url = "/" - identifier = "fas fa-home" + pre = "" weight = 1 [[menu.main]] name = "About" + identifier = "about" url = "/about/" - identifier = "far fa-id-card" + pre = "" weight = 2 [[menu.main]] name = "Blog" + identifier = "blog" url = "/blog/" - identifier = "far fa-newspaper" + pre = "" weight = 3 [[menu.main]] name = "Categories" + identifier = "categories" url = "/categories/" - identifier = "fas fa-sitemap" + pre = "" weight = 5 [[menu.main]] name = "Contact" + identifier = "contact" url = "/contact/" - identifier = "far fa-envelope" + pre = "" weight = 6 [Languages] @@ -153,32 +158,37 @@ disableLanguages = [""] [[Languages.de.menu.main]] name = "Startseite" + identifier = "home" url = "/" - identifier = "fas fa-home" + pre = "" weight = 1 [[Languages.de.menu.main]] name = "Über mich" + identifier = "about" url = "/about/" - identifier = "far fa-id-card" + pre = "" weight = 2 [[Languages.de.menu.main]] name = "Blog" + identifier = "blog" url = "/blog/" - identifier = "far fa-newspaper" + pre = "" weight = 3 [[Languages.de.menu.main]] name = "Kategorien" + identifier = "categories" url = "/categories/" - identifier = "fas fa-sitemap" + pre = "" weight = 5 [[Languages.de.menu.main]] name = "Kontakt" + identifier = "contact" url = "/contact/" - identifier = "far fa-envelope" + pre = "" weight = 6 [Languages.fr] @@ -190,32 +200,37 @@ disableLanguages = [""] [[Languages.fr.menu.main]] name = "Accueil" + identifier = "home" url = "/" - identifier = "fas fa-home" + pre = "" weight = 1 [[Languages.fr.menu.main]] name = "About" + identifier = "about" url = "/about/" - identifier = "far fa-id-card" + pre = "" weight = 2 [[Languages.fr.menu.main]] name = "Blog" + identifier = "blog" url = "/blog/" - identifier = "far fa-newspaper" + pre = "" weight = 3 [[Languages.fr.menu.main]] name = "Catégories" + identifier = "categories" url = "/categories/" - identifier = "fas fa-sitemap" + pre = "" weight = 5 [[Languages.fr.menu.main]] name = "Contact" + identifier = "contact" url = "/contact/" - identifier = "far fa-envelope" + pre = "" weight = 6 [Languages.pl] @@ -227,32 +242,37 @@ disableLanguages = [""] [[Languages.pl.menu.main]] name = "Home" + identifier = "home" url = "/" - identifier = "fas fa-home" + pre = "" weight = 1 [[Languages.pl.menu.main]] name = "O mnie" + identifier = "about" url = "/about/" - identifier = "far fa-id-card" + pre = "" weight = 2 [[Languages.pl.menu.main]] name = "Blog" + identifier = "blog" url = "/blog/" - identifier = "far fa-newspaper" + pre = "" weight = 3 [[Languages.pl.menu.main]] name = "Kategorie" + identifier = "categories" url = "/categories/" - identifier = "fas fa-sitemap" + pre = "" weight = 5 [[Languages.pl.menu.main]] name = "Kontakt" + identifier = "contact" url = "/contact/" - identifier = "far fa-envelope" + pre = "" weight = 6 [Languages.pt] @@ -264,32 +284,37 @@ disableLanguages = [""] [[Languages.pt.menu.main]] name = "Início" + identifier = "home" url = "/" - identifier = "fas fa-home" + pre = "" weight = 1 [[Languages.pt.menu.main]] name = "Sobre" + identifier = "about" url = "/about/" - identifier = "far fa-id-card" + pre = "" weight = 2 [[Languages.pt.menu.main]] name = "Blog" + identifier = "blog" url = "/blog/" - identifier = "far fa-newspaper" + pre = "" weight = 3 [[Languages.pt.menu.main]] name = "Categorias" + identifier = "categories" url = "/categories/" - identifier = "fas fa-sitemap" + pre = "" weight = 5 [[Languages.pt.menu.main]] name = "Contato" + identifier = "contact" url = "/contact/" - identifier = "far fa-envelope" + pre = "" weight = 6 # Sets Social Media icons to appear and link to your account. Value should be your diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html index e30d819e..da5981b6 100644 --- a/layouts/partials/site-header.html +++ b/layouts/partials/site-header.html @@ -20,7 +20,17 @@

{{ range .Site.Menus.main }} -  {{ .Name }} + {{ if and (gt (len (findRE "fa[rsb]( fa-([a-z-]+))+" .Identifier)) 0) (not .Pre) }} + {{/* Old syntax: use '.Identifier' for icon rendering */}} +  {{ .Name }} + {{ else }} + {{/* New syntax: use '.Pre' for icon rendering */}} + {{ if .Pre }} + {{ .Pre }} {{ .Name }} + {{ else }} + {{ .Name }} + {{ end }} + {{ end }} {{ end }} {{ if .Site.Params.header.shareMenu }}{{ end }} {{ if .Site.Params.header.searchMenu }}{{ partial "search-menu" . }}{{ end }} From cbba9848dac9aaa030439bcbaf57f3f4df7e8a51 Mon Sep 17 00:00:00 2001 From: Patrick Collins Date: Sat, 24 Aug 2019 16:41:33 -0400 Subject: [PATCH 3/5] Fix Twitter card and move to `images` instead of `featured` (#72) * Remove redundant meta * Change archetypes to images=[""] * Update featured to images --- archetypes/blog.md | 4 +--- archetypes/default.md | 4 +--- archetypes/itemized.md | 15 --------------- layouts/partials/meta.html | 1 - layouts/post/featured.html | 14 ++++++++++---- 5 files changed, 12 insertions(+), 26 deletions(-) delete mode 100644 archetypes/itemized.md diff --git a/archetypes/blog.md b/archetypes/blog.md index 2bce2f6b..cdb3de28 100644 --- a/archetypes/blog.md +++ b/archetypes/blog.md @@ -3,9 +3,7 @@ author = "" categories = [""] date = "" description = "" -featured = "" -featuredalt = "" -featuredpath = "" +images = [""] linktitle = "" title = "" type = "post" diff --git a/archetypes/default.md b/archetypes/default.md index 13027220..cc9ea425 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -3,8 +3,6 @@ author = "" categories = [] description = "" linktitle = "" -featured = "" -featuredpath = "" -featuredalt = "" +images = [""] +++ diff --git a/archetypes/itemized.md b/archetypes/itemized.md deleted file mode 100644 index 2bda7720..00000000 --- a/archetypes/itemized.md +++ /dev/null @@ -1,15 +0,0 @@ -+++ -author = "" -categories = [""] -date = "" -description = "" -featured = "" -featuredalt = "" -featuredpath = "" -link = "" -linktitle = "" -format = "" -title = "" -type = "itemized" - -+++ diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index e7755391..30495ad7 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -1,6 +1,5 @@ {{ .Title }}{{ if ne .Title .Site.Title }} - {{ .Site.Title }}{{ end }} - {{ if .Site.Params.meta.favicon }} diff --git a/layouts/post/featured.html b/layouts/post/featured.html index 2d0297bb..03b52112 100644 --- a/layouts/post/featured.html +++ b/layouts/post/featured.html @@ -1,5 +1,11 @@ -{{ if .Params.featured }} - - {{ .Params.featuredalt }} - +{{ if .Params.images }} + + {{ range first 1 .Params.images }} + + {{ end }} + +{{ else if .Params.featured }} + + {{ .Params.featuredalt }} + {{ end }} From eaf172edb7a4250ec40ddb9d6f50bac47a1a9c81 Mon Sep 17 00:00:00 2001 From: Tobias Watzl Date: Mon, 26 Aug 2019 01:50:38 +0200 Subject: [PATCH 4/5] Added empty add-on.css and add-on.js files and extended the documentation to explain their purpose. --- README.md | 5 +++++ static/css/add-on.css | 6 ++++++ static/js/add-on.js | 6 ++++++ 3 files changed, 17 insertions(+) create mode 100644 static/css/add-on.css create mode 100644 static/js/add-on.js diff --git a/README.md b/README.md index dbf64596..afab2403 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,11 @@ _false_ will turn a feature **off**. It is structured as follows: └── .Social // Controls Links to Social Media ``` +### Custom JavaScript and CSS + +You can adapt this theme according to your preferences using your own JS or CSS code. +To do this your can write your code in `static/css/add-on.css` and `static/js/add-on.js`. + ### Hugo's Built-In Server To see a live version of your site locally, use the following command: diff --git a/static/css/add-on.css b/static/css/add-on.css new file mode 100644 index 00000000..8796d53e --- /dev/null +++ b/static/css/add-on.css @@ -0,0 +1,6 @@ +/* + This css file is for individual users to restyle items for their personal site, + or for the implementation of features specifically for their site. Anything that + is an official part of the theme (ex. Pull Requests) should be included in main.css + and follow the formatting and style given. +*/ diff --git a/static/js/add-on.js b/static/js/add-on.js new file mode 100644 index 00000000..da67d15c --- /dev/null +++ b/static/js/add-on.js @@ -0,0 +1,6 @@ +/* + This js file is for individual users to modify the scripts for their personal site, + or for the implementation of features specifically for their site. Anything that + is an official part of the theme (ex. Pull Requests) should be included in main.js + and follow the formatting and style given. +*/ From 797304472719117987397c05aa12ae5a46242af2 Mon Sep 17 00:00:00 2001 From: Vincent Tam Date: Mon, 26 Aug 2019 10:59:14 +0200 Subject: [PATCH 5/5] Removed references to add-on.* --- README.md | 3 ++- exampleSite/static/css/add-on.css | 6 ------ exampleSite/static/js/add-on.js | 6 ------ layouts/partials/head.html | 1 - layouts/partials/scripts.html | 1 - static/css/add-on.css | 6 ------ static/js/add-on.js | 6 ------ 7 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 exampleSite/static/css/add-on.css delete mode 100644 exampleSite/static/js/add-on.js delete mode 100644 static/css/add-on.css delete mode 100644 static/js/add-on.js diff --git a/README.md b/README.md index afab2403..99d7a04a 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,8 @@ _false_ will turn a feature **off**. It is structured as follows: ### Custom JavaScript and CSS You can adapt this theme according to your preferences using your own JS or CSS code. -To do this your can write your code in `static/css/add-on.css` and `static/js/add-on.js`. +To do this your can add your custom scripts to the `cssFiles` and `jsFiles` +parameters in *config.toml*. ### Hugo's Built-In Server diff --git a/exampleSite/static/css/add-on.css b/exampleSite/static/css/add-on.css deleted file mode 100644 index 8796d53e..00000000 --- a/exampleSite/static/css/add-on.css +++ /dev/null @@ -1,6 +0,0 @@ -/* - This css file is for individual users to restyle items for their personal site, - or for the implementation of features specifically for their site. Anything that - is an official part of the theme (ex. Pull Requests) should be included in main.css - and follow the formatting and style given. -*/ diff --git a/exampleSite/static/js/add-on.js b/exampleSite/static/js/add-on.js deleted file mode 100644 index da67d15c..00000000 --- a/exampleSite/static/js/add-on.js +++ /dev/null @@ -1,6 +0,0 @@ -/* - This js file is for individual users to modify the scripts for their personal site, - or for the implementation of features specifically for their site. Anything that - is an official part of the theme (ex. Pull Requests) should be included in main.js - and follow the formatting and style given. -*/ diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a229fc26..ca637803 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -18,7 +18,6 @@ {{ $mainCSSOptions := (dict "targetPath" "css/main.min.css" "outputStyle" "compressed") }} {{ $style := resources.Get "scss/main.scss" | resources.ToCSS $mainCSSOptions | resources.Fingerprint }} - {{ else }} {{ end }} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 79b9354a..65065d08 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -10,7 +10,6 @@ - {{ else }} {{ end }} diff --git a/static/css/add-on.css b/static/css/add-on.css deleted file mode 100644 index 8796d53e..00000000 --- a/static/css/add-on.css +++ /dev/null @@ -1,6 +0,0 @@ -/* - This css file is for individual users to restyle items for their personal site, - or for the implementation of features specifically for their site. Anything that - is an official part of the theme (ex. Pull Requests) should be included in main.css - and follow the formatting and style given. -*/ diff --git a/static/js/add-on.js b/static/js/add-on.js deleted file mode 100644 index da67d15c..00000000 --- a/static/js/add-on.js +++ /dev/null @@ -1,6 +0,0 @@ -/* - This js file is for individual users to modify the scripts for their personal site, - or for the implementation of features specifically for their site. Anything that - is an official part of the theme (ex. Pull Requests) should be included in main.js - and follow the formatting and style given. -*/