Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/index.html4
-rw-r--r--layouts/partials/blogsection.html2
-rw-r--r--layouts/partials/nav.html9
-rw-r--r--layouts/partials/projects.html2
4 files changed, 8 insertions, 9 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 9af0899..3b8faaf 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -36,7 +36,7 @@
<!-- Tell them all about it! -->
{{ with .Site.GetPage "page" "about" }}
-<div class="section" id="about">
+<div class="section" id="{{ .Title | urlize }}">
<div class="container">
<h2 class="title is-2 has-text-centered">{{ .Title }}</h2>
<div class="columns"><!-- Avatar and about.md side by side except mobile -->
@@ -66,7 +66,7 @@
<!-- Let's chat, shall we? -->
{{ with .Site.GetPage "page" "contact" }}
-<div class="section" id="contact">
+<div class="section" id="{{ .Title | urlize }}">
<div class="container has-text-centered">
<h2 class="title is-2">{{ .Title }}</h2>
<div class="markdown">
diff --git a/layouts/partials/blogsection.html b/layouts/partials/blogsection.html
index bec7529..bb323c9 100644
--- a/layouts/partials/blogsection.html
+++ b/layouts/partials/blogsection.html
@@ -1,5 +1,5 @@
{{ with .Site.GetPage "section" "blog" }}
-<div class="section" id="blog">
+<div class="section" id="{{ .Title | urlize }}">
<!-- Begin Blog container -->
<div class="container">
{{ if .Site.Params.showLatest }}
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 82981a2..e6cf4c9 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -14,16 +14,15 @@
{{ if not $isHome }}
<a class="nav-item" href="{{ "/" | relLangURL }}">{{ i18n "nav_main" . }}</a>
{{ end }}
-
{{ with .Site.GetPage "page" "about" }}
- <a class="nav-item" href="{{ if $isHome }}#about{{ else }}{{ "/#about" | relLangURL }}{{ end }}">{{ .Title }}</a>
+ <a class="nav-item" href="{{ if $isHome }}#{{ .Title | urlize }}{{ else }}{{ printf "/#%s" (.Title | urlize) | relLangURL }}{{ end }}">{{ .Title }}</a>
{{ end }}
{{ $pageIsInProjects := eq .Page.Section "projects"}}
{{ if not (and $pageIsInProjects (eq .Page.Kind "section")) }}
{{ with .Site.GetPage "section" "projects" }}
{{ if $isHome }}
- <a class="nav-item" href="#projects">{{ .Title }}</a>
+ <a class="nav-item" href="#{{ .Title | urlize }}">{{ .Title }}</a>
{{ else }}
<a class="nav-item" href="{{ .RelPermalink }}">
{{ if $pageIsInProjects }}
@@ -40,7 +39,7 @@
{{ if not (and $pageIsInBlog (eq .Page.Kind "section")) }}
{{ with .Site.GetPage "section" "blog" }}
{{ if $isHome }}
- <a class="nav-item" href="#blog">{{ .Title }}</a>
+ <a class="nav-item" href="#{{ .Title | urlize }}">{{ .Title }}</a>
{{ else }}
<a class="nav-item" href="{{ .RelPermalink }}">
{{ if $pageIsInBlog }}
@@ -54,7 +53,7 @@
{{ end }}
{{ with .Site.GetPage "page" "contact" }}
- <a class="nav-item" href="{{ if $isHome }}#contact{{ else }}{{ "/#contact" | relLangURL }}{{ end }}">{{ .Title }}</a>
+ <a class="nav-item" href="{{ if $isHome }}#{{ .Title | urlize }}{{ else }}{{ printf "/#%s" (.Title | urlize) | relLangURL }}{{ end }}">{{ .Title }}</a>
{{ end }}
{{ range $.Site.Home.AllTranslations.ByWeight }}
diff --git a/layouts/partials/projects.html b/layouts/partials/projects.html
index 8e417b2..cd8e18b 100644
--- a/layouts/partials/projects.html
+++ b/layouts/partials/projects.html
@@ -1,5 +1,5 @@
{{ with .Site.GetPage "section" "projects" }}
-<div class="section" id="projects">
+<div class="section" id="{{ .Title | urlize }}">
<!-- Begin Projects container -->
<div class="container">
<h2 class="title is-2 has-text-centered">