27
0
Fork 1
forked from mirror/Mainroad

Compare commits

...
Sign in to create a new pull request.

14 commits

Author SHA1 Message Date
563b95aab1 implement multilang 2025-01-22 19:17:56 +01:00
089bf1ffbb minify js 2025-01-20 22:52:12 +01:00
f007390894 open side menu links in new tab 2025-01-19 20:07:54 +01:00
d2a7aeed7d Make external link handling in menus automatic
Menu entries to internal pages have access to the .Page method, so use
that to discriminate.
2025-01-19 18:29:55 +00:00
274459c601 move menu out of header container 2025-01-19 01:44:10 +01:00
1779a37549 add svg to header 2025-01-19 00:20:35 +01:00
ff59d49da1 minify stylesheets 2025-01-18 23:02:12 +01:00
02d0a85f53 more header fixes 2025-01-18 22:46:10 +01:00
6cd682cd26 Fix authors 2025-01-18 22:15:56 +01:00
92c9b4327c Add external link feature 2025-01-18 22:15:46 +01:00
24d5d36119 Slight color tweaks 2025-01-18 22:15:33 +01:00
13b38969db Header / logo changes 2025-01-18 22:15:21 +01:00
95fedfffb2 Drop footer credits 2025-01-18 22:14:57 +01:00
283d04cae6 Remove CDN garbage 2025-01-18 22:14:45 +01:00
12 changed files with 23 additions and 26 deletions

View file

@ -1094,7 +1094,6 @@ textarea {
/* Search widget */
.widget-search__form {
padding: 16px 24px;
background: #f5f5f5;
}
.widget-search__submit[type=submit] {

View file

@ -16,18 +16,11 @@
{{ template "_internal/twitter_cards.html" . }}
{{- end }}
{{- $googleFontsLink := .Site.Params.googleFontsLink | default "https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700" }}
{{- if hasPrefix $googleFontsLink "https://fonts.googleapis.com/" }}
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="dns-prefetch" href="//fonts.googleapis.com">
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link rel="stylesheet" {{ printf `href="%s"` $googleFontsLink | safeHTMLAttr }}>
{{- end }}
{{ $style := resources.Get "css/style.css" | resources.ExecuteAsTemplate "css/style.css" . -}}
{{ $style := resources.Get "css/style.css" | resources.ExecuteAsTemplate "css/style.css" . | resources.Minify -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ range .Site.Params.customCSS -}}
<link rel="stylesheet" href="{{ . | relURL }}">
{{ $customStyle := resources.Get . | resources.Minify -}}
<link rel="stylesheet" href="{{ $customStyle.RelPermalink }}">
{{- end }}
{{- with .OutputFormats.Get "rss" }}
@ -62,9 +55,11 @@
</div>
{{ block "footer" . }}{{ partial "footer.html" . }}{{ end }}
</div>
<script async defer src="{{ "js/menu.js" | relURL }}"></script>
{{ $menuScript := resources.Get "js/menu.js" | resources.Minify -}}
<script async defer src="{{ $menuScript.RelPermalink }}"></script>
{{ range .Site.Params.customJS -}}
<script src="{{ . | relURL }}"></script>
{{ $customScript := resources.Get . | resources.Minify -}}
<script async defer src="{{ $customScript.RelPermalink }}"></script>
{{- end }}
{{- partial "mathjax.html" . -}}
</body>

View file

@ -5,7 +5,11 @@
{{ . }}
</div>
{{- end }}
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
{{ $pages := .Site.RegularPages }}
{{ range .Site.Home.Translations }}
{{ $pages = $pages | lang.Merge .Site.RegularPages }}
{{ end }}
{{ $paginator := .Paginate (where $pages "Type" "in" .Site.Params.mainSections) }}
{{- range $paginator.Pages }}
{{- .Render "summary" }}
{{- end }}

View file

@ -3,7 +3,6 @@
{{ partial "footer_links.html" . }}
<div class="footer__copyright">
&copy; {{ now.Format "2006" }} {{ .Site.Params.copyright | default .Site.Title }}.
<span class="footer__copyright-credits">{{ T "footer_credits" | safeHTML }}</span>
</div>
</div>
</footer>

View file

@ -2,7 +2,7 @@
<div class="footer__links">
{{ range $key, $value := . }}
{{- if ne $key 0 }} | {{ end -}}
<a class="footer__link" href="{{ $value.URL }}">{{ $value.Name }}</a>
<a class="footer__link" href="{{ $value.URL }}" {{- if not .Page }} target="_blank"{{ end }}>{{ i18n $value.Identifier | default $value.Name}}</a>
{{- end }}
</div>
{{- end }}

View file

@ -1,6 +1,7 @@
<header class="header">
<div class="container header__container">
<div class="container header__container" id="main-banner">
{{ partial "svg" "header" }}
{{ partial "logo.html" . }}
{{ partial "menu.html" . }}
</div>
{{ partial "menu.html" . }}
</header>

View file

@ -5,9 +5,9 @@
{{- if or $logoTitle $logoImage }}
{{/* Defined when logo is mixed (image + text) */}}
{{- $logoMix := and $logoImage $logoTitle -}}
<div class="logo{{ with $logoMix }} logo--mixed{{ end }}">
<a class="logo__link" href="{{ "" | relLangURL }}"{{ with $logoTitle }} title="{{ . }}"{{ end }} rel="home">
<div class="logo__item logo__dummy"></div>
{{ with $logoImage -}}
<div class="logo__item logo__imagebox">
<img class="logo__img" src="{{ . | relURL }}">

View file

@ -8,9 +8,9 @@
{{- range .Site.Menus.main }}
{{- if .Name }}
<li class="menu__item{{ if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }} menu__item--active{{ end }}">
<a class="menu__link" href="{{ .URL }}">
<a class="menu__link" href="{{ .URL }}" {{- if not .Page }} target="_blank"{{ end }}>
{{ .Pre }}
<span class="menu__text">{{ .Name }}</span>
<span class="menu__text">{{ i18n .Identifier | default .Name}}</span>
{{ .Post }}
</a>
</li>

View file

@ -1,6 +1,6 @@
{{- if .Site.Author.name -}}
{{- if .Params.Author -}}
<div class="meta__item-author meta__item">
{{ partial "svg/author.svg" (dict "class" "meta__icon") -}}
<span class="meta__text">{{ .Site.Author.name }}</span>
<span class="meta__text">{{ .Params.Author }}</span>
</div>
{{- end -}}

View file

@ -1,7 +1,6 @@
{{- $translations := .Site.Home.AllTranslations }}
{{- if and .Site.IsMultiLingual (gt (len $translations) 0) }}
{{- if and hugo.IsMultilingual (gt (len $translations) 0) }}
<div class="widget-languages widget">
<h4 class="widget__title">{{ T "languages_title" }}</h4>
<div class="widget__content">
<ul class="widget__list">
{{- range $translations }}

View file

@ -5,7 +5,7 @@
<ul class="widget__list">
{{ range .Site.Menus.side }}
<li class="widget__item">
<a class="widget__link" href="{{ .URL }}">{{ .Name }}</a>
<a class="widget__link" target="_blank" href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>