Merge pull request #407 from scosti/master
logo - append text according to current url path
This commit is contained in:
commit
f928062c5c
3 changed files with 14 additions and 1 deletions
|
@ -20,3 +20,13 @@ menuTrigger &&
|
|||
);
|
||||
|
||||
window.addEventListener("resize", isMobileMenu);
|
||||
|
||||
const language = document.getElementsByTagName('html')[0].lang;
|
||||
const logo = document.querySelector(".logo__pathname");
|
||||
if(logo){
|
||||
window.onload = () => {
|
||||
let path = window.location.pathname.substring(1);
|
||||
path = path.replace(language+'/','')
|
||||
logo.textContent += path.substring(0,path.indexOf('/'));
|
||||
};
|
||||
}
|
|
@ -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 —
|
||||
# it’s a return to the roots of the internet.
|
||||
|
|
|
@ -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 }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue