Browse Source

actualizar tema hermit

master
tarteka 2 years ago
parent
commit
4850cc7d53
28 changed files with 190 additions and 82 deletions
  1. +6
    -5
      resources/_gen/assets/js/js/main.js_d11fe7b62c27961c87ecd0f2490357b9.content
  2. +1
    -1
      resources/_gen/assets/js/js/main.js_d11fe7b62c27961c87ecd0f2490357b9.json
  3. +1
    -1
      resources/_gen/assets/scss/scss/style.scss_c16d144eee185fbddd582cd5e25a4fae.content
  4. +1
    -1
      resources/_gen/assets/scss/scss/style.scss_c16d144eee185fbddd582cd5e25a4fae.json
  5. +9
    -4
      themes/hermit/README.md
  6. +1
    -0
      themes/hermit/archetypes/default.md
  7. +2
    -2
      themes/hermit/archetypes/posts.md
  8. +24
    -12
      themes/hermit/assets/js/main.js
  9. +6
    -6
      themes/hermit/assets/scss/style.scss
  10. +19
    -8
      themes/hermit/exampleSite/config.toml
  11. +9
    -3
      themes/hermit/exampleSite/content/posts/post-with-featured-image.md
  12. +8
    -0
      themes/hermit/i18n/en.toml
  13. +10
    -2
      themes/hermit/i18n/es.toml
  14. +8
    -0
      themes/hermit/i18n/zh-hans.toml
  15. +14
    -13
      themes/hermit/layouts/_default/baseof.html
  16. +1
    -1
      themes/hermit/layouts/_default/list.html
  17. +14
    -1
      themes/hermit/layouts/_default/single.html
  18. +16
    -3
      themes/hermit/layouts/index.html
  19. +1
    -0
      themes/hermit/layouts/partials/analytics.html
  20. +6
    -0
      themes/hermit/layouts/partials/favicons.html
  21. +4
    -1
      themes/hermit/layouts/partials/footer.html
  22. +5
    -5
      themes/hermit/layouts/partials/header.html
  23. +1
    -1
      themes/hermit/layouts/partials/social-icons.html
  24. +14
    -4
      themes/hermit/layouts/posts/single.html
  25. +6
    -5
      themes/hermit/resources/_gen/assets/js/js/main.js_d11fe7b62c27961c87ecd0f2490357b9.content
  26. +1
    -1
      themes/hermit/resources/_gen/assets/js/js/main.js_d11fe7b62c27961c87ecd0f2490357b9.json
  27. +1
    -1
      themes/hermit/resources/_gen/assets/scss/scss/style.scss_c16d144eee185fbddd582cd5e25a4fae.content
  28. +1
    -1
      themes/hermit/resources/_gen/assets/scss/scss/style.scss_c16d144eee185fbddd582cd5e25a4fae.json

+ 6
- 5
resources/_gen/assets/js/js/main.js_d11fe7b62c27961c87ecd0f2490357b9.content View File

