Make a better use of Hugo theme
This commit is contained in:
parent
d29e5bbdb3
commit
20c01b8868
11 changed files with 787 additions and 5 deletions
157
layouts/partials/footer.html
Normal file
157
layouts/partials/footer.html
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
{{ if eq .Type "page" }}
|
||||
{{ partial "page_meta.html" . }}
|
||||
{{ end }}
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center footer-links">
|
||||
{{ range .Site.Data.beautifulhugo.social.social_icons }}
|
||||
{{- if isset $.Site.Author .id }}
|
||||
<li>
|
||||
<a href="{{ printf .url (index $.Site.Author .id) }}" title="{{ .title }}">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="{{ .icon }} fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{ if .Site.Params.rss }}
|
||||
<li>
|
||||
<a href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}" title="RSS">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<p class="credits copyright text-muted">
|
||||
{{ if .Site.Author.name }}
|
||||
{{ if .Site.Author.website }}
|
||||
<a href="{{ .Site.Author.website }}">{{ .Site.Author.name }}</a>
|
||||
{{ else }}
|
||||
{{ .Site.Author.name }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<span class="colored"> • </span>
|
||||
{{ if .Site.Params.since }}
|
||||
{{ .Site.Params.since }} - {{ .Site.LastChange.Format "2006" }}
|
||||
{{ else }}
|
||||
{{ .Site.LastChange.Format "2006" }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Title }}
|
||||
<span class="colored"> • </span>
|
||||
<a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a>
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ if $.GitInfo }}
|
||||
<p class="credits theme-by text-muted">
|
||||
[<a href="{{ .Site.Params.commit }}{{ .GitInfo.Hash }}">{{ substr .GitInfo.Hash 0 8 }}</a>]
|
||||
</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{{- if .Site.Params.selfHosted -}}
|
||||
<script src="{{ "js/katex.min.js" | absURL }}"></script>
|
||||
<script src="{{ "js/auto-render.min.js" | absURL }}"></script>
|
||||
<script src="{{ "js/jquery.min.js" | absURL }}"></script>
|
||||
<script src="{{ "js/bootstrap.min.js" | absURL }}"></script>
|
||||
{{- else -}}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
{{- end }}
|
||||
|
||||
<script src="{{ "js/main.js" | absURL }}"></script>
|
||||
{{- if .Site.Params.staticman }}
|
||||
<script src="{{ "js/staticman.js" | absURL }}"></script>
|
||||
{{- end }}
|
||||
{{- if .Site.Params.useHLJS }}
|
||||
<script src="{{ "js/highlight.min.js" | absURL }}"></script>
|
||||
<script> hljs.initHighlightingOnLoad(); </script>
|
||||
<script> $(document).ready(function() {$("pre.chroma").css("padding","0");}); </script>
|
||||
{{- end -}}
|
||||
<script> renderMathInElement(document.body); </script>
|
||||
|
||||
{{- if .Site.Params.selfHosted -}}
|
||||
<script src="{{ "js/photoswipe.min.js" | absURL }}"></script>
|
||||
<script src="{{ "js/photoswipe-ui-default.min.js" | absURL }}"></script>
|
||||
{{- else -}}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.js" integrity="sha384-QELNnmcmU8IR9ZAykt67vGr9/rZJdHbiWi64V88fCPaOohUlHCqUD/unNN0BXSqy" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe-ui-default.min.js" integrity="sha384-m67o7SkQ1ALzKZIFh4CiTA8tmadaujiTa9Vu+nqPSwDOqHrDmxLezTdFln8077+q" crossorigin="anonymous"></script>
|
||||
{{- end -}}
|
||||
<script src="{{ "js/load-photoswipe.js" | absURL }}"></script>
|
||||
|
||||
{{ if .Site.Params.gcse }}
|
||||
<!-- Google Custom Search Engine -->
|
||||
<script>
|
||||
(function() {
|
||||
var cx = '{{ .Site.Params.gcse }}';
|
||||
var gcse = document.createElement('script');
|
||||
gcse.type = 'text/javascript';
|
||||
gcse.async = true;
|
||||
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(gcse, s);
|
||||
})();
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.piwik }}
|
||||
<!-- Piwik -->
|
||||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(["trackPageView"]);
|
||||
_paq.push(["enableLinkTracking"]);
|
||||
|
||||
(function() {
|
||||
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://{{ .Site.Params.piwik.server }}/";
|
||||
_paq.push(["setTrackerUrl", u+"piwik.php"]);
|
||||
_paq.push(["setSiteId", "{{ .Site.Params.piwik.id }}"]);
|
||||
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
|
||||
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<noscript>
|
||||
<!-- Piwik Image Tracker -->
|
||||
<img src="http://{{ .Site.Params.piwik.server }}/piwik.php?idsite={{ .Site.Params.piwik.id }}&rec=1" style="border:0" alt="" />
|
||||
<!-- End Piwik -->
|
||||
</noscript>
|
||||
<!-- End Piwik Code -->
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.delayDisqus .Site.DisqusShortname }}
|
||||
<!-- Delayed Disqus -->
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#show-comments').on('click', function(){
|
||||
var disqus_shortname = '{{ .Site.DisqusShortname }}';
|
||||
|
||||
(function() {
|
||||
var disqus = document.createElement('script');
|
||||
disqus.type = 'text/javascript';
|
||||
disqus.async = true;
|
||||
disqus.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(disqus);
|
||||
})();
|
||||
|
||||
$(this).hide();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script id="dsq-count-scr" src="//{{ .Site.DisqusShortname }}.disqus.com/count.js" async></script>
|
||||
<!-- End Delayed Disqus -->
|
||||
{{ end }}
|
||||
|
||||
{{- partial "footer_custom.html" . }}
|
||||
91
layouts/partials/head.html
Normal file
91
layouts/partials/head.html
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{{- if eq .Kind "taxonomyTerm" }}
|
||||
{{- range $key, $value := .Data.Terms.ByCount }}
|
||||
{{- $.Scratch.Add "most_used" (slice $value.Name) }}
|
||||
{{- end }}
|
||||
{{- if not ($.Scratch.Get "most_used") }}
|
||||
{{- $description := printf "A full overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular | truncate 180 }}
|
||||
{{- $.Scratch.Set "Description" $description }}
|
||||
{{- else }}
|
||||
{{- $description := printf "A full overview of all pages with %s, ordered by %s, such as: %s" .Data.Plural .Data.Singular ( delimit ( $.Scratch.Get "most_used" ) ", " ", and " ) | truncate 180 }}
|
||||
{{- $.Scratch.Set "Description" $description }}
|
||||
{{- end }}
|
||||
|
||||
{{- $title := printf "Overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular }}
|
||||
{{- $.Scratch.Set "Title" $title }}
|
||||
{{- else if eq .Kind "taxonomy" }}
|
||||
{{- $description := printf "Overview of all pages with the %s #%s, such as: %s" .Data.Singular $.Title ( index .Pages 0).Title | truncate 160 }}
|
||||
{{- $.Scratch.Set "Description" $description }}
|
||||
|
||||
{{- $title := printf "Overview of all pages with the %s #%s" .Data.Singular $.Title }}
|
||||
{{- $.Scratch.Set "Title" $title }}
|
||||
{{- else }}
|
||||
{{- $.Scratch.Set "Description" ( .Description | default .Params.subtitle | default .Summary ) }}
|
||||
{{- $.Scratch.Set "Title" ( .Title | default .Site.Title ) }}
|
||||
{{- end }}
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<!-- Site Title, Description, Author, and Favicon -->
|
||||
{{- with ($.Scratch.Get "Title") }}
|
||||
<title>{{ . }}{{- if ne . $.Site.Title }} - {{ $.Site.Title }}{{- end}}</title>
|
||||
{{- end }}
|
||||
{{- with ($.Scratch.Get "Description") }}
|
||||
<meta name="description" content="{{ . }}">
|
||||
{{- end }}
|
||||
{{- with .Site.Author.name }}
|
||||
<meta name="author" content="{{ . }}"/>
|
||||
{{- end }}
|
||||
{{- partial "seo/main.html" . }}
|
||||
{{- with .Site.Params.favicon }}
|
||||
<link href='{{ . | absURL }}' rel='icon' type='image/x-icon'/>
|
||||
{{- end -}}
|
||||
<!-- Hugo Version number -->
|
||||
{{ hugo.Generator -}}
|
||||
<!-- Links and stylesheets -->
|
||||
<link rel="alternate" href="{{ "index.xml" | absLangURL }}" type="application/rss+xml" title="{{ .Site.Title }}">
|
||||
|
||||
{{- if .Site.Params.selfHosted -}}
|
||||
<link rel="stylesheet" href="{{ "css/katex.min.css" | absURL }}" />
|
||||
<link rel="stylesheet" href="{{ "fontawesome/css/all.css" | absURL }}" />
|
||||
<link rel="stylesheet" href="{{ "css/bootstrap.min.css" | absURL }}" />
|
||||
{{- else -}}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
{{- end -}}
|
||||
|
||||
<link rel="stylesheet" href="{{ "css/main.css" | absURL }}" />
|
||||
|
||||
{{- if .Site.Params.staticman -}}
|
||||
<link rel="stylesheet" href="{{ "css/staticman.css" | absURL }}" />
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Site.Params.selfHosted -}}
|
||||
<link rel="stylesheet" href="{{ "css/fonts.css" | absURL }}" />
|
||||
{{- else -}}
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Site.Params.useHLJS }}
|
||||
<link rel="stylesheet" href="{{ "css/highlight.min.css" | absURL }}" />
|
||||
{{- else -}}
|
||||
<link rel="stylesheet" href="{{ "css/syntax.css" | absURL }}" />
|
||||
{{- end -}}
|
||||
<link rel="stylesheet" href="{{ "css/codeblock.css" | absURL }}" />
|
||||
|
||||
{{- if .Site.Params.staticman.recaptcha -}}
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Site.Params.selfHosted -}}
|
||||
<link rel="stylesheet" href="{{ "css/photoswipe.min.css" | absURL }}" />
|
||||
<link rel="stylesheet" href="{{ "css/photoswipe.default-skin.min.css" | absURL }}" />
|
||||
{{- else -}}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.css" integrity="sha384-h/L2W9KefUClHWaty3SLE5F/qvc4djlyR4qY3NUV5HGQBBW7stbcfff1+I/vmsHh" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/default-skin/default-skin.min.css" integrity="sha384-iD0dNku6PYSIQLyfTOpB06F2KCZJAKLOThS5HRe8b3ibhdEQ6eKsFf/EeFxdOt5R" crossorigin="anonymous">
|
||||
{{- end -}}
|
||||
|
||||
{{- partial "head_custom.html" . }}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
|
|
@ -1 +1,2 @@
|
|||
<script async defer data-website-id="714f2f10-3a65-4c5b-971f-7cea9eac1ecd" src="https://pythagore.p0m.fr/pythagore.js"></script>
|
||||
<link rel="stylesheet" href="{{ "css/custom.css" | absURL }}" />
|
||||
|
|
|
|||
107
layouts/partials/header.html
Normal file
107
layouts/partials/header.html
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
{{- partial "load-photoswipe-theme.html" . }}
|
||||
|
||||
{{ if .IsHome }}
|
||||
{{ if .Site.Params.homeTitle }}{{ $.Scratch.Set "title" .Site.Params.homeTitle }}{{ end }}
|
||||
{{ if .Site.Params.subtitle }}{{ $.Scratch.Set "subtitle" .Site.Params.subtitle }}{{ end }}
|
||||
{{ if .Site.Params.bigimg }}{{ $.Scratch.Set "bigimg" .Site.Params.bigimg }}{{ end }}
|
||||
{{ if .Site.Params.thumb }}{{ $.Scratch.Set "thumb" .Site.Params.thumb }}{{ end }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "title" .Title }}
|
||||
{{ if .Params.subtitle }}{{ $.Scratch.Set "subtitle" .Params.subtitle }}{{ end }}
|
||||
{{ if .Params.bigimg }}{{ $.Scratch.Set "bigimg" .Params.bigimg }}{{ end }}
|
||||
{{ end }}
|
||||
{{ $bigimg := $.Scratch.Get "bigimg" }}
|
||||
{{ $title := $.Scratch.Get "title" }}
|
||||
{{ $subtitle := $.Scratch.Get "subtitle" }}
|
||||
{{ $thumbs := $.Scratch.Get "thumb" }}
|
||||
|
||||
{{ if or (or $bigimg $title) $thumbs }}
|
||||
{{ if $bigimg }}
|
||||
<div id="header-big-imgs" data-num-img={{len $bigimg}}
|
||||
{{range $i, $img := $bigimg}}
|
||||
{{ if (fileExists $img.src)}}
|
||||
data-img-src-{{add $i 1}}="{{$img.src | absURL }}"
|
||||
{{else}}
|
||||
data-img-src-{{add $i 1}}="{{$img.src}}"
|
||||
{{end}}
|
||||
{{ if $img.desc}}data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}
|
||||
{{end}}></div>
|
||||
{{ end }}
|
||||
|
||||
<header class="header-section {{ if $bigimg }}has-img{{ end }}">
|
||||
{{ if $bigimg }}
|
||||
<div class="intro-header big-img">
|
||||
{{ $subtitle := $.Scratch.Get "subtitle" }}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="{{ .Type }}-heading">
|
||||
<h1>{{ with $.Scratch.Get "title" }}{{.}}{{ else }}<br/>{{ end }}</h1>
|
||||
{{ if $subtitle }}
|
||||
{{ if eq .Type "page" }}
|
||||
<hr class="small">
|
||||
<span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
|
||||
{{ else }}
|
||||
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if eq .Type "post" }}
|
||||
{{ partial "post_meta.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="img-desc" style="display: inline;"></span>
|
||||
</div>
|
||||
{{end}}
|
||||
{{ if $title }}
|
||||
<div class="intro-header no-img">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="{{ .Type }}-heading">
|
||||
{{ if eq .Type "list" }}
|
||||
<h1>{{ if .Data.Singular }}#{{ end }}{{ .Title }}</h1>
|
||||
{{ else }}
|
||||
<h1>{{ with $title }}{{.}}{{ else }}<br/>{{ end }}</h1>
|
||||
{{ end }}
|
||||
{{ if ne .Type "post" }}
|
||||
<hr class="small">
|
||||
{{ end }}
|
||||
{{ if $subtitle }}
|
||||
{{ if eq .Type "page" }}
|
||||
<span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
|
||||
{{ else }}
|
||||
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if eq .Type "post" }}
|
||||
{{ partial "post_meta.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="intro-header no-img"></div>
|
||||
{{end}}
|
||||
|
||||
{{ if $thumbs }}
|
||||
<div class="container">
|
||||
{{range $i, $thumb := $thumbs}}
|
||||
<a href="{{ $thumb.link | absURL }}" target="_blank">
|
||||
<div class="thumbApp" style="background-image:url('{{ $thumb.src | absURL }}')">
|
||||
{{ if $thumb.desc }}<p><span>{{ $thumb.desc }}</span></p>{{end}}
|
||||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
<span style="clear:both; display: block"></span>
|
||||
<hr class="small">
|
||||
</div>
|
||||
{{ end }}
|
||||
</header>
|
||||
{{ else }}
|
||||
<div class="intro-header"></div>
|
||||
{{ end }}
|
||||
96
layouts/partials/nav.html
Normal file
96
layouts/partials/nav.html
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
<nav class="navbar navbar-default navbar-fixed-top navbar-inverse navbar-custom">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
|
||||
<span class="sr-only">{{ i18n "toggleNavigation" }}</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{ "" | absLangURL }}">{{ .Site.Title }}</a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="main-navbar">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{{ range .Site.Menus.main.ByWeight }}
|
||||
{{ if .HasChildren }}
|
||||
<li class="navlinks-container">
|
||||
<a class="navlinks-parent">{{ .Name }}</a>
|
||||
<div class="navlinks-children">
|
||||
{{ range .Children }}
|
||||
<a href="{{ .URL | relLangURL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a title="{{ .Name }}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.IsMultiLingual }}
|
||||
{{ if ge (len .Site.Languages) 3 }}
|
||||
<li class="navlinks-container">
|
||||
<a class="navlinks-parent">{{ i18n "languageSwitcherLabel" }}</a>
|
||||
<div class="navlinks-children">
|
||||
{{ range .Site.Languages }}
|
||||
{{ if not (eq .Lang $.Site.Language.Lang) }}
|
||||
<a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
{{ range .Site.Languages }}
|
||||
{{ if not (eq .Lang $.Site.Language.Lang) }}
|
||||
<a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "gcse" }}
|
||||
<li>
|
||||
<a href="#modalSearch" data-toggle="modal" data-target="#modalSearch" style="outline: none;">
|
||||
<span class="hidden-sm hidden-md hidden-lg">{{ i18n "gcseLabelShort" }}</span> <span id="searchGlyph" class="glyphicon glyphicon-search"></span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{ if isset .Site.Params "logo" }}
|
||||
<div class="avatar-container">
|
||||
<div class="avatar-img-border">
|
||||
<a title="{{ .Site.Title }}" href="{{ "" | absLangURL }}">
|
||||
<img class="avatar-img" src="{{ .Site.Params.logo | absURL }}" alt="{{ .Site.Title }}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Search Modal -->
|
||||
{{ if isset .Site.Params "gcse" }}
|
||||
<div id="modalSearch" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">{{ i18n "gcseLabelLong" . }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<gcse:search></gcse:search>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ i18n "gcseClose" }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue