Add possibility to set up your own logotype in config

This commit is contained in:
panr 2018-07-25 00:28:34 +02:00
parent a4a62f2eff
commit 1ca7b86e6c
4 changed files with 16 additions and 4 deletions

View File

@ -8,6 +8,10 @@ paginate = 5
[params] [params]
subtitle = "A simple theme for Hugo" subtitle = "A simple theme for Hugo"
# [params.logo]
# path = "/img/your-example-logo.svg"
# alt = "your_example_logo"
[menu] [menu]
[[menu.main]] [[menu.main]]
identifier = "about" identifier = "about"

View File

@ -1,7 +1,11 @@
<a href="{{ .Site.BaseURL }}" style="text-decoration: none;"> <a href="{{ .Site.BaseURL }}" style="text-decoration: none;">
<div class="logo"> <div class="logo">
<span class="logo__mark">></span> {{ if .Site.Params.Logo }}
<span class="logo__text">hello friend</span> <img src="{{ .Site.Params.Logo.path }}" alt="{{ .Site.Params.Logo.alt }}" />
<span class="logo__cursor"></span> {{ else }}
<span class="logo__mark">></span>
<span class="logo__text">hello friend</span>
<span class="logo__cursor"></span>
{{ end }}
</div> </div>
</a> </a>

View File

@ -3,6 +3,10 @@
align-items: center; align-items: center;
text-decoration: none; text-decoration: none;
img {
height: 44px;
}
&__mark { &__mark {
margin-right: 5px; margin-right: 5px;
} }

File diff suppressed because one or more lines are too long