Fix note layout (#274)

* Re-structure note lists

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Support note splitting

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Update single page

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Refactor separator logic in navbar

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
Emruz Hossain 2021-05-02 05:02:27 +06:00 committed by GitHub
parent fc5656c937
commit 67c49c7432
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 127 additions and 45 deletions

View file

@ -1,3 +1,12 @@
{{/* variables for enabling/disabling various features */}}
{{ $blogEnabled := site.Params.features.blog.enable | default false }}
{{ $notesEnabled := site.Params.features.notes.enable | default false }}
{{/* keep backward compatibility for blog post */}}
{{ if site.Params.enableBlogPost }}
{{ $blogEnabled = true }}
{{ end }}
{{/* default logos */}}
{{ $mainLogo := "/images/main-logo.png" }}
{{ $invertedLogo := "/images/inverted-logo.png" }}
@ -84,20 +93,20 @@
</li>
{{ end }}
{{- end }}
{{ $hasCustomMenus:= false }}
{{ if $customMenus }}
{{ if gt (len $customMenus) 0 }}
{{ $hasCustomMenus = true }}
{{ end }}
{{ end }}
{{ if (or site.Params.enableBlogPost $hasCustomMenus) }}
{{ $shouldAddSeparator:= partial "helpers/add-navbar-separator.html" . }}
{{ if $shouldAddSeparator }}
<div class="dropdown-divider" id="top-navbar-divider"></div>
{{ end }}
{{ if site.Params.enableBlogPost }}
{{ if $blogEnabled }}
<li class="nav-item">
<a class="nav-link" id="blog-link" href="{{ "/posts" | relLangURL }}">{{ i18n "posts" }}</a>
</li>
{{ end }}
{{ if $notesEnabled }}
<li class="nav-item">
<a class="nav-link" id="note-link" href="{{ "/notes" | relLangURL }}">{{ i18n "notes" }}</a>
</li>
{{ end }}
{{ range $customMenus }}
<li class="nav-item">
<a class="nav-link" href="{{ .url }}">{{ .name }}</a>