Add notes layout (#263)

* Add note layout

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

* Fix note organization

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

* WIP: need help adding above 6 sections doesnt fit navbar

* Add note layout

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

* Add Translation

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

Co-authored-by: HenzelMoras <henzelmoras@gmail.com>
This commit is contained in:
Emruz Hossain 2021-03-28 01:52:18 +06:00 committed by GitHub
parent 5c95132b1e
commit 25e4e9e3d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 519 additions and 30 deletions

View file

@ -1,8 +1,8 @@
{{ range .menus }}
{{ range .menuItems }}
{{ $class:= "" }}
{{ $icon:= "fa-plus-circle" }}
<!-- If the current menu is the selected menu or it contain the selected menu, set expand icon and set "active" class -->
{{ if or ($.ctx.HasMenuCurrent "sidebar" .) ($.ctx.IsMenuCurrent "sidebar" .)}}
{{ if or ($.ctx.HasMenuCurrent $.menuName .) ($.ctx.IsMenuCurrent $.menuName .)}}
{{ $icon = "fa-minus-circle"}}
{{ $class = "active" }}
{{end}}
@ -12,7 +12,7 @@
<i class="fas {{ $icon }}"></i><a class="{{$class}}" href="{{ .URL }}">{{.Name}}</a>
<!-- Add sub-tree -->
<ul class="{{ $class }}">
{{ partial "navigators/sidebar.html" (dict "menus" .Children "ctx" $.ctx) }}
{{ partial "navigators/sidebar.html" (dict "menuName" $.menuName "menuItems" .Children "ctx" $.ctx) }}
</ul>
</li>
{{ else }}

View file

@ -0,0 +1,18 @@
{{ $paginator := .Paginate .RegularPagesRecursive 10 }}
{{ range $paginator.Pages }}
{{ if .Layout }}
{{/* ignore search.md file*/}}
{{ else }}
{{$id := .Params.Menu.Notes.Identifier }}
<h4 class="note-collection-title" id="{{ $id }}">
<a href="#{{ $id }}"># {{ .Title }}</a>
{{$badges:= split .File.Dir "/"}}
{{ range after 1 $badges }}
<span class="badge btn-info note-badge">{{ . }}</span>
{{ end }}
</h4>
<div class="note-collection">
{{ .Content }}
</div>
{{ end }}
{{ end }}

View file

@ -9,7 +9,7 @@
{{ end }}
<div class="container">
<div class="row" id="recent-post-cards">
{{ range first 3 (where site.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections )}}
{{ range first 3 (where site.RegularPages.ByDate.Reverse "Type" "in" "posts" )}}
{{ partial "cards/recent-post.html" . }}
{{ end }}
</div>