Skip to content

Commit

Permalink
refactor: change header and menu option
Browse files Browse the repository at this point in the history
displayHeader -> enableHeader
displayMenu   -> enableMenu

BREAKING CHANGE: config.toml option changed
displayHeader -> enableHeader
displayMenu   -> enableMenu
  • Loading branch information
reuixiy committed Aug 13, 2019
1 parent 2ca9432 commit 4baf725
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
48 changes: 26 additions & 22 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,33 +113,37 @@

@import "_common/fonts.scss";

@import "_common/header.scss";
.site-brand {
{{ with .Site.Params.siteBrandBackgroundColor }}
background-color: {{ . }}
{{ end }}
{{ with .Site.Params.siteBrandBackgroundImage }}
background-image: {{ . }};
{{ end }}
}
{{ if .Site.Params.siteBrandSVG }}
.brand {
width: {{ .Site.Params.siteBrandSVGWidth }}px;
height: {{ .Site.Params.siteBrandSVGHeight }}px;
fill: {{ .Site.Params.siteBrandSVGFill }};
{{ if .Site.Params.enableHeader }}
@import "_common/header.scss";
.site-brand {
{{ with .Site.Params.siteBrandBackgroundColor }}
background-color: {{ . }}
{{ end }}
{{ with .Site.Params.siteBrandBackgroundImage }}
background-image: {{ . }};
{{ end }}
}
{{ else }}
.brand {
font-size: {{ .Site.Params.siteBrandFontSize }}em;
color: {{ .Site.Params.siteBrandFontColor }};
text-decoration: none;
&:hover {
{{ if .Site.Params.siteBrandSVG }}
.brand {
width: {{ .Site.Params.siteBrandSVGWidth }}px;
height: {{ .Site.Params.siteBrandSVGHeight }}px;
fill: {{ .Site.Params.siteBrandSVGFill }};
}
{{ else }}
.brand {
font-size: {{ .Site.Params.siteBrandFontSize }}em;
color: {{ .Site.Params.siteBrandFontColor }};
text-decoration: none;
&:hover {
color: {{ .Site.Params.siteBrandFontColor }};
}
}
}
{{ end }}
{{ end }}

@import "_common/menu.scss";
{{ if .Site.Params.enableMenu }}
@import "_common/menu.scss";
{{ end }}

{{ if or .Site.Params.enablePostMeta .Site.Params.enablePostMetaInHome }}
@import "_common/post-meta.scss";
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if or (and .IsHome .Site.Params.displayHeaderInHome) (and (not .IsHome) .Site.Params.displayHeader) }}
{{ if or (and .IsHome .Site.Params.displayHeaderInHome) (and (not .IsHome) .Site.Params.enableHeader) }}
<header class="header">
<div class="site-brand">
{{ if .Site.Params.siteBrandSVG }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/menu.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if or (and .IsHome .Site.Params.displayMenuInHome) (and (not .IsHome) .Site.Params.displayMenu) }}
{{ if or (and .IsHome .Site.Params.displayMenuInHome) (and (not .IsHome) .Site.Params.enableMenu) }}
<nav class="nav">
<ul class="menu" id="menu">
{{ $currentPage := .Site.GetPage (printf `/%s` .Section) }}
Expand Down

0 comments on commit 4baf725

Please sign in to comment.