mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-13 01:57:28 -05:00
Clean up CSS
- Add vim folds to make organized sections - Rename a lot of classes from post- to page- - Generalize series CSS classes better - Clean up navbar div structure - Remove langpicker and most of multilingual support - many other minor tweaks
This commit is contained in:
17
layouts/partials/page-metadata/author.html
Normal file
17
layouts/partials/page-metadata/author.html
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="page-metadata" aria-label="{{ i18n "aria_author_metadata" }}">
|
||||
{{/* Calculate the total word count */}}
|
||||
{{ $total_words := 0 }}
|
||||
{{ range .Data.Pages }}
|
||||
{{ $total_words = add $total_words .WordCount }}
|
||||
{{ end }}
|
||||
|
||||
<span class="page-metadata-item" aria-label="{{ i18n "aria_author_post_count" }}">
|
||||
{{ partial "icon.html" "newspaper" }}
|
||||
{{ i18n "post_count" (len .Data.Pages) }}
|
||||
</span>
|
||||
|
||||
<span class="page-metadata-item" aria-label="{{ i18n "aria_author_word_count" }}">
|
||||
{{ partial "icon.html" "align-left" }}
|
||||
{{ i18n "wordcount" $total_words }}
|
||||
</span>
|
||||
</div>
|
16
layouts/partials/page-metadata/item/authors.html
Normal file
16
layouts/partials/page-metadata/item/authors.html
Normal file
@ -0,0 +1,16 @@
|
||||
{{ with .Params.authors }}
|
||||
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_authors" }}">
|
||||
{{ partial "icon.html" "user-circle" }}
|
||||
|
||||
{{ if index $.Site.Taxonomies "authors" }}
|
||||
{{ $authors := slice }}
|
||||
{{ range . }}
|
||||
{{ $url := (printf "authors/%s" (. | anchorize)) | absLangURL }}
|
||||
{{ $authors = $authors | append (printf `<a href="%s">%s</a>` $url . | safeHTML) }}
|
||||
{{ end }}
|
||||
{{ delimit $authors ", " }}
|
||||
{{ else }}
|
||||
{{ delimit . ", " }}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
11
layouts/partials/page-metadata/item/categories.html
Normal file
11
layouts/partials/page-metadata/item/categories.html
Normal file
@ -0,0 +1,11 @@
|
||||
{{ with (.GetTerms "categories") }}
|
||||
{{ $categories := slice }}
|
||||
{{ range . }}
|
||||
{{ $categories = $categories | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||
{{ end }}
|
||||
|
||||
<div class="page-metadata-section categories" aria-label="{{ i18n "aria_post_meta_categories" }}">
|
||||
{{ partial "icon.html" "folder" }}
|
||||
{{ delimit $categories ", " }}
|
||||
</div>
|
||||
{{ end }}
|
8
layouts/partials/page-metadata/item/edithistory.html
Normal file
8
layouts/partials/page-metadata/item/edithistory.html
Normal file
@ -0,0 +1,8 @@
|
||||
{{ if and .Site.Params.gitHistoryURL .File.Path }}
|
||||
<span class="page-metadata-item post-meta-edit-history" aria-label="{{ i18n "aria_post_meta_edit_history" }}">
|
||||
{{ partial "icon.html" "history" }}
|
||||
<a href="{{ printf "%s/content/%s" .Site.Params.gitHistoryURL .File.Path }}" target="_blank" rel="noopener">
|
||||
{{- i18n "edit_history" -}}
|
||||
</a>
|
||||
</span>
|
||||
{{ end }}
|
6
layouts/partials/page-metadata/item/readingtime.html
Normal file
6
layouts/partials/page-metadata/item/readingtime.html
Normal file
@ -0,0 +1,6 @@
|
||||
{{ if ne .Site.Params.readingtime false }}
|
||||
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_reading_time" }}">
|
||||
{{ partial "icon.html" "clock" }}
|
||||
{{ i18n "readingtime" .ReadingTime }}
|
||||
</span>
|
||||
{{ end }}
|
11
layouts/partials/page-metadata/item/series.html
Normal file
11
layouts/partials/page-metadata/item/series.html
Normal file
@ -0,0 +1,11 @@
|
||||
{{ with (.GetTerms "series") }}
|
||||
{{ $series := slice }}
|
||||
{{ range . }}
|
||||
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||
{{ end }}
|
||||
|
||||
<div class="page-metadata-section series" aria-label="{{ i18n "aria_post_meta_series" }}">
|
||||
{{ partial "icon.html" "files" }}
|
||||
{{ delimit $series ", " }}
|
||||
</div>
|
||||
{{ end }}
|
11
layouts/partials/page-metadata/item/tags.html
Normal file
11
layouts/partials/page-metadata/item/tags.html
Normal file
@ -0,0 +1,11 @@
|
||||
{{ with (.GetTerms "tags") }}
|
||||
{{ $tags := slice }}
|
||||
{{ range . }}
|
||||
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||
{{ end }}
|
||||
|
||||
<div class="page-metadata-section tags" aria-label="{{ i18n "aria_post_meta_tags" }}">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
{{ delimit $tags ", " }}
|
||||
</div>
|
||||
{{ end }}
|
30
layouts/partials/page-metadata/post-full.html
Normal file
30
layouts/partials/page-metadata/post-full.html
Normal file
@ -0,0 +1,30 @@
|
||||
{{ if or .Date .Params.authors .Site.Params.readingtime .Site.Params.gitFileURL }}
|
||||
<div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
|
||||
{{ if .Date }}
|
||||
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_date" }}">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
|
||||
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
|
||||
</time>
|
||||
</span>
|
||||
|
||||
{{/* TODO: make this be a tooltip */}}
|
||||
{{/* DISABLED
|
||||
{{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }}
|
||||
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_modified_date" }}">
|
||||
{{ partial "icon.html" "pencil" }}
|
||||
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
|
||||
{{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }}
|
||||
</time>
|
||||
{{ end }}
|
||||
</span>
|
||||
*/}}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "page-metadata/item/authors.html" . }}
|
||||
{{ partial "page-metadata/item/readingtime.html" . }}
|
||||
{{ partial "page-metadata/item/edithistory.html" . }}
|
||||
{{ partial "page-metadata/item/categories.html" . }}
|
||||
{{ partial "page-metadata/item/tags.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
18
layouts/partials/page-metadata/post-short.html
Normal file
18
layouts/partials/page-metadata/post-short.html
Normal file
@ -0,0 +1,18 @@
|
||||
{{ if or .Date .Params.authors .Site.Params.readingtime }}
|
||||
<div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
|
||||
{{ if .Date }}
|
||||
<span class="page-metadata-item" aria-label="date">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
|
||||
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
|
||||
</time>
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "page-metadata/item/authors.html" . }}
|
||||
{{ partial "page-metadata/item/readingtime.html" . }}
|
||||
{{ partial "page-metadata/item/series.html" . }}
|
||||
{{ partial "page-metadata/item/categories.html" . }}
|
||||
{{ partial "page-metadata/item/tags.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
17
layouts/partials/page-metadata/series.html
Normal file
17
layouts/partials/page-metadata/series.html
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="page-metadata" aria-label="{{ i18n "aria_series_metadata" }}">
|
||||
<span class="page-metadata-item">
|
||||
{{ partial "icon.html" "newspaper" }}
|
||||
{{ i18n "post_count" (len .Data.Pages) }}
|
||||
</span>
|
||||
|
||||
{{ if ne .Site.Params.readingtime false }}
|
||||
<span class="page-metadata-item">
|
||||
{{ partial "icon.html" "clock" }}
|
||||
{{ $readingtime := 0 }}
|
||||
{{ range .Data.Pages }}
|
||||
{{ $readingtime = (add $readingtime .ReadingTime) }}
|
||||
{{ end }}
|
||||
{{ i18n "readingtime" $readingtime }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
6
layouts/partials/page-metadata/taxonomy.html
Normal file
6
layouts/partials/page-metadata/taxonomy.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="taxonomy-metadata" aria-label="{{ i18n "aria_taxonomy_metadata" }}">
|
||||
<span class="taxonomy-meta-item" aria-label="{{ i18n "aria_taxonomy_post_count" }}">
|
||||
{{ partial "icon.html" "newspaper" }}
|
||||
{{ i18n "post_count" (len .Data.Pages) }}
|
||||
</span>
|
||||
</div>
|
Reference in New Issue
Block a user