@ -1,8 +1,9 @@
const throttle=(callback,limit)=>{let timeoutHandler=null;return()=>{if(timeoutHandler==null){timeoutHandler=setTimeout(()=>{callback();timeoutHandler=null;},limit);}};};let lastScrollPosition=window.pageYOffset;let header=document.getElementById('site-header');const autoHideHeader=()=>{let currentScrollPosition=window.pageYOffset;if(currentScrollPosition>lastScrollPosition){header.classList.remove('slideInUp');header.classList.add('slideOutDown');}else{header.classList.remove('slideOutDown');header.classList.add('slideInUp');}
const throttle=(callback,limit)=>{let timeoutHandler=null;return()=>{if(timeoutHandler==null){timeoutHandler=setTimeout(()=>{callback();timeoutHandler=null;},limit);}};};const listen=(ele,e,callback)=>{if(document.querySelector(ele)!==null){document.querySelector(ele).addEventListener(e,callback);}}
let header=document.getElementById('site-header');let lastScrollPosition=window.pageYOffset;const autoHideHeader=()=>{let currentScrollPosition=window.pageYOffset;if(currentScrollPosition>lastScrollPosition){header.classList.remove('slideInUp');header.classList.add('slideOutDown');}else{header.classList.remove('slideOutDown');header.classList.add('slideInUp');}
lastScrollPosition=currentScrollPosition;}
let mobileMenu=document.getElementById('mobile-menu');let mobileMenuVisible=false;const mobileMenuToggle=()=>{if(mobileMenuVisible==false){mobileMenu.style.animationName='bounceInRight';mobileMenu.style.webkitAnimationName='bounceInRight';mobileMenu.style.display='block';mobileMenuVisible=true;}else{mobileMenu.style.animationName='bounceOutRight';mobileMenu.style.webkitAnimationName='bounceOutRight'
let mobileMenuVisible=false;const toggleMobileMenu=()=>{let mobileMenu=document.getElementById('mobile-menu');if(mobileMenuVisible==false){mobileMenu.style.animationName='bounceInRight';mobileMenu.style.webkitAnimationName='bounceInRight';mobileMenu.style.display='block';mobileMenuVisible=true;}else{mobileMenu.style.animationName='bounceOutRight';mobileMenu.style.webkitAnimationName='bounceOutRight'
mobileMenuVisible=false;}}
const showFeaturedImg=()=>{document.getElementById('bg-img').classList.add('show-bg-img');}
const showContent=()=>{document.getElementById('bg-img').classList.remove('show-bg-img');}
const showImg=()=>{document.querySelector('.bg-img').classList.add('show-bg-img');}
const hideImg=()=>{document.querySelector('.bg-img').classList.remove('show-bg-img');}
const toggleToc=()=>{document.getElementById('toc').classList.toggle('show-toc');}
if(document.getElementById('site-header')!==null){document.getElementById('menu-btn').addEventListener('click',mobileMenuToggle);window.addEventListener('scroll',throttle(()=>{autoHideHeader();if(mobileMenuVisible==true){mobileMenuToggle();}},250));}
if(header!==null){listen('#menu-btn',"click",toggleMobileMenu);listen('#toc-btn',"click",toggleToc);listen('#img-btn',"click",showImg);listen('.bg-img',"click",hideImg);window.addEventListener('scroll',throttle(()=>{autoHideHeader();if(mobileMenuVisible==true){toggleMobileMenu();}},250));}

+ 1
- 1
resources/_gen/assets/js/js/main.js_d11fe7b62c27961c87ecd0f2490357b9.json View File

@ -1 +1 @@
{"Target":"js/main.min.de4d516d3e45a2fbe013b06aa4292cd08f6f04d55e780c03d9009bd99b05dcd4.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-3k1RbT5FovvgE7BqpCks0I9vBNVeeAwD2QCb2ZsF3NQ="}}
{"Target":"js/main.min.8f39f24808e9d0a9b02da58c2d2838da859dc0b7bdfadbdb1883aae8b6adacfe.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-jznySAjp0KmwLaWMLSg42oWdwLe9+tvbGIOq6LatrP4="}}

+ 1
- 1
resources/_gen/assets/scss/scss/style.scss_c16d144eee185fbddd582cd5e25a4fae.content
File diff suppressed because it is too large
View File


+ 1
- 1
resources/_gen/assets/scss/scss/style.scss_c16d144eee185fbddd582cd5e25a4fae.json View File

@ -1 +1 @@
{"Target":"css/style.min.4979cbbcf5a9b619a6b7239fc51fe60e5b239c51edf9b984fb6019584e8802c8.css","MediaType":"text/css","Data":{"Integrity":"sha256-SXnLvPWpthmmtyOfxR/mDlsjnFHt+bmE+2AZWE6IAsg="}}
{"Target":"css/style.min.f968fb8f9365d5759ff064a49ae7cce4fce9eee3b9cdf227b3b7681f7cee1222.css","MediaType":"text/css","Data":{"Integrity":"sha256-+Wj7j5Nl1XWf8GSkmufM5Pzp7uO5zfIns7doH3zuEiI="}}

+ 9
- 4
themes/hermit/README.md View File

@ -82,12 +82,13 @@ If that's not enough, you can see [Overriding templates](#overriding-templates)
In Hugo, layouts can live in either the project’s (root) or the themes’ layout folders, any template inside the root layout folder will override theme's layout that relative to it, for example: `layouts/_default/baseof.html` will override `themes/hermit/layouts/_default/baseof.html`. So, you can easily customize the theme without edit it directly, which makes updating the theme easier. Here's some common customizations:
##### Customize social icons
You can modify or add any svg icons in site's `layouts/partials/svg.html`
You can modify or add any svg icons in site's `layouts/partials/svg.html`.
##### Customize comment system
We only have built-in support for Disqus at the moment, if that doesn't fit your needs, you can just add html to site's `layouts/partials/comments.html`.
We only have built-in support for Disqus at the moment, if that doesn't fit your needs, you can just add html to site's `layouts/partials/comments.html`
##### Add custom analytics
If you prefer to use different analytics system other than google analytics, then add them inside `layouts/partials/analytics.html`.
#### Add custom css
@ -96,7 +97,11 @@ For adding custom css to the theme, you need to assign an array of references in
[params]
customCSS = ["css/foo.css", "css/bar.css"]
```
You can reference as many stylesheets as you want. Their paths need to be relative to the `static` folder.
You can reference as many stylesheets as you want. Their paths need to be relative to the `static` folder or they can be network resources.
#### Code injection
You can inject any html code to every page's document head or right above the closing body tag. This makes it easier to add any html meta data, custom css/js, dns-prefetch etc. To do this you simply need to create a file at site's `layouts/partials/extra-head.html` or `layouts/partials/extra-foot.html`, code inside will be injected to every page.
## Acknowledgments

+ 1
- 0
themes/hermit/archetypes/default.md View File

@ -3,5 +3,6 @@ title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
comments: false
images:
---

+ 2
- 2
themes/hermit/archetypes/posts.md View File

@ -3,8 +3,8 @@ title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
toc: false
featuredImg: ""
images:
tags:
- tag
- untagged
---

+ 24
- 12
themes/hermit/assets/js/main.js View File

@ -16,14 +16,22 @@ const throttle = (callback, limit) => {
};
};
// addEventListener Helper
//
const listen = (ele, e, callback) => {
if (document.querySelector(ele) !== null) {
document.querySelector(ele).addEventListener(e, callback);
}
}
/**
* Functions
*/
// Auto Hide Header
//
let lastScrollPosition = window.pageYOffset;
let header = document.getElementById('site-header');
let lastScrollPosition = window.pageYOffset;
const autoHideHeader = () => {
let currentScrollPosition = window.pageYOffset;
@ -39,10 +47,10 @@ const autoHideHeader = () => {
// Mobile Menu Toggle
//
let mobileMenu = document.getElementById('mobile-menu');
let mobileMenuVisible = false;
const mobileMenuToggle = () => {
const toggleMobileMenu = () => {
let mobileMenu = document.getElementById('mobile-menu');
if (mobileMenuVisible == false) {
mobileMenu.style.animationName = 'bounceInRight';
mobileMenu.style.webkitAnimationName = 'bounceInRight';
@ -55,30 +63,34 @@ const mobileMenuToggle = () => {
}
}
// Show Featured Image
// Featured Image Toggle
//
const showFeaturedImg = () => {
document.getElementById('bg-img').classList.add('show-bg-img');
const showImg = () => {
document.querySelector('.bg-img').classList.add('show-bg-img');
}
const showContent = () => {
document.getElementById('bg-img').classList.remove('show-bg-img');
const hideImg = () => {
document.querySelector('.bg-img').classList.remove('show-bg-img');
}
// Toggle TOC
// ToC Toggle
//
const toggleToc = () => {
document.getElementById('toc').classList.toggle('show-toc');
}
if (document.getElementById('site-header') !== null) {
document.getElementById('menu-btn').addEventListener('click', mobileMenuToggle);
if (header !== null) {
listen('#menu-btn', "click", toggleMobileMenu);
listen('#toc-btn', "click", toggleToc);
listen('#img-btn', "click", showImg);
listen('.bg-img', "click", hideImg);
window.addEventListener('scroll', throttle(() => {
autoHideHeader();
if (mobileMenuVisible == true) {
mobileMenuToggle();
toggleMobileMenu();
}
}, 250));
}

+ 6
- 6
themes/hermit/assets/scss/style.scss View File

@ -252,6 +252,7 @@ table {
position: fixed;
bottom: 4.8em;
right: 1.5em;
display: none;
padding: .6em 1.8em;
z-index: 1;
box-sizing: border-box;
@ -398,7 +399,6 @@ p.img-404 {
}
}
// list.html
//
.posts-group {
@ -418,7 +418,6 @@ p.img-404 {
margin: 0;
padding: 0;
list-style: none;
}
.post-item {
@ -442,8 +441,8 @@ p.img-404 {
// single.html
//
.bg-img {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
opacity: .03;
z-index: -1;
position: fixed;
@ -458,6 +457,7 @@ p.img-404 {
.show-bg-img {
z-index: 100;
opacity: 1;
cursor: pointer;
}
.post-header {
@ -575,8 +575,8 @@ hr.post-end {
margin: .8em 0;
}
a {
text-decoration: underline;
a:hover {
border-bottom: 1px solid $theme;
}
svg {

+ 19
- 8
themes/hermit/exampleSite/config.toml View File

@ -6,7 +6,7 @@ theme = "hermit"
# enableGitInfo = true
pygmentsCodefences = true
pygmentsUseClasses = true
hasCJKLanguage = true # If there're Chinese/Japanese/Korean Languages in the content, enable this.
# hasCJKLanguage = true # If Chinese/Japanese/Korean is your main content language, enable this to make wordCount works right.
rssLimit = 10 # Maximum number of items in the RSS feed.
copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License." # This message is only used by the RSS template.
enableEmoji = true # Shorthand emojis in content files - https://gohugo.io/functions/emojify/
@ -29,13 +29,24 @@ enableEmoji = true # Shorthand emojis in content files - https://gohugo.io/func
dateformNum = "2006-01-02"
dateformNumTime = "2006-01-02 15:04 -0700"
# themeColor = "#494f5c" # Theme color in meta tags.
# Metadata mostly used in document's head
# description = ""
# images = [""]
themeColor = "#494f5c"
homeSubtitle = "A minimal and fast theme for Hugo."
footerCopyright = ' &#183; <a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener">CC BY-NC 4.0</a>'
# gitUrl = "https://github.com/Someone/SomeRepo/commit/" # Prefix of link to the git commit detail page. GitInfo must be enabled.
justifyContent = false # Set "text-align: justify" to .content, requires extended version of Hugo
# bgImg = "" # Homepage background-image URL
# customCSS = ["css/foo.css", "css/bar.css"] # add custom css
# bgImg = "" # Homepage background-image URL
# Prefix of link to the git commit detail page. GitInfo must be enabled.
# gitUrl = "https://github.com/username/repository/commit/"
# Toggle this option need to rebuild SCSS, requires extended version of Hugo
justifyContent = false # Set "text-align: justify" to .content.
# Add custom css
# customCSS = ["css/foo.css", "css/bar.css"]
# Social Icons
# Check https://github.com/Track3/hermit#social-icons for more info.
[[params.social]]
@ -54,10 +65,10 @@ enableEmoji = true # Shorthand emojis in content files - https://gohugo.io/func
[[menu.main]]
name = "Posts"
url = "/posts/"
url = "posts/"
weight = 10
[[menu.main]]
name = "About"
url = "/about-hugo/"
url = "about-hugo/"
weight = 20

+ 9
- 3
themes/hermit/exampleSite/content/posts/post-with-featured-image.md View File

@ -2,7 +2,8 @@
title: "Post With Featured Image"
date: 2018-10-01T16:15:09+08:00
draft: false
featuredImg: "https://picsum.photos/1024/768/?random"
images:
- https://picsum.photos/1024/768/?random
tags:
- Demo
- Image
@ -13,5 +14,10 @@ Just define the image URL in the content’s front matter, the featured image wi
For example:
```yaml
featuredImg: "https://picsum.photos/1024/768/?random"
```
---
images:
- https://picsum.photos/1024/768/?random
---
```
This is an array, you can set multiple urls, only the first url will be used. These images is also used in [Twitter Cards](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started.html) and the [Open Graph](http://ogp.me/) metadata.

+ 8
- 0
themes/hermit/i18n/en.toml View File

@ -25,3 +25,11 @@ other = "Newer"
[older]
other = "Older"
# partials/header.html
#
[menu]
other = "Menu"
[featuredImage]
other = "Featured Image"

+ 10
- 2
themes/hermit/i18n/es.toml View File

@ -1,4 +1,4 @@
# Translations for Spanish
# Translations for English
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# 404.html
@ -26,7 +26,15 @@ other = "Anterior"
[older]
other = "Posterior"
# partials/header.html
#
[menu]
other = "Menú"
[featuredImage]
other = "Imagen Destacada"
# _default/list.html
#
[title]
other = "Blog"
other = "Blog"

+ 8
- 0
themes/hermit/i18n/zh-hans.toml View File

@ -25,3 +25,11 @@ other = "新"
[older]
other = "旧"
# partials/header.html
#
[menu]
other = "菜单"
[featuredImage]
other = "特色图片"

+ 14
- 13
themes/hermit/layouts/_default/baseof.html View File

@ -9,24 +9,22 @@
<meta name="theme-color" content="{{.}}">
<meta name="msapplication-TileColor" content="{{.}}">
{{- end }}
{{ template "_internal/schema.html" . -}}
{{ template "_internal/opengraph.html" . -}}
{{ template "_internal/twitter_cards.html" . -}}
<link rel="apple-touch-icon" sizes="180x180" href="{{"apple-touch-icon.png" | relURL}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{"favicon-32x32.png" | relURL}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{"favicon-16x16.png" | relURL}}">
<link rel="manifest" href="{{"site.webmanifest" | relURL}}">
<link rel="mask-icon" href="{{"safari-pinned-tab.svg" | relURL}}" color="{{.Site.Params.themeColor}}">
<link rel="shortcut icon" href="{{"favicon.ico" | relURL}}">
{{- template "_internal/schema.html" . }}
{{- template "_internal/opengraph.html" . }}
{{- template "_internal/twitter_cards.html" . }}
{{- partial "favicons.html" }}
<title>{{.Title}}</title>
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s+%s" href="%s" title="%s" />` .Rel .MediaType.Type .MediaType.Suffix .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}}
<link rel="stylesheet" href="{{ $style.Permalink }}" {{ printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }}>
{{ block "head" . -}}{{- end }}
{{ range .Site.Params.CustomCSS -}}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- block "head" . -}}{{- end }}
{{- range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
{{- if templates.Exists "partials/extra-head.html" -}}
{{ partial "extra-head.html" . }}
{{- end }}
</head>
@ -36,7 +34,10 @@
{{ block "footer" . -}}{{ end }}
{{ $script := resources.Get "js/main.js" | minify | fingerprint -}}
<script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }}></script>
{{ template "_internal/google_analytics_async.html" . }}
{{- partial "analytics.html" . }}
{{- if templates.Exists "partials/extra-foot.html" -}}
{{ partial "extra-foot.html" . }}
{{- end }}
</body>
</html>

