Fix note organization

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
hossainemruz 2021-03-26 03:30:06 +06:00
parent beea892a20
commit 80f5672f34
10 changed files with 99 additions and 26 deletions

View file

@ -1,5 +1,7 @@
---
title: "Search Results"
date: 2010-06-08T08:06:25+06:00
weight: 999999
sitemap:
priority : 0.1
layout: "search"

View file

@ -8,9 +8,9 @@
{{ end }}
{{ define "sidebar" }}
{{ $blogHome:="#" }}
{{ $homePage:="#" }}
{{ if site.IsMultiLingual }}
{{ $blogHome = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ $homePage = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ end }}
<section class="sidebar-section" id="sidebar-section">
@ -38,7 +38,11 @@
<div class="container-fluid post-card-holder" id="post-card-holder">
{{ $paginator := .Paginate .RegularPagesRecursive 12 }}
{{ range $paginator.Pages }}
{{ partial "cards/post.html" . }}
{{ if .Layout }}
{{/* ignore the search.md file*/}}
{{ else }}
{{ partial "cards/post.html" . }}
{{ end }}
{{ end }}
</div>
<div class="paginator">

View file

@ -8,9 +8,9 @@
{{ end }}
{{ define "sidebar" }}
{{ $blogHome:="#" }}
{{ $homePage:="#" }}
{{ if site.IsMultiLingual }}
{{ $blogHome = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ $homePage = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ end }}
<section class="sidebar-section" id="sidebar-section">

View file

@ -12,9 +12,9 @@
{{ end }}
{{ define "sidebar" }}
{{ $blogHome:="#" }}
{{ $homePage:="#" }}
{{ if site.IsMultiLingual }}
{{ $blogHome = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ $homePage = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ end }}
<section class="sidebar-section" id="sidebar-section">
@ -40,12 +40,10 @@
<section class="content-section" id="content-section">
<div class="content container-fluid" id="content">
<div class="container-fluid note-card-holder" id="note-card-holder">
{{ range .RegularPagesRecursive }}
{{ if .Layout }}
{{ else }}
{{ .Content }}
{{ end }}
{{ end }}
{{ partial "note-aggregator.html" . }}
</div>
<div class="paginator">
{{ template "_internal/pagination.html" . }}
</div>
</div>
</section>

View file

@ -12,9 +12,9 @@
{{ end }}
{{ define "sidebar" }}
{{ $blogHome:="#" }}
{{ $homePage:="#" }}
{{ if site.IsMultiLingual }}
{{ $blogHome = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ $homePage = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ end }}
<section class="sidebar-section" id="sidebar-section">
@ -40,12 +40,9 @@
<section class="content-section" id="content-section">
<div class="content container-fluid" id="content">
<div class="container-fluid note-card-holder" id="note-card-holder">
{{ range .RegularPagesRecursive }}
{{ if .Layout }}
{{ else }}
{{ .Content }}
{{ end }}
{{ end }}
<div class="note-collection">
{{ .Content }}
</div>
</div>
</div>
</section>

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>

View file

@ -1,5 +1,7 @@
<div class="card note-card">
<div class="card-header">{{.Get "title"}}</div>
<div class="card note-card {{if .Get "size" }}{{.Get "size"}}-note{{end}}">
<div class="card-header" style="background-color: {{ site.Params.notes.headerBackground | default "transparent" }};">
<span class="note-title" style="color: {{ site.Params.notes.headerTextColor | default "#1c2d41" }};">{{.Get "title"}}</span>
</div>
<div class="card-body">{{ .Inner | markdownify }}</div>
{{ if .Get "footer" }}
<div class="card-footer">{{ .Get "footer" }}</div>

View file

@ -178,6 +178,24 @@ pre > code {
}
/* ======= Paginator ========= */
.paginator {
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
margin: auto;
vertical-align: bottom;
}
.paginator .page-item > a {
color: #248aaa;
}
.paginator .page-item.active > a {
background-color: #248aaa;
color: #f9fafc;
}
/* --- FOOTER START --- */
.footer {

View file

@ -22,13 +22,47 @@
min-height: 130vh;
}
.note-card-holder {
.note-card-holder{
padding-top: 2rem;
}
.note-collection {
display: flex;
flex-wrap: wrap;
padding-top: 2rem;
}
.note-card {
margin: 1rem;
align-self: flex-start;
}
.note-title{
font-weight: 800;
}
.note-card .card-body{
padding: 1rem;
}
.note-card pre {
margin: 0;
border-radius: 3px;
}
.small-note{
max-width: 15rem;
}
.medium-note{
max-width: 25rem;
}
.large-note{
max-width: 40rem;
}
.huge-note{}
.note-badge{
font-size: 10pt;
}