Gui fixes
This commit is contained in:
@@ -9,7 +9,7 @@ defaultColor:
|
||||
# Setting it to 'auto' applies the color scheme based on the visitor's device color preference.If you don't specify anything, ignore this parameter, or leave it blank,
|
||||
# the default value is set to 'auto'.
|
||||
# You can take a look at layouts/index.html for more information.
|
||||
mainSections: ["post", "photos", "micro"]
|
||||
mainSections: ["post", "photos"]
|
||||
feedSections: ["post", "photos", "micro"]
|
||||
commentSections: ["post", "photos", "micro"]
|
||||
suggestionSections: ["post"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<h{{ .Level }} id="{{ .Anchor }}" class="no-underline ">
|
||||
<a href="#{{ .Anchor }}">
|
||||
{{ range seq (add .Level -1) }}<i class="fa-light fa-cup-togo"></i>{{ end }}
|
||||
{{ range seq (add .Level -1) }}<i class="fa-regular fa-hashtag"></i>{{ end }}
|
||||
{{ .Text | safeHTML }}
|
||||
</a>
|
||||
</h{{ .Level }}>
|
||||
|
||||
@@ -5,16 +5,22 @@
|
||||
<header class="header">
|
||||
<h1 class="header-title p-name">{{ .Title }}</h1>
|
||||
|
||||
<div class="post-meta">
|
||||
<div style="display: none;" class="p-summary ">{{ .Description }}</div>
|
||||
<a class="u-url" href="{{ .Permalink }}">
|
||||
<div>
|
||||
<a class="u-url" href="{{ .Permalink }}"><div style="display: none;" class="p-summary">{{ .Description }}</div></a>
|
||||
<a rel="author" class="p-author h-card no-underline " href="{{ .Site.BaseURL }}" style="display: none;" >{{ .Site.Params.Author.name }}</a>
|
||||
|
||||
<i class="fa-duotone fa-solid fa-typewriter"></i> {{.Site.Params.Author.name }} |
|
||||
{{ $configDateFormat := .Site.Params.dateFormat | default ":date_medium" }}
|
||||
{{ with .Date }}
|
||||
{{ $ISO_time := dateFormat "2006-01-02T15:04:05-07:00" . }}
|
||||
<time datetime="{{ $ISO_time }}" class="dt-published" itemprop="datePublished"> {{ . | time.Format $configDateFormat }} </time>
|
||||
<i class="fa-regular fa-calendar-range"></i>
|
||||
<time datetime="{{ $ISO_time }}" class="dt-published" itemprop="datePublished">
|
||||
{{ . | time.Format $configDateFormat }}
|
||||
</time> |
|
||||
{{ end }}
|
||||
by {{ with .Site.Params.Hcard.Avatar }}<img class="u-photo" alt="" style=" display: none;" src="{{ . | absURL }}"> {{ end }}<a class="p-author h-card" rel="author" href="{{ .Site.BaseURL }}">{{ $.Site.Params.Hcard.FullName }}</a>
|
||||
</a>
|
||||
<i class="fa-duotone fa-mug-tea"></i> Reading time {{.ReadingTime}} minutes |
|
||||
<i class="fa-duotone fa-pen-nib"></i> Word count {{.WordCount}}
|
||||
|
||||
</div>
|
||||
<br>
|
||||
{{ $image := .Resources.GetMatch "{cover.webp,cover.jpg,cover.png,cover.jpeg}" }}
|
||||
|
||||
41
layouts/index.html
Normal file
41
layouts/index.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
{{- $defaultColor := .Site.Params.defaultColor | default "auto" -}}
|
||||
|
||||
{{/* allow website developer to enforce default dark mode */}}
|
||||
{{- if eq $defaultColor "dark" -}}
|
||||
<html lang="{{ .Site.LanguageCode }}" class="dark">
|
||||
{{- else if eq $defaultColor "light" -}}
|
||||
<html lang="{{ .Site.LanguageCode }}" class="light">
|
||||
{{- else -}}
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
{{- end -}}
|
||||
|
||||
{{- partial "head.html" . -}}
|
||||
|
||||
<body data-theme="{{ $defaultColor }}" class="notransition">
|
||||
{{- partial "scriptsBodyStart.html" . -}}
|
||||
{{- partial "header.html" . -}}
|
||||
<div class="wrapper">
|
||||
{{ partial "bio" . }}
|
||||
<main aria-label="Content">
|
||||
<h3 class="posts-item-note" aria-label="Recent Posts">{{ T "home.recent_posts" }}</h3>
|
||||
{{/* Show last 10 posts in reverse date order */}}
|
||||
{{ $pagesToShow := where .Site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||
{{ $posts := $pagesToShow.ByDate.Reverse }}
|
||||
{{ range first 10 $posts }}
|
||||
{{ partial "postCard" . }}
|
||||
{{ end }}
|
||||
{{ if gt (len $posts) 5 }}
|
||||
<p>
|
||||
{{ range $firstSection := (where .Site.Sections "Section" "in" (first 1 (.Site.Params.mainSections))) }}
|
||||
<a href="{{ $firstSection.Permalink }}">{{ T "home.see_all_posts" }}</a>
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
</main>
|
||||
</div>
|
||||
{{- partial "footer.html" . -}}
|
||||
{{- partial "scriptsBodyEnd.html" . -}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
72
layouts/partials/header.html
Normal file
72
layouts/partials/header.html
Normal file
@@ -0,0 +1,72 @@
|
||||
<div class="navbar" role="navigation">
|
||||
<nav class="menu" aria-label="Main Navigation">
|
||||
<a href="{{ .Site.Home.Permalink }}" class="logo">
|
||||
<i class="fa-regular fa-bowl-chopsticks-noodles"></i>
|
||||
</a>
|
||||
<input type="checkbox" id="menu-trigger" class="menu-trigger" />
|
||||
<label for="menu-trigger">
|
||||
<span class="menu-icon">
|
||||
<i class="fa-regular fa-bars"></i>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<div class="trigger">
|
||||
<ul class="trigger-container">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<li>
|
||||
<a class="menu-link {{ if or ($currentPage.IsMenuCurrent "main" .)
|
||||
($currentPage.HasMenuCurrent "main" .) }}active{{ end }}" href="{{ .URL }}">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
{{ if .HasChildren }}
|
||||
<ul>
|
||||
{{ range .Children }}
|
||||
<li>
|
||||
<a class="menu-link {{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}"
|
||||
href="{{ .URL }}">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
<li class="menu-separator">
|
||||
<span>|</span>
|
||||
</li>
|
||||
<!-- Language List -->
|
||||
{{ if .IsTranslated }}
|
||||
<li>
|
||||
<select aria-label="Select Language" class="lang-list" id="select-language" onchange="location = this.value;">
|
||||
{{ $siteLanguages := .Site.Languages}}
|
||||
{{ $pageLang := .Page.Lang}}
|
||||
{{ range .Page.AllTranslations }}
|
||||
{{ $translation := .}}
|
||||
{{ range $siteLanguages }}
|
||||
{{ if eq $translation.Lang .Lang }}
|
||||
{{ $selected := false }}
|
||||
{{ if eq $pageLang .Lang}}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageCode | upper }}
|
||||
</option>
|
||||
{{ else }}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageCode | upper }}</option>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</select>
|
||||
</li>
|
||||
<li class="menu-separator">
|
||||
<span>|</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<a id="mode" href="#">
|
||||
<i class="fa-regular fa-sun mode-sunny"></i>
|
||||
<i class="fa-regular fa-moon mode-moon"></i>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
28
layouts/partials/postCard.html
Normal file
28
layouts/partials/postCard.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<article class="post-item">
|
||||
<h4 class="post-item-title">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{if eq .Type "post" }}
|
||||
<i class="fa-regular fa-newspaper"></i>
|
||||
{{ else if eq .Type "micro" }}
|
||||
<i class="fa-regular fa-thought-bubble fa-flip-horizontal"></i>
|
||||
{{ else if eq .Type "photos" }}
|
||||
<i class="fa-regular fa-camera-retro"></i>
|
||||
{{ else }}
|
||||
<i class="fa-regular fa-cookie-bite"></i>
|
||||
{{ end}}
|
||||
{{ .Title }}</a>
|
||||
</h4>
|
||||
<h5>
|
||||
{{/* format date string to create an ISO 8601 string */}}
|
||||
{{ $ISO_date := "2006-01-02T15:04:05Z0700" }}
|
||||
{{ $configDateFormat := .Site.Params.dateFormat | default "2 Jan 2006" }}
|
||||
{{ if .Params.isStarred }}
|
||||
<div class="post-item-right">
|
||||
<i class="fa-regular fa-star"></i>
|
||||
</div>
|
||||
{{ end }}
|
||||
<time class="post-item-meta" datetime="{{ dateFormat $ISO_date .Date }}">
|
||||
{{ time.Format $configDateFormat .Date }}
|
||||
{{/* OLD FORMAT: .Date.Format $configDateFormat */}}
|
||||
</time>
|
||||
</article>
|
||||
Reference in New Issue
Block a user