Disable logo by default, allow to enable with params.logo.enable

This commit is contained in:
Johannes Lippmann 2021-06-01 12:46:22 +02:00 committed by hossainemruz
parent 88a0814025
commit 0763f9b816
3 changed files with 25 additions and 10 deletions

View file

@ -1,3 +1,5 @@
{{ $logoEnabled := site.Params.logo.enable | default false }}
{{/* default favicon */}}
{{ $favicon := "/images/favicon.png" }}
@ -28,5 +30,7 @@
<link href="https://fonts.googleapis.com/css2?family=Muli:wght@300;400;500;600" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" />
<!--================= fav-icon =========================-->
<link rel="icon" type="image/png" href="{{ $favicon }}" />
<!--================= fab-icon =========================-->
{{ if $logoEnabled }}
<link rel="icon" type="image/png" href="{{ $favicon }}" />
{{end}}

View file

@ -1,3 +1,5 @@
{{ $logoEnabled := site.Params.logo.enable | default false }}
{{/* default logos */}}
{{ $mainLogo := "/images/main-logo.png" }}
{{ $invertedLogo := "/images/inverted-logo.png" }}
@ -30,7 +32,9 @@
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
<img src="{{ $mainLogo }}" alt="Logo">
{{ if $logoEnabled }}
<img src="{{ $mainLogo }}" alt="Logo">
{{ end }}
{{- site.Title -}}
</a>
<button class="navbar-toggler navbar-light" id="toc-toggler" type="button" onclick="toggleTOC()">
@ -45,7 +49,9 @@
</ul>
</div>
</div>
<!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo }}" class="d-none" id="main-logo" alt="Logo">
<img src="{{ $invertedLogo }}" class="d-none" id="inverted-logo" alt="Inverted Logo">
{{ if $logoEnabled }}
<!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo }}" class="d-none" id="main-logo" alt="Logo">
<img src="{{ $invertedLogo }}" class="d-none" id="inverted-logo" alt="Inverted Logo">
{{ end }}
</nav>

View file

@ -1,6 +1,7 @@
{{/* variables for enabling/disabling various features */}}
{{ $blogEnabled := site.Params.features.blog.enable | default false }}
{{ $notesEnabled := site.Params.features.notes.enable | default false }}
{{ $logoEnabled := site.Params.logo.enable | default false }}
{{/* keep backward compatibility for blog post */}}
{{ if site.Params.enableBlogPost }}
@ -45,7 +46,9 @@
<nav class="navbar navbar-expand-xl top-navbar initial-navbar" id="top-navbar">
<div class="container">
<a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
<img src="{{ $invertedLogo }}" id="logo" alt="Logo">
{{ if $logoEnabled }}
<img src="{{ $invertedLogo }}" id="logo" alt="Logo">
{{ end }}
{{- site.Title -}}
</a>
<button
@ -118,7 +121,9 @@
</ul>
</div>
</div>
<!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo }}" class="d-none" id="main-logo" alt="Logo">
<img src="{{ $invertedLogo }}" class="d-none" id="inverted-logo" alt="Inverted Logo">
{{ if $logoEnabled }}
<!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo }}" class="d-none" id="main-logo" alt="Logo">
<img src="{{ $invertedLogo }}" class="d-none" id="inverted-logo" alt="Inverted Logo">
{{ end }}
</nav>