From 8cd7e8d6724dcc25bd3c8313374956da2bc19054 Mon Sep 17 00:00:00 2001 From: Dillon Date: Tue, 4 Feb 2020 02:19:05 +0800 Subject: [PATCH] feat(menu): add menu pre --- exampleSite/config.toml | 4 +++- exampleSite/zh/config.toml | 4 +++- layouts/partials/header.html | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 428ac2a..91fcfcc 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -97,7 +97,9 @@ dateFormatToUse = "2006-01-02" [[menu.main]] identifier = "zh" - name = '' + pre = '' + name = "" + title = "简体中文" url = "https://hugo-loveit-zh.netlify.com" weight = 5 diff --git a/exampleSite/zh/config.toml b/exampleSite/zh/config.toml index b2c9c72..701b502 100644 --- a/exampleSite/zh/config.toml +++ b/exampleSite/zh/config.toml @@ -97,7 +97,9 @@ dateFormatToUse = "2006-01-02" [[menu.main]] identifier = "en" - name = '' + pre = '' + name = "" + title = "English" url = "https://hugo-loveit-en.netlify.com" weight = 5 diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 85edada..1dd2a29 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -10,7 +10,7 @@ {{- $currentPage := . }} {{- range .Site.Menus.main -}} - {{- .Name | safeHTML -}} + {{- .Pre | safeHTML }}{{ .Name -}} {{- end -}}