append url pathname to logoText

This commit is contained in:
scosti 2023-01-26 00:43:08 +01:00
parent 345c1cb020
commit 153e94ecc0
3 changed files with 11 additions and 1 deletions

View file

@ -20,3 +20,10 @@ menuTrigger &&
);
window.addEventListener("resize", isMobileMenu);
const logo = document.querySelector(".logo__pathname");
if(logo){
window.onload = () => {
logo.textContent += window.location.pathname.substring(1);
};
}

View file

@ -138,6 +138,8 @@ disableHugoGeneratorInject = false
# logoCursorColor = "#67a2c9"
# Set to a valid CSS time value to change the animation duration, "0s" to disable.
# logoCursorAnimate = "2s"
# Append the current url pathname to logoText
# logoCursorPathname = true
# Commento is more than just a comments widget you can embed —
# its a return to the roots of the internet.

View file

@ -4,7 +4,8 @@
<img src="{{ .Site.Params.Logo.path }}" alt="{{ .Site.Params.Logo.alt }}" />
{{ else }}
<span class="logo__mark">{{ with .Site.Params.Logo.logoMark }}{{ . }}{{ else }}>{{ end }}</span>
<span class="logo__text">{{ with .Site.Params.Logo.logoText }}{{ . }}{{ else }}hello{{ end }}</span>
<span class="logo__text {{ with.Site.Params.Logo.logoCursorPathname}}logo__pathname{{ end }}">
{{ with .Site.Params.Logo.logoText }}{{ . }}{{ else }}hello{{ end }}</span>
<span class="logo__cursor" style=
"{{ with.Site.Params.Logo.logoCursorDisabled }}visibility:hidden;{{ end }}
{{ with.Site.Params.Logo.logoCursorColor }}background-color:{{ . }};{{ end }}