+ 1
- 1
themes/hermit/layouts/_default/list.html View File

@ -4,7 +4,7 @@
{{ define "main" }}
<main class="site-main section-inner thin animated fadeIn faster">
<h1>{{ i18n "title" }}</h1> <!-- .Title -->
<h1>{{ i18n "title" }}</h1>
{{- if .Content }}
<div class="content">
{{ .Content }}

+ 14
- 1
themes/hermit/layouts/_default/single.html View File

@ -1,8 +1,21 @@
{{ define "head" }}
{{ if .Params.featuredImg -}}
<style>.bg-img {background-image: url('{{.Params.featuredImg}}');}</style>
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
<style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
{{ end }}
{{ define "header" }}
{{ partialCached "header.html" . }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
{{- if (or .Params.images .Params.featuredImg) }}
<div class="bg-img"></div>
{{- end }}
<main class="site-main section-inner thin animated fadeIn faster">
<h1>{{ .Title }}</h1>
<div class="content">

+ 16
- 3
themes/hermit/layouts/index.html View File

@ -1,6 +1,16 @@
{{ define "head" }}
{{ if .Site.Params.bgImg -}}
<style>.bg-img {background-image: url('{{.Site.Params.bgImg}}');}</style>
{{- else if .Site.Params.images -}}
{{- range first 1 .Site.Params.images -}}
<style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
{{ end }}
{{ define "main" }}
{{- with .Site.Params.bgImg }}
<div class="bg-img" style="background-image: url('{{ . }}')"></div>
{{- if (or .Site.Params.images .Site.Params.bgImg) }}
<div class="bg-img"></div>
{{- end }}
<div id="spotlight" class="animated fadeIn">
<div id="home-center">
@ -20,7 +30,10 @@
</nav>
</div>
<div id="home-footer">
<p>&copy; {{ now.Format "2006" }} <a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a>. {{ with (not (in (.Site.Language.Get "disableKinds") "RSS")) }}<a href="{{ "posts/index.xml" | absURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a>{{ end }}</p>
<p>
&copy; {{ now.Format "2006" }} <a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a>{{ .Site.Params.footerCopyright | safeHTML }}
{{- with (not (in (.Site.Language.Get "disableKinds") "RSS")) }} &#183; <a href="{{ "posts/index.xml" | absURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a>{{ end }}
</p>
</div>
</div>
{{ end }}

+ 1
- 0
themes/hermit/layouts/partials/analytics.html View File

@ -0,0 +1 @@
{{ template "_internal/google_analytics_async.html" . }}

+ 6
- 0
themes/hermit/layouts/partials/favicons.html View File

@ -0,0 +1,6 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{"apple-touch-icon.png" | relURL}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{"favicon-32x32.png" | relURL}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{"favicon-16x16.png" | relURL}}">
<link rel="manifest" href="{{"site.webmanifest" | relURL}}">
<link rel="mask-icon" href="{{"safari-pinned-tab.svg" | relURL}}" color="{{.Site.Params.themeColor}}">
<link rel="shortcut icon" href="{{"favicon.ico" | relURL}}">

