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

github.com/jsnjack/kraiklyn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYauhen Shulitski <jsnjack@gmail.com>2021-08-02 15:06:27 +0300
committerGitHub <noreply@github.com>2021-08-02 15:06:27 +0300
commita2f56a7af778fcdda5939de14bcf8a4a6cd88291 (patch)
treeefc5fc7c8b717761abf60a1f5ec20098ee7a7943
parentf15a26bc6009d15228a034620d1fbd90b09e8143 (diff)
parent73054cd900f46b765dab3ae10071955c47eb6ab6 (diff)
Merge pull request #15 from fangqiuhang/fix_mixed_pages_sectionsHEADmaster
Fix mixed pages and sections render
-rw-r--r--layouts/partials/menu_page_list.html16
-rw-r--r--layouts/partials/section_list.html14
2 files changed, 10 insertions, 20 deletions
diff --git a/layouts/partials/menu_page_list.html b/layouts/partials/menu_page_list.html
index cadc184..d166c4e 100644
--- a/layouts/partials/menu_page_list.html
+++ b/layouts/partials/menu_page_list.html
@@ -1,21 +1,15 @@
-{{ if .Pages }}
<li>
<a href="#{{ .Params.anchor }}">{{ .Title }}</a>
+{{ if .Pages }}
<ul>
- {{ if .Sections }}
- {{ range .Sections.ByWeight }}
+ {{ range .Pages.ByWeight }}
+ {{ if .IsSection }}
{{ partial "menu_page_list.html" . }}
- {{ end }}
- {{ else }}
- {{ range .Pages.ByWeight }}
+ {{ else }}
<li><a href="#{{ .Params.anchor }}">{{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>
- </li>
-{{ else }}
- <li>
- <a href="#{{ .Params.anchor }}">{{ .Title }}</a>
- </li>
{{ end }}
+ </li>
diff --git a/layouts/partials/section_list.html b/layouts/partials/section_list.html
index ff78f48..61851aa 100644
--- a/layouts/partials/section_list.html
+++ b/layouts/partials/section_list.html
@@ -1,15 +1,11 @@
-{{ if .Pages }}
{{ partial "section.html" . }}
- {{ if .Sections }}
- {{ range .Sections.ByWeight }}
+{{ if .Pages }}
+ {{ range .Pages.ByWeight }}
+ {{ if .IsSection }}
{{ partial "section_list.html" . }}
+ {{ else }}
+ {{ partial "section.html" . }}
{{ end }}
- {{ else }}
- {{ range .Pages.ByWeight }}
- {{ partial "section.html" . }}
- {{ end }}
{{ end }}
-{{ else }}
- {{ partial "section.html" . }}
{{ end }}