Numerous improvements and bug fixes.
- Refactored themes to always load with just a single file. This avoids a round trip on each request. - Locally load font when available on the system, then try to load the woff2 file, then fall back to regular woff. - Update markup to use relative urls where it is safe. RSS feeds still use absolute URLs. - Only set og:image:(height/width) when using the standard color icon. - Fixed styles on the pagination buttons. - Added ability to switch font to Source Code Pro (useSourceCodePro). - Added yellow theme. - Added grey theme. - Bold and remove underline for active page in header. - Removed markdownify on summary. - Only display date if present.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
{{- if .Resources.GetMatch .Params.Cover }}
|
||||
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
|
||||
{{- else -}}
|
||||
{{- $cover = absURL .Params.Cover -}}
|
||||
{{- $cover = relURL .Params.Cover -}}
|
||||
{{- end -}}
|
||||
{{- else if $.Site.Params.AutoCover -}}
|
||||
{{- if (not .Params.Cover) -}}
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="{{ "assets/main.js" | absURL }}"></script>
|
||||
<script src="{{ "assets/prism.js" | absURL }}"></script>
|
||||
<script defer src="{{ "assets/main.js" | relURL }}"></script>
|
||||
<script defer src="{{ "assets/prism.js" | relURL }}"></script>
|
||||
|
||||
{{ if $.Site.Params.showLanguageSelector }}
|
||||
<script src="{{ "assets/languageSelector.js" | absURL }}"></script>
|
||||
<script src="{{ "assets/languageSelector.js" | relURL }}"></script>
|
||||
{{ end }}
|
||||
|
||||
<!-- Extended footer section-->
|
||||
|
||||
@@ -8,24 +8,32 @@
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
||||
<!-- Theme CSS -->
|
||||
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
|
||||
{{ $scp := "" }}
|
||||
{{ if (isset $.Site.Params "usesourcecodepro") }}
|
||||
{{ if $.Site.Params.useSourceCodePro }}
|
||||
{{ $scp = "-scp" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (isset .Params "color") }}
|
||||
<link rel="stylesheet" href="{{ (printf "assets/%s.css" .Params.color) | absURL }}">
|
||||
<link rel="stylesheet" href="{{ (printf "assets/%s%s.css" .Params.color $scp) | relURL }}">
|
||||
{{ else if and (ne $.Site.Params.ThemeColor "orange") (ne $.Site.Params.ThemeColor "color" "") }}
|
||||
<link rel="stylesheet" href="{{ (printf "assets/%s.css" $.Site.Params.ThemeColor) | absURL }}">
|
||||
<link rel="stylesheet" href="{{ (printf "assets/%s%s.css" $.Site.Params.ThemeColor $scp) | relURL }}">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="{{ (printf "assets/orange%s.css" $scp) | relURL }}">
|
||||
{{ end }}
|
||||
|
||||
<!-- Custom CSS to override theme properties (/static/style.css) -->
|
||||
{{ if (fileExists "static/style.css") -}}
|
||||
<link rel="stylesheet" href="{{ "style.css" | absURL }}">
|
||||
<link rel="stylesheet" href="{{ "style.css" | relURL }}">
|
||||
{{- end }}
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="apple-touch-icon" href="{{ "img/apple-touch-icon-192x192.png" | absURL }}">
|
||||
<link rel="apple-touch-icon" href="{{ "img/apple-touch-icon-192x192.png" | relURL }}">
|
||||
{{ if isset $.Site.Params "favicon" }}
|
||||
<link rel="shortcut icon" href="{{ $.Site.Params.favicon | absURL }}">
|
||||
<link rel="shortcut icon" href="{{ $.Site.Params.favicon | relURL }}">
|
||||
{{ else }}
|
||||
<link rel="shortcut icon" href="{{ printf "img/favicon/%s.png" ($.Site.Params.ThemeColor | default "orange") | absURL }}">
|
||||
<link rel="shortcut icon" href="{{ printf "img/favicon/%s.png" ($.Site.Params.ThemeColor | default "orange") | relURL }}">
|
||||
{{ end }}
|
||||
|
||||
<!-- Twitter Card -->
|
||||
@@ -51,10 +59,10 @@
|
||||
<meta property="og:image" content="{{ $.Site.Params.favicon | absURL }}">
|
||||
{{ else }}
|
||||
<meta property="og:image" content="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}">
|
||||
<meta property="og:image:width" content="2048">
|
||||
<meta property="og:image:height" content="1024">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<meta property="og:image:width" content="2048">
|
||||
<meta property="og:image:height" content="1024">
|
||||
{{ range .Params.categories }}
|
||||
<meta property="article:section" content="{{ . }}" />
|
||||
{{ end }}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner menu__inner--desktop">
|
||||
{{ $currentPage := . }}
|
||||
{{ if or $.Site.Params.showMenuItems ( eq .Site.Params.showMenuItems 0 ) }}
|
||||
{{ range first $.Site.Params.showMenuItems $.Site.Menus.main }}
|
||||
{{ $menu_item_url := .URL | relLangURL }}
|
||||
{{ $page_url := $currentPage.RelPermalink | relLangURL }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
<li><a{{ if eq $menu_item_url $page_url }} class="active"{{ end }} href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
|
||||
@@ -13,7 +16,9 @@
|
||||
<ul class="menu__sub-inner-more hidden">
|
||||
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ $menu_item_url := .URL | relLangURL }}
|
||||
{{ $page_url := $currentPage.RelPermalink | relLangURL }}
|
||||
<li><a{{ if eq $menu_item_url $page_url }} class="active"{{ end }} href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
@@ -21,8 +26,10 @@
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range $.Site.Menus.main }}
|
||||
{{ $menu_item_url := .URL | relLangURL }}
|
||||
{{ $page_url := $currentPage.RelPermalink | relLangURL }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
<li><a{{ if eq $menu_item_url $page_url }} class="active"{{ end }} href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -35,7 +42,7 @@
|
||||
</ul>
|
||||
<ul class="language-selector__more hidden">
|
||||
{{ range $.Site.Home.AllTranslations }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
<li><a{{ if eq .Language $.Language }} class="active"{{ end }} href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</ul>
|
||||
@@ -44,15 +51,17 @@
|
||||
|
||||
<ul class="menu__inner menu__inner--mobile">
|
||||
{{ range $.Site.Menus.main }}
|
||||
{{ $menu_item_url := .URL | relLangURL }}
|
||||
{{ $page_url := $currentPage.RelPermalink | relLangURL }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
<li><a{{ if eq $menu_item_url $page_url }} class="active"{{ end }} href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
|
||||
<hr />
|
||||
{{ range $.Site.Home.AllTranslations }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||
<a{{ if eq .Language $.Language }} class="active"{{ end }} href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -6,20 +6,16 @@
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
{{ if .NextInSection }}
|
||||
<span class="button previous">
|
||||
<a href="{{ .NextInSection.Permalink }}">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">{{ .NextInSection.Title }}</span>
|
||||
</a>
|
||||
</span>
|
||||
<a class="button previous" href="{{ .NextInSection.RelPermalink }}">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">{{ .NextInSection.Title }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if .PrevInSection }}
|
||||
<span class="button next">
|
||||
<a href="{{ .PrevInSection.Permalink }}">
|
||||
<span class="button__text">{{ .PrevInSection.Title }}</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
<a class="button next" href="{{ .PrevInSection.RelPermalink }}">
|
||||
<span class="button__text">{{ .PrevInSection.Title }}</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user