Theme Files Update
This commit is contained in:
parent
dd0cc8f02d
commit
680dbbd43f
15 changed files with 69 additions and 20 deletions
18
README.md
18
README.md
|
@ -1,6 +1,6 @@
|
|||
# Hugo theme Hermit - V2
|
||||
|
||||
### Why Am I maintaing a fork?
|
||||
### Why Am I maintaining a fork?
|
||||
|
||||
Initially, when I started my Blog journey, I was enthralled by this very theme and I am using it since. However, original developer has ceased maintaining the theme and it is riddled with many bugs. Hence, I have taken upon myself to maintain this theme.
|
||||
|
||||
|
@ -11,7 +11,21 @@ I fully intend to keep the essence of the theme as-it-is and only add minor upda
|
|||
DEMO : [Hermit-V2](https://1bl4z3r.github.io/hermit-V2/)
|
||||
|
||||
GoHugo Theme Page : [https://themes.gohugo.io/themes/hermit-v2/](https://themes.gohugo.io/themes/hermit-v2/)
|
||||
---
|
||||
|
||||
### Installation
|
||||
|
||||
Run this command from the root of your Hugo directory:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/1bl4z3r/hermit-V2 themes/hermit-v2
|
||||
```
|
||||
|
||||
Or, if your Hugo site is already in git, you can include this repository as a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules). This makes it easier to update this theme. For this you need to run:
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/1bl4z3r/hermit-V2 themes/hermit-v2
|
||||
```
|
||||
|
||||
# Original README follows below
|
||||
|
||||
Hermit is a minimal and fast theme for Hugo. It's built for bloggers who want a simple and focused website.
|
||||
|
|
|
@ -99,16 +99,4 @@ if (header !== null) {
|
|||
toggleMobileMenu();
|
||||
}
|
||||
}, 250));
|
||||
}
|
||||
// Scroll to Top button Toggle
|
||||
//
|
||||
const scroll = document.querySelector(".scroll-up"), rootElement = document.documentElement;
|
||||
|
||||
function handleScroll() {
|
||||
if (rootElement.scrollTop / (rootElement.scrollHeight - rootElement.clientHeight) > 0.4) {
|
||||
scroll.classList.remove("hide");scroll.classList.add("show");
|
||||
} else {
|
||||
scroll.classList.add("hide");scroll.classList.remove("show");
|
||||
}
|
||||
}
|
||||
document.addEventListener("scroll", handleScroll);
|
||||
}
|
17
assets/js/mathjax/mathjax-assistant.js
Normal file
17
assets/js/mathjax/mathjax-assistant.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
||||
displayMath: [['$$','$$'], ['\\[', '\\]']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true
|
||||
},
|
||||
options: {
|
||||
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
|
||||
enableMenu: false
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('load', (event) => {
|
||||
document.querySelectorAll("mjx-container").forEach(function(x){
|
||||
x.parentElement.classList += 'has-jax'})
|
||||
});
|
7
assets/js/mathjax/mathjax-full@3_es5_tex-mml-svg.min.js
vendored
Normal file
7
assets/js/mathjax/mathjax-full@3_es5_tex-mml-svg.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
assets/js/scrollwatcher.js
Normal file
1
assets/js/scrollwatcher.js
Normal file
|
@ -0,0 +1 @@
|
|||
const scroll=document.querySelector(".scroll-up"),rootElement=document.documentElement;function handleScroll(){rootElement.scrollTop/(rootElement.scrollHeight-rootElement.clientHeight)>.4?(scroll.classList.remove("hide"),scroll.classList.add("show")):(scroll.classList.add("hide"),scroll.classList.remove("show"))}document.addEventListener("scroll",handleScroll);
|
6
assets/scss/_mathjax.scss
Normal file
6
assets/scss/_mathjax.scss
Normal file
|
@ -0,0 +1,6 @@
|
|||
.has-jax {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
background: inherit !important;
|
||||
border: none !important;
|
||||
font-size: 100%;
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
/* Error */ .chroma .err { color: #960050; background-color: #1e0010 }
|
||||
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
|
||||
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
|
||||
/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc }
|
||||
/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #55595ebb }
|
||||
/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
|
||||
/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
|
||||
/* Keyword */ .chroma .k { color: #66d9ef }
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
@import "normalize.scss";
|
||||
@import "syntax.scss";
|
||||
@import "animate.scss";
|
||||
@import "scroll.scss";
|
||||
@import "_scroll.scss";
|
||||
@import "_mathjax.scss";
|
||||
|
||||
/* Webkit Scrollbar Customize */
|
||||
::-webkit-scrollbar {
|
||||
|
|
|
@ -96,6 +96,11 @@ enableEmoji = true
|
|||
# customCSS = ["css/foo.css", "css/bar.css"]
|
||||
|
||||
scrollToTop = true # To enable Scroll to Top button Sitewide
|
||||
|
||||
# Enable global_mathjax to true, if you want MathJax support sitewide (if you have technical page)
|
||||
# You can enable Per-Page MathJax support by adding `mathjax : true` in Page frontmatter
|
||||
global_mathjax = false
|
||||
|
||||
# Social Icons
|
||||
# Check https://github.com/Track3/hermit#social-icons for more info.
|
||||
[[params.social]]
|
||||
|
|
BIN
images/hermit.png
Normal file
BIN
images/hermit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 220 KiB |
BIN
images/screenshot.png
Normal file
BIN
images/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
BIN
images/tn.png
Normal file
BIN
images/tn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
|
@ -35,12 +35,12 @@
|
|||
{{ if .Site.Params.code_copy_button | default true -}}
|
||||
{{ $codeCopy := resources.Get "js/code-copy.js" -}}
|
||||
{{ $script := slice $main $codeCopy | resources.Concat "js/bundle.js" | minify | fingerprint -}}
|
||||
<script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
||||
<script async src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
||||
{{ else -}}
|
||||
{{ $script := $main | minify | fingerprint -}}
|
||||
<script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
||||
<script async src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "mathjax.html" . }}
|
||||
{{- partial "analytics.html" . }}
|
||||
{{- if templates.Exists "partials/extra-foot.html" -}}
|
||||
{{ partial "extra-foot.html" . }}
|
||||
|
|
7
layouts/partials/mathjax.html
Normal file
7
layouts/partials/mathjax.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{ if or (.Site.Params.global_mathjax) (.Params.mathjax) }}
|
||||
<script type="text/javascript" async src="https://polyfill.io/v3/polyfill.min.js?features=es6" crossorigin="anonymous"></script>
|
||||
{{ $mathjaxf := resources.Get "js/mathjax/mathjax-full@3_es5_tex-mml-svg.min.js"}}
|
||||
{{ $mathjaxa := resources.Get "js/mathjax/mathjax-assistant.js"}}
|
||||
{{ $mathjaxscript := slice $mathjaxa $mathjaxf | resources.Concat "js/mathjaxs.js" | minify | fingerprint -}}
|
||||
<script type="text/javascript" id="MathJax-script" async src="{{ $mathjaxscript.Permalink }}" {{ printf "integrity=%q" $mathjaxscript.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
||||
{{ end }}
|
|
@ -3,4 +3,7 @@
|
|||
<noscript>
|
||||
<a href="#" class="scroll-up show">{{ partial "svg.html" (dict "context" . "name" "scrollup") }}</a>
|
||||
</noscript>
|
||||
{{ $scrollwatcher := resources.Get "js/scrollwatcher.js" -}}
|
||||
{{ $script := $scrollwatcher | minify | fingerprint -}}
|
||||
<script async src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
||||
{{ end }}
|
Loading…
Reference in a new issue