From 1a5d054f50ca342a25a647000301c4970d9b60c7 Mon Sep 17 00:00:00 2001 From: Matt Spencer Date: Tue, 8 Feb 2022 12:39:02 +0000 Subject: [PATCH 1/2] Add community menu item Refactor header partial to use menu_item partial. Add links for gitlab and slack Signed-off-by: Matt Spencer --- config.toml | 16 ++++++++++ themes/soafee/layouts/partials/header.html | 30 ++++++++++++++----- themes/soafee/layouts/partials/menu_item.html | 13 ++++++++ 3 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 themes/soafee/layouts/partials/menu_item.html diff --git a/config.toml b/config.toml index 1c2eb90..05aafe8 100644 --- a/config.toml +++ b/config.toml @@ -32,6 +32,7 @@ googleAnalytics = "GTM-WLHTXFF" privacyEnhanced = false +[menu] [[menu.main]] name = "Home" pre = "home" @@ -42,3 +43,18 @@ googleAnalytics = "GTM-WLHTXFF" pre = "blog" pageref = "/blog" weight = 2 + +[[menu.main]] + identifier = "community" + name = "Community" + weight = 3 +[[menu.main]] + identifier = "gitlab" + parent = "community" + name = "Gitlab" + url = "https://gitlab.arm.com/soafee" +[[menu.main]] + identifier = "slack" + parent = "community" + name = "Slack" + url = "https://join.slack.com/t/soafee/shared_invite/zt-12e17668h-DttNpOtyFNi5H1udojYmtg" diff --git a/themes/soafee/layouts/partials/header.html b/themes/soafee/layouts/partials/header.html index e7ec970..e899d47 100644 --- a/themes/soafee/layouts/partials/header.html +++ b/themes/soafee/layouts/partials/header.html @@ -11,15 +11,29 @@ diff --git a/themes/soafee/layouts/partials/menu_item.html b/themes/soafee/layouts/partials/menu_item.html new file mode 100644 index 0000000..1127904 --- /dev/null +++ b/themes/soafee/layouts/partials/menu_item.html @@ -0,0 +1,13 @@ +{{ $currentPage := .currentPage | default . }} +{{ $ctx := .ctx | default . }} + +{{ $is := $currentPage.IsMenuCurrent "main" $ctx }} +{{ $has := $currentPage.HasMenuCurrent "main" $ctx }} + +
  • + +{{- $text := print $ctx.Name | safeHTML -}} +{{- $text -}} + +
  • -- GitLab From 917d0d8b5ba0421d52c8738f318390829c427597 Mon Sep 17 00:00:00 2001 From: Matt Spencer Date: Tue, 8 Feb 2022 15:38:06 +0000 Subject: [PATCH 2/2] Revert some redundant changes Signed-off-by: Matt Spencer --- config.toml | 1 - themes/soafee/layouts/partials/menu_item.html | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/config.toml b/config.toml index 05aafe8..0d7e4b8 100644 --- a/config.toml +++ b/config.toml @@ -32,7 +32,6 @@ googleAnalytics = "GTM-WLHTXFF" privacyEnhanced = false -[menu] [[menu.main]] name = "Home" pre = "home" diff --git a/themes/soafee/layouts/partials/menu_item.html b/themes/soafee/layouts/partials/menu_item.html index 1127904..a31da83 100644 --- a/themes/soafee/layouts/partials/menu_item.html +++ b/themes/soafee/layouts/partials/menu_item.html @@ -4,7 +4,7 @@ {{ $is := $currentPage.IsMenuCurrent "main" $ctx }} {{ $has := $currentPage.HasMenuCurrent "main" $ctx }} -
  • +
  • {{- $text := print $ctx.Name | safeHTML -}} -- GitLab