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 706c78ae07
commit 4dd1f16df6
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">
{{ if .Site.Params.Logo }}
<img src="{{ .Site.Params.Logo.path }}" alt="{{ .Site.Params.Logo.alt }}" />
{{ else }}
<span class="logo__mark">></span> <span class="logo__mark">></span>
<span class="logo__text">hello friend</span> <span class="logo__text">hello friend</span>
<span class="logo__cursor"></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