Theme Files Update

This commit is contained in:
GitHub Action 2023-11-04 13:07:47 +00:00
parent fd8f00f27a
commit 3eabdaf2b4
12 changed files with 98 additions and 9 deletions

View file

@ -1,7 +1,3 @@
/**
* Utils
*/
// Throttle
//
const throttle = (callback, limit) => {
@ -63,6 +59,23 @@ const toggleMobileMenu = () => {
}
}
// Social Share Toggle
//
let shareMenuVisible = false;
const shareMobileMenu = () => {
let shareMenu = document.getElementById('share-links');
if (shareMenuVisible == false) {
shareMenu.style.animationName = 'bounceInRight';
shareMenu.style.webkitAnimationName = 'bounceInRight';
shareMenu.style.display = 'block';
shareMenuVisible = true;
} else {
shareMenu.style.animationName = 'bounceOutRight';
shareMenu.style.webkitAnimationName = 'bounceOutRight'
shareMenuVisible = false;
}
}
// Featured Image Toggle
//
const showImg = () => {
@ -82,6 +95,7 @@ const toggleToc = () => {
if (header !== null) {
listen('#menu-btn', "click", toggleMobileMenu);
listen('#share-btn', "click", shareMobileMenu);
listen('#toc-btn', "click", toggleToc);
listen('#img-btn', "click", showImg);
listen('.bg-img', "click", hideImg);
@ -98,5 +112,8 @@ if (header !== null) {
if (mobileMenuVisible == true) {
toggleMobileMenu();
}
if (shareMenuVisible == true) {
shareMobileMenu();
}
}, 250));
}

View file

@ -0,0 +1,31 @@
#share-links {
position: fixed;
bottom: 7.0em;
right: 0.5em;
display: none;
padding: .6em 0.5em;
z-index: 1;
box-sizing: border-box;
box-shadow: -1px -2px 3px 0px rgba(0, 0, 0, 0.45);
background-color: $midnightblue;
ul {
list-style: none;
margin: 0;
padding: 0;
line-height: 2;
font-size: 1.2em;
a {
color: $highlight-grey;
&:hover,&:active,&:focus{
color: $text;
}
}
}
}
@media (max-width: 520px) {
#share-links {
right: 0.2em;
bottom: 8.0em;
}
}

View file

@ -5,6 +5,7 @@
@import "_scroll.scss";
@import "_admonition.scss";
@import "_mathjax.scss";
@import "_socialshare.scss";
/* Webkit Scrollbar Customize */
::-webkit-scrollbar {
@ -299,7 +300,7 @@ table {
#mobile-menu {
position: fixed;
bottom: 4.8em;
right: 1.5em;
right: 4.5em;
display: none;
padding: .6em 1.8em;
z-index: 1;
@ -904,7 +905,7 @@ a.footnote-ref {
}
#mobile-menu {
right: 1.2em;
right: 4.2em;
}
#home-subtitle {
font-size: 0.5em;

View file

@ -65,7 +65,7 @@ enableEmoji = true
# bgImg = ""
# gitUrl = "https://github.com/1bl4z3r/hermit-V2/tree/staging"
justifyContent = true
justifyContent = false
relatedPosts = true
code_copy_button = true
@ -76,6 +76,7 @@ enableEmoji = true
readTime = true
readTimeSeparator = "\u2026 \u23F2 Reading Time:"
# legacyLayout = false
shareSocial = true
[[params.socialLinks]]
name = "mastodon"

View file

@ -34,5 +34,8 @@ other = "Older"
[menu]
other = "Menu"
[share]
other = "Share"
[featuredImage]
other = "Featured Image"

View file

@ -34,5 +34,8 @@ other = "Previo"
[menu]
other = "Menú"
[share]
other = "Cuota"
[featuredImage]
other = "Imagen Presentada"

View file

@ -34,5 +34,8 @@ other = "Précédent"
[menu]
other = "Menu"
[share]
other = "Partager"
[featuredImage]
other = "Image sélectionnée"

View file

@ -31,5 +31,8 @@ other = "Precedente"
[menu]
other = "Menu"
[share]
other = "Condividere"
[featuredImage]
other = "Immagine in primo piano"

View file

@ -34,5 +34,8 @@ other = "旧"
[menu]
other = "菜单"
[share]
other = "分享"
[featuredImage]
other = "特色图片"

View file

@ -14,10 +14,11 @@
{{- end }}
{{- with .Params.toc -}}
<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 }}
{{- end -}}
{{- with .Site.Params.socialLinks -}}
<span class="hdr-social hide-in-mobile">{{ partialCached "social-icons.html" . }}</span>
{{- end -}}
{{- if and (not (eq .Site.Params.shareSocial nil)) (.Site.Params.shareSocial) -}}{{- partial "social-share.html" . -}}{{- end -}}
<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>

View file

@ -0,0 +1,21 @@
<button id="share-btn" class="hdr-btn" title="{{i18n "share"}}">{{- partial "svg.html" (dict "context" . "name" "share") -}}</button>
<div id="share-links" class="animated fast">
{{ $title := .Title }}
{{ $url := printf "%s" .Permalink }}
{{ $body := print $title ", by " .Site.Title "\n" .Params.description "\n\n" $url "\n" }}
<ul>
<li>
<a href="https://twitter.com/intent/tweet?hashtags=hermit2&amp;url={{ .Permalink }}&amp;text={{ .Title }}" target="_blank" rel="noopener" aria-label="Share on X">{{- partial "svg.html" (dict "context" . "name" "x") -}}</a>
</li>
<li>
<a href="https://facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" rel="noopener" aria-label="Share on Facebook">{{- partial "svg.html" (dict "context" . "name" "facebook") -}}</a>
</li>
<li>
<a href="mailto:?subject={{ .Title }}&amp;body={{ .Permalink }}" target="_self" rel="noopener" aria-label="Share on Email">{{- partial "svg.html" (dict "context" . "name" "email") -}}</a>
</li>
<li>
<a href="https://www.linkedin.com/shareArticle?mini=true&amp;url={{ .Permalink }}&amp;title={{ .Title }}&amp;summary={{ $body }}&amp;source={{.Site.BaseURL}}" target="_blank" rel="noopener" aria-label="Share on LinkedIn">{{- partial "svg.html" (dict "context" . "name" "linkedin") -}}</a>
</li>
</ul>
</div>

View file

@ -51,7 +51,7 @@
{{- else if (eq .name "author") -}}
<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-feather"><path d="M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z"></path><line x1="16" y1="8" x2="2" y2="22"></line><line x1="17.5" y1="15" x2="9" y2="15"></line></svg>
{{- else if (eq .name "scrollup") -}}
<svg fill="#3B3E48" width="64px" height="64px" viewBox="-2.4 -2.4 28.80 28.80" id="up-circle" data-name="Flat Color" xmlns="http://www.w3.org/2000/svg" class="icon flat-color" stroke="#3B3E48" stroke-width="0.00024000000000000003"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" stroke="#CCCCCC" stroke-width="0.9600000000000002"><circle id="primary" cx="12" cy="12" r="10" style="fill: #3B3E48;"></circle><path id="secondary" d="M15,14a1,1,0,0,1-.71-.29L12,11.41l-2.29,2.3a1,1,0,0,1-1.42-1.42l3-3a1,1,0,0,1,1.42,0l3,3a1,1,0,0,1,0,1.42A1,1,0,0,1,15,14Z" style="fill: #018574;"></path></g><g id="SVGRepo_iconCarrier"><circle id="primary" cx="12" cy="12" r="10" style="fill: #3B3E48;"></circle><path id="secondary" d="M15,14a1,1,0,0,1-.71-.29L12,11.41l-2.29,2.3a1,1,0,0,1-1.42-1.42l3-3a1,1,0,0,1,1.42,0l3,3a1,1,0,0,1,0,1.42A1,1,0,0,1,15,14Z" style="fill: #018574;"></path></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="#3B3E48" width="64px" height="64px" viewBox="-2.4 -2.4 28.80 28.80" id="up-circle" data-name="Flat Color" xmlns="http://www.w3.org/2000/svg" class="icon flat-color" stroke="#3B3E48" stroke-width="0.00024000000000000003"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" stroke="#CCCCCC" stroke-width="0.9600000000000002"><circle id="primary" cx="12" cy="12" r="10" style="fill: #3B3E48;"></circle><path id="secondary" d="M15,14a1,1,0,0,1-.71-.29L12,11.41l-2.29,2.3a1,1,0,0,1-1.42-1.42l3-3a1,1,0,0,1,1.42,0l3,3a1,1,0,0,1,0,1.42A1,1,0,0,1,15,14Z" style="fill: #018574;"></path></g><g id="SVGRepo_iconCarrier"><circle id="primary" cx="12" cy="12" r="10" style="fill: #3B3E48;"></circle><path id="secondary" d="M15,14a1,1,0,0,1-.71-.29L12,11.41l-2.29,2.3a1,1,0,0,1-1.42-1.42l3-3a1,1,0,0,1,1.42,0l3,3a1,1,0,0,1,0,1.42A1,1,0,0,1,15,14Z" style="fill: #018574;"></path></g></svg>
{{- else if (eq .name "discord") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M8.82889 11.203C7.86239 11.203 7.09937 12.0508 7.09937 13.0852C7.09937 14.1195 7.87935 14.9673 8.82889 14.9673C9.79538 14.9673 10.5584 14.1195 10.5584 13.0852C10.5754 12.0508 9.79538 11.203 8.82889 11.203ZM15.0178 11.203C14.0514 11.203 13.2883 12.0508 13.2883 13.0852C13.2883 14.1195 14.0683 14.9673 15.0178 14.9673C15.9843 14.9673 16.7474 14.1195 16.7474 13.0852C16.7474 12.0508 15.9843 11.203 15.0178 11.203Z" fill="currentColor"/><path d="M14.8477 18.3649C14.8874 18.4483 14.9381 18.5296 15.0005 18.6075C15.3663 19.0644 15.7387 19.5135 15.8832 19.687C16.1242 19.9764 16.4855 20.1329 16.8553 20.117C20.6839 19.9522 22.4053 17.6063 22.7126 17.1342C22.8526 16.919 22.9029 16.6887 22.9023 16.4867C22.8862 11.0873 20.6126 6.69288 20.3618 6.22299C20.2686 6.04849 20.1448 5.9213 20.0223 5.83024C17.6324 4.05442 15.3398 3.89258 14.7987 3.87945C14.4248 3.87037 14.1018 4.039 13.8908 4.28019C13.7833 4.40298 13.7069 4.53817 13.659 4.67843C12.4808 4.5498 11.3488 4.5684 10.3271 4.681C10.2848 4.54257 10.2137 4.40813 10.1111 4.28494C9.90289 4.03513 9.58304 3.87239 9.22517 3.87894C8.72884 3.88801 6.40341 4.02781 3.9777 5.83024C3.85516 5.9213 3.73139 6.04849 3.63825 6.22299C3.38742 6.69289 1.11365 11.0876 1.09774 16.4873C1.09715 16.6871 1.14634 16.9155 1.28416 17.1296C1.58866 17.6027 3.29601 19.9515 7.12649 20.1169C7.50079 20.1331 7.86486 19.9726 8.10512 19.6794C8.2521 19.5 8.63516 19.0311 9.00416 18.5683C9.06865 18.4874 9.12057 18.4028 9.16075 18.316C9.32759 18.3546 9.49869 18.391 9.67405 18.4248L9.67405 18.4248L9.68004 18.426C11.0465 18.681 12.6626 18.7747 14.4312 18.4443C14.5698 18.4206 14.7086 18.3942 14.8477 18.3649Z" stroke="currentColor" stroke-width="2"/></svg>
{{- else if (eq .name "admonition_note") -}}
@ -78,6 +78,8 @@
<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>
{{- else if (eq .name "posts_single_tags") -}}
<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-tag meta-icon"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>
{{- else if (eq .name "share") -}}
<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-share-2"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg>
{{- else -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather feather-link" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
{{- end -}}