Browse Source

refactor scripts and improve copyright

pull/1/head
Garrett Battaglia 5 years ago
committed by Max le Fou
parent
commit
a49b8d35b9
  1. 12
      exampleSite/config.toml
  2. 1
      layouts/_default/baseof.html
  3. 15
      layouts/partials/copyright.html
  4. 36
      layouts/partials/footer.html
  5. 3
      layouts/partials/head.html
  6. 30
      layouts/partials/scripts.html

12
exampleSite/config.toml

@ -40,6 +40,18 @@ preserveTaxonomyNames = true
# Enables or disables the second flyby cursor. Default is false.
loadonepass = false
[params.copyright]
name = "JM Fergeau"
# The url to use as link in the copyright name in the footer. Leave empty to use none.
url = "http://jmf-portfolio.netlify.com"
# Text to go before copyright information
prefix = "[hugo.386 theme by Max le Fou](https://gitlab.com/maxlefou/hugo.386)"
# Text to go between copyright and hugo disclaimer (if enabled)
suffix = "Example site"
[menu]
# This displays buttons in the navbar to access your contents
[[menu.main]]

1
layouts/_default/baseof.html

@ -8,4 +8,5 @@
</div>
{{- partial "footer.html" . -}}
</body>
{{- partial "scripts.html" . -}}
</html>

15
layouts/partials/copyright.html

@ -0,0 +1,15 @@
{{ with .Site.Params.Copyright.Prefix }}
{{ . | markdownify }} |
{{end}}
&copy;
{{ with .Site.Params.copyright.url }}<a href="{{ . }}" target="_blank">{{ end }}
{{ .Site.Params.copyright.name }}
{{ with .Site.Params.copyright.url }}</a>{{ end }}
<span id="thisyear">2020</span>
{{ with .Site.Params.Copyright.Suffix }}
| {{ . | markdownify }}
{{end}}
{{ if isset .Site.Params "showhugo" }}
| {{ i18n "builton" }} <a href="//gohugo.io" target="_blank">Hugo</a>
{{ end }}

36
layouts/partials/footer.html

@ -1,14 +1,7 @@
<footer class="container">
<hr class="soften">
<p>
&copy;
{{ with .Site.Params.copyrighturl }}<a href="{{ . }}" target="_blank">{{ end }}
{{ .Site.Params.copyrightname }}
{{ with .Site.Params.copyrighturl }}</a>{{ end }}
<span id="thisyear">2020</span>
{{ if isset .Site.Params "showhugo" }}
| {{ i18n "builton" }} <a href="//gohugo.io" target="_blank">Hugo</a>
{{ end }}
{{- partial "copyright.html" . -}}
</p>
<p class="text-center">
{{ with .Site.Params.facebook }}<a href="{{ . }}">Facebook</a> {{ end }}
@ -19,30 +12,3 @@
</p>
</footer>
<script src="{{ "/js/jquery.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-386.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-transition.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-alert.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-modal.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-dropdown.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-scrollspy.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-tab.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-tooltip.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-popover.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-button.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-collapse.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-carousel.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-typeahead.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-affix.js" | relURL }}"></script>
<script>
_386 = {
fastLoad:{{ .Site.Params.loadfastload }},
onePass:{{ .Site.Params.loadonepass }},
speedFactor:{{ .Site.Params.loadspeedfactor }}
};
// Free updated script to get the actual year !! no more document.write or stuff!!
function ThisYear() {
document.getElementById('thisyear').innerHTML = new Date().getFullYear();
};
</script>

3
layouts/partials/head.html

@ -8,8 +8,5 @@
<link rel="icon" href="{{ .Site.BaseURL }}/favicon.ico">
<link rel="canonical" href="{{ .Site.BaseURL }}">
{{/* Don't ask why it's like this. This original theme is a mess... */}}
<link rel="stylesheet" href="{{ "/css/bootstrap.css" | relURL }}">
<link rel="stylesheet" href="{{ "/css/bootstrap-responsive.css" | relURL }}">
<link rel="stylesheet" href="{{ "/css/style.css" | relURL }}">
<!-- <noscript><style>body { visibility: visible }</style></noscript> -->
</head>

30
layouts/partials/scripts.html

@ -0,0 +1,30 @@
<link rel="stylesheet" href="{{ "/css/bootstrap.css" | relURL }}">
<link rel="stylesheet" href="{{ "/css/bootstrap-responsive.css" | relURL }}">
<link rel="stylesheet" href="{{ "/css/style.css" | relURL }}">
<script src="{{ "/js/jquery.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-386.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-transition.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-alert.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-modal.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-dropdown.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-scrollspy.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-tab.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-tooltip.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-popover.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-button.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-collapse.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-carousel.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-typeahead.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap-affix.js" | relURL }}"></script>
<script>
_386 = {
fastLoad:{{ .Site.Params.loadfastload }},
onePass:{{ .Site.Params.loadonepass }},
speedFactor:{{ .Site.Params.loadspeedfactor }}
};
// Free updated script to get the actual year !! no more document.write or stuff!!
function ThisYear() {
document.getElementById('thisyear').innerHTML = new Date().getFullYear();
};
</script>
Loading…
Cancel
Save