+ 4
- 1
themes/hermit/layouts/partials/footer.html View File

@ -1,4 +1,7 @@
<footer id="site-footer" class="section-inner thin animated fadeIn faster">
<p>&copy; {{ now.Format "2006" }} <a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a>{{ .Site.Params.footerCopyright | safeHTML }}</p>
<p>Made with <a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a> &#183; Theme <a href="https://github.com/Track3/hermit" target="_blank" rel="noopener">Hermit</a>{{ with (not (in (.Site.Language.Get "disableKinds") "RSS")) }} &#183; <a href="{{ "posts/index.xml" | absURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a>{{ end }}</p>
<p>
Made with <a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a> &#183; Theme <a href="https://github.com/Track3/hermit" target="_blank" rel="noopener">Hermit</a>
{{- with (not (in (.Site.Language.Get "disableKinds") "RSS")) }} &#183; <a href="{{ "posts/index.xml" | absURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a>{{ end }}
</p>
</footer>

+ 5
- 5
themes/hermit/layouts/partials/header.html View File

@ -11,20 +11,20 @@
</nav>
</div>
<div class="hdr-right hdr-icons">
{{ with .Params.featuredImg -}}
<button class="hdr-btn" onclick="showFeaturedImg()"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-image"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg></button>
{{ if (or .Params.images .Params.featuredImg) -}}
<button id="img-btn" class="hdr-btn" title="{{i18n "featuredImage"}}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-image"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg></button>
{{- end }}
{{- with .Params.toc -}}
<button class="hdr-btn desktop-only-ib" onclick="toggleToc()"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3" y2="6"></line><line x1="3" y1="12" x2="3" y2="12"></line><line x1="3" y1="18" x2="3" y2="18"></line></svg></button>
<button id="toc-btn" class="hdr-btn desktop-only-ib" title="{{i18n "tableOfContents"}}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3" y2="6"></line><line x1="3" y1="12" x2="3" y2="12"></line><line x1="3" y1="18" x2="3" y2="18"></line></svg></button>
{{- end }}
{{- with .Site.Params.social -}}
<span class="hdr-social hide-in-mobile">{{ partialCached "social-icons.html" . }}</span>
{{- end -}}
<button id="menu-btn" class="hdr-btn"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button>
<button id="menu-btn" class="hdr-btn" title="{{i18n "menu"}}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button>
</div>
</div>
</header>
<div id="mobile-menu" class="animated fast" style="display: none;">
<div id="mobile-menu" class="animated fast">
<ul>
{{- range .Site.Menus.main }}
<li><a href="{{ .URL | absLangURL }}">{{ .Name }}</a></li>

+ 1
- 1
themes/hermit/layouts/partials/social-icons.html View File

@ -1,3 +1,3 @@
{{ range . -}}
<a href="{{ .url }}" target="_blank" rel="noopener">{{ partial "svg.html" . }}</a>
<a href="{{ .url }}" target="_blank" rel="noopener" title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a>
{{- end -}}

+ 14
- 4
themes/hermit/layouts/posts/single.html View File

@ -1,10 +1,20 @@
{{ define "head" }}
{{ if .Params.featuredImg -}}
<style>.bg-img {background-image: url('{{.Params.featuredImg}}');}</style>
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
<style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
{{ end }}
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
{{- with .Params.featuredImg }}
<div id="bg-img" class="bg-img" style="background-image: url({{.}});" onclick="showContent()"></div>
{{- if (or .Params.images .Params.featuredImg) }}
<div class="bg-img"></div>
{{- end }}
<main class="site-main section-inner animated fadeIn faster">
<article class="thin">
@ -27,7 +37,7 @@
{{- end }}
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>{{ i18n "wordCount" . }}</p>
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}</p>
{{- if .GitInfo }}
{{- if and .GitInfo .Site.Params.gitUrl }}
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}</p>
{{- end }}
</footer>
@ -51,7 +61,7 @@
{{- end }}
</div>
<div id="comments" class="thin">
{{ partial "comments.html" . }}
{{- partial "comments.html" . -}}
</div>
</main>
{{ end }}

+ 6
- 5
themes/hermit/resources/_gen/assets/js/js/main.js_d11fe7b62c27961c87ecd0f2490357b9.content View File

@ -1,8 +1,9 @@
const throttle=(callback,limit)=>{let timeoutHandler=null;return()=>{if(timeoutHandler==null){timeoutHandler=setTimeout(()=>{callback();timeoutHandler=null;},limit);}};};let lastScrollPosition=window.pageYOffset;let header=document.getElementById('site-header');const autoHideHeader=()=>{let currentScrollPosition=window.pageYOffset;if(currentScrollPosition>lastScrollPosition){header.classList.remove('slideInUp');header.classList.add('slideOutDown');}else{header.classList.remove('slideOutDown');header.classList.add('slideInUp');}
const throttle=(callback,limit)=>{let timeoutHandler=null;return()=>{if(timeoutHandler==null){timeoutHandler=setTimeout(()=>{callback();timeoutHandler=null;},limit);}};};const listen=(ele,e,callback)=>{if(document.querySelector(ele)!==null){document.querySelector(ele).addEventListener(e,callback);}}
let header=document.getElementById('site-header');let lastScrollPosition=window.pageYOffset;const autoHideHeader=()=>{let currentScrollPosition=window.pageYOffset;if(currentScrollPosition>lastScrollPosition){header.classList.remove('slideInUp');header.classList.add('slideOutDown');}else{header.classList.remove('slideOutDown');header.classList.add('slideInUp');}
lastScrollPosition=currentScrollPosition;}
let mobileMenu=document.getElementById('mobile-menu');let mobileMenuVisible=false;const mobileMenuToggle=()=>{if(mobileMenuVisible==false){mobileMenu.style.animationName='bounceInRight';mobileMenu.style.webkitAnimationName='bounceInRight';mobileMenu.style.display='block';mobileMenuVisible=true;}else{mobileMenu.style.animationName='bounceOutRight';mobileMenu.style.webkitAnimationName='bounceOutRight'
let mobileMenuVisible=false;const toggleMobileMenu=()=>{let mobileMenu=document.getElementById('mobile-menu');if(mobileMenuVisible==false){mobileMenu.style.animationName='bounceInRight';mobileMenu.style.webkitAnimationName='bounceInRight';mobileMenu.style.display='block';mobileMenuVisible=true;}else{mobileMenu.style.animationName='bounceOutRight';mobileMenu.style.webkitAnimationName='bounceOutRight'
mobileMenuVisible=false;}}
const showFeaturedImg=()=>{document.getElementById('bg-img').classList.add('show-bg-img');}
const showContent=()=>{document.getElementById('bg-img').classList.remove('show-bg-img');}
const showImg=()=>{document.querySelector('.bg-img').classList.add('show-bg-img');}
const hideImg=()=>{document.querySelector('.bg-img').classList.remove('show-bg-img');}
const toggleToc=()=>{document.getElementById('toc').classList.toggle('show-toc');}
if(document.getElementById('site-header')!==null){document.getElementById('menu-btn').addEventListener('click',mobileMenuToggle);window.addEventListener('scroll',throttle(()=>{autoHideHeader();if(mobileMenuVisible==true){mobileMenuToggle();}},250));}
if(header!==null){listen('#menu-btn',"click",toggleMobileMenu);listen('#toc-btn',"click",toggleToc);listen('#img-btn',"click",showImg);listen('.bg-img',"click",hideImg);window.addEventListener('scroll',throttle(()=>{autoHideHeader();if(mobileMenuVisible==true){toggleMobileMenu();}},250));}

+ 1
- 1
themes/hermit/resources/_gen/assets/js/js/main.js_d11fe7b62c27961c87ecd0f2490357b9.json View File

@ -1 +1 @@
{"Target":"js/main.min.de4d516d3e45a2fbe013b06aa4292cd08f6f04d55e780c03d9009bd99b05dcd4.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-3k1RbT5FovvgE7BqpCks0I9vBNVeeAwD2QCb2ZsF3NQ="}}
{"Target":"js/main.min.8f39f24808e9d0a9b02da58c2d2838da859dc0b7bdfadbdb1883aae8b6adacfe.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-jznySAjp0KmwLaWMLSg42oWdwLe9+tvbGIOq6LatrP4="}}

+ 1
- 1
themes/hermit/resources/_gen/assets/scss/scss/style.scss_c16d144eee185fbddd582cd5e25a4fae.content
File diff suppressed because it is too large
View File


+ 1
- 1
themes/hermit/resources/_gen/assets/scss/scss/style.scss_c16d144eee185fbddd582cd5e25a4fae.json View File

@ -1 +1 @@
{"Target":"css/style.min.135fc8fad10a71b52484489246b4082f46d6e09f1e54f16e3f9c3b1dd208db01.css","MediaType":"text/css","Data":{"Integrity":"sha256-E1/I+tEKcbUkhEiSRrQIL0bW4J8eVPFuP5w7HdII2wE="}}
{"Target":"css/style.min.9a30741782203507f3d35fe9cefabad487c72fc82dfbdf59121759fc2fa52f92.css","MediaType":"text/css","Data":{"Integrity":"sha256-mjB0F4IgNQfz01/pzvq61IfHL8gt+99ZEhdZ/C+lL5I="}}

Loading…
Cancel
Save