update notes page

This commit is contained in:
yequari 2024-09-19 18:27:07 -07:00
parent ec87e4ab7d
commit d7077c187d
2 changed files with 22 additions and 53 deletions

View File

@ -1,26 +1,23 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
<section class="content posts h-feed hfeed notes-list">
{{ $taxonomy := "tags" }}
{{ $section := "notes" }}
{{ range $term, $weightedPages := index site.Taxonomies $taxonomy }}
{{ $termPage := site.GetPage (printf "%s/%s" $taxonomy $term) }}
{{ $termPages := where $weightedPages "Page.Section" $section }}
{{ $amount := $termPages.Len }}
{{ if gt $amount 0 }}
<section class="notes-tag">
<h2>{{ $termPage.LinkTitle }}</h2>
<ul>
{{ range sort $termPages "Page.Title" }}
<li>
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</li>
{{ end }}
</ul>
</section>
<section class="content posts h-feed hfeed">
<ul>
<li class="note-item"><h2>Title</h2><h2>Tags</h2></li>
{{ range (where .Site.RegularPages.ByTitle "Section" "notes") }}
<li class="note-item">
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{ $taxonomy := "tags" }}
{{ with .GetTerms $taxonomy }}
<span>
{{ range $k, $_ := . -}}
{{ if $k }}, {{ end }}
<a class="tag" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{- end }}
{{ end }}
</span>
</li>
{{ end }}
{{ end }}
</ul>
</section>
{{ end }}

View File

@ -1,30 +1,3 @@
.notes-list {
display: flex;
flex-flow: row wrap;
}
.notes-tag {
flex: 1 3 250px;
margin: 10px;
padding: 0 10px;
}
/**/
/* .notes-tag h2 { */
/* background: white; */
/* margin: 0; */
/* padding: 0.3rem 0.5rem; */
/* } */
/**/
.notes-tag ul {
padding-bottom: 2em;
list-style-type: disc;
margin: 0;
}
/**/
/* .notes-tag ul li { */
/* padding-top: 0.3em; */
/* } */
:root {
--avatar-width: 50px;
--avatar-padding: calc(var(--avatar-width) / 10);
@ -82,17 +55,16 @@
font-size: 1.1rem;
}
li.note-item {
display: flex;
justify-content: space-between;
}
.index-content {
grid-row: 1 / 2;
grid-column: 1 / span 6;
}
/* .index-status { */
/* margin-top: -15vh; */
/* grid-row: 1 / 2; */
/* grid-column: 1 / 2; */
/* } */
.index-social {
grid-row: 2 / 3;
grid-column: 9 / span 2;