From 09b4084830e1ab9e3321e03c2332572a0d113f6b Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Wed, 14 Apr 2021 11:19:13 +0200 Subject: [PATCH] added support for menu.main and migrated old links array array to menu.icons --- README.md | 39 +++++++++++++++++++----- assets/scss/style.scss | 1 + layouts/partials/header.html | 8 ++++- layouts/partials/iconlink.html | 54 ++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 8 deletions(-) create mode 100644 layouts/partials/iconlink.html diff --git a/README.md b/README.md index 65a15f1..bc95f52 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ summaryLength = 70 # number of words for article summaries favicon = "/images/myfavicon.png" showTags = true # show the Tags menu item; default true showRss = true # show the link for the RSS feed; default true - + imageInArticlePreview = false # show images in article preview; default false navtype = "standard" # changes the style of the pagination, available styles are: "standard", "circle" @@ -72,12 +72,15 @@ summaryLength = 70 # number of words for article summaries # telegram # phone # rss - links = [ - ["GitLab", "https://gitlab.com/gabmus"], - ["GNOME", "https://gitlab.gnome.org/gabmus"], - ["YouTube", "https://youtube.com/TechPillsNet"], - ["Email", "mailto:gabmus@disroot.org"] - ] + + + # WARNING: deprecated! Use [[menu.icons]] instead, look below + # links = [ + # ["GitLab", "https://gitlab.com/gabmus"], + # ["GNOME", "https://gitlab.gnome.org/gabmus"], + # ["YouTube", "https://youtube.com/TechPillsNet"], + # ["Email", "mailto:gabmus@disroot.org"] + # ] # you can customize all of the colors in this theme # the values shown are the defaults @@ -94,6 +97,28 @@ summaryLength = 70 # number of words for article summaries infiniteScrolling = false # activates infinite scrolling instead of regular pagination +[menu] + # these links will be added to the main navigation menu, sorted by weight + # other elements in this menu are added automatically from the "pages" folder + # the folder it will look into can be customized with the pages variable + # in params above + [[menu.main]] + identifier = "about" + name = "About" + url = "/about/" + weight = 10 + # these links (menu.icons) will be added as icon links below the main nav + [[menu.icons]] + identifier = "gitlab" + name = "GitLab" + url = "https://gitlab.com/gabmus" + weight = 10 + [[menu.icons]] + identifier = "gnome" + name = "GNOME GitLab" + url = "https://gitlab.gnome.org/gabmus" + weight = 20 + # this section is necessary if you want infinite scrolling # it allows to output the article list as paged JSON so that "pages" can be retrieved via javascript [outputs] diff --git a/assets/scss/style.scss b/assets/scss/style.scss index ccb0744..d880121 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -226,6 +226,7 @@ h1, h2, h3, h4, h5, h6 { border-radius: 3px; color: $fg_color; display: none; + background-color: $bg_color; } &:hover { .pseudofont { diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 80a2657..1af203a 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -14,6 +14,9 @@ {{ range $pagesList }}
  • {{ .Title }}
  • {{ end }} + {{ range .Site.Menus.main }} +
  • {{ .Name }}
  • + {{ end }} {{ if (.Site.Params.showTags | default true) }}
  • Tags
  • {{ end }} @@ -30,11 +33,14 @@ {{- partial "inject/header-after.html" . -}} diff --git a/layouts/partials/iconlink.html b/layouts/partials/iconlink.html new file mode 100644 index 0000000..c463a4c --- /dev/null +++ b/layouts/partials/iconlink.html @@ -0,0 +1,54 @@ +{{ $id := (lower .Identifier) }} + + {{ if eq $id "gitlab" }} +  + {{ else if eq $id "gnome" }} +  + {{ else if eq $id "youtube" }} +  + {{ else if eq $id "email" }} +  + {{ else if eq $id "twitter" }} +  + {{ else if eq $id "instagram" }} +  + {{ else if eq $id "facebook" }} +  + {{ else if eq $id "github" }} +  + {{ else if eq $id "linkedin" }} +  + {{ else if eq $id "telegram" }} +  + {{ else if eq $id "xmpp" }} + ﳽ + {{ else if eq $id "pleroma" }} + + + + {{ else if eq $id "peertube" }} + + + + {{ else if eq $id "matrix" }} + + + + {{ else if eq $id "mastodon" }} + + + + {{ else if eq $id "phone" }} +  + {{ else if eq $id "rss" }} +  + {{ else }} + {{ .Name }} + {{ end }} + + {{ .Name }} + +