From 5f481fecfba02836f61350b22032dcd452cefd04 Mon Sep 17 00:00:00 2001 From: "kebler.net" Date: Wed, 10 Nov 2021 13:01:14 -0800 Subject: [PATCH] feat: added 404 template for use with caddy refactor: navbar to include draft div when on draft site feat: add abaility for text shadow to hero text rename page.css to sections.css --- layouts/404.html | 13 +++ layouts/partials/404.html | 20 ++++ layouts/partials/head/css.html | 2 +- layouts/partials/head/styles.html | 121 ++++++---------------- layouts/partials/hero.html | 2 +- layouts/partials/js.html | 1 - layouts/partials/navbar.html | 27 ++--- layouts/partials/sections.html | 6 +- static/css/base.css | 6 +- static/css/navbar.css | 57 +++++++---- static/css/{page.css => sections.css} | 6 ++ static/js/lorem.js | 141 -------------------------- static/js/page.js | 11 +- 13 files changed, 141 insertions(+), 272 deletions(-) create mode 100644 layouts/404.html create mode 100644 layouts/partials/404.html rename static/css/{page.css => sections.css} (98%) delete mode 100644 static/js/lorem.js diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..493a61e --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,13 @@ + + +{{ partial "head.html" . }} + +{{ if ne .Site.Params.navbar.hidden true }} + {{ partial "navbar.html" . }} +{{ end }} +
+{{ partial "404.html" . }} +
+{{ partial "js.html" . }} + + diff --git a/layouts/partials/404.html b/layouts/partials/404.html new file mode 100644 index 0000000..489996a --- /dev/null +++ b/layouts/partials/404.html @@ -0,0 +1,20 @@ +
+
+
+

Whoops!

+

Content Load Error

+
+
+ The content you tried to load does not exist.
+
continue by clicking here
+
+
+
+ + diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html index c4ceb1a..3a38afd 100644 --- a/layouts/partials/head/css.html +++ b/layouts/partials/head/css.html @@ -16,7 +16,7 @@ - + diff --git a/layouts/partials/head/styles.html b/layouts/partials/head/styles.html index 9978285..27bf013 100644 --- a/layouts/partials/head/styles.html +++ b/layouts/partials/head/styles.html @@ -6,7 +6,8 @@ {{ $sections := .Site.Params.sections }} {{ $modal := .Site.Params.modal }} {{ $buttons := .Site.Params.buttons }} - + {{ $imagesurl := .Site.Params.imagesurl | default ( printf "%simages/" ( $.Site.BaseURL | default "" )) }} + {{ $filesurl := .Site.Params.filesurl | default "./assets/assets/" }} {{ $dark_color:=.Site.Params.dark_color }} {{ $light_color:=.Site.Params.light_color }} @@ -18,10 +19,10 @@ {{ $bg_color := $navbar.bg_color | default $dark_color }} {{ $color := $navbar.color | default $light_color }} - .nav-bar__menu-item:hover {color: {{ $bg_color }}; } - .nav-bar, .section--footer { background-color: {{ $bg_color }}; } - .nav-bar__logo, .nav-bar__menu, .nav-bar__menu-button, .section--footer { color: {{ $color }}; } - .nav-bar__menu-item:hover { background-color: {{ $color }}; } + .nav-bar__menu-item:hover, .nav-bar__menu-item >a:hover {color: {{ $bg_color }}; } + .nav-bar__container, .section--footer { background-color: {{ $bg_color }}; } + .nav-bar__logo,.nav-bar__logo:hover, .nav-bar__menu, .nav-bar__menu-button, .section--footer { color: {{ $color }}; } + .nav-bar__menu-item:hover, .nav-bar__menu-item >a:hover { background-color: {{ $color }}; } {{ with $navbar.font }} .nav-bar__logo, .nav-bar__menu { font-family:{{ . }},Helvetica,Arial,sans-serif; } @@ -45,95 +46,37 @@ /* HERO */ -{{ if ne .Site.Params.hero.custom_hero true }} - {{ $bg_color := .Params.bg_color | default $light_color }} - + {{ if ne .Site.Params.hero.custom_hero true }} + + {{ $bg_color := $hero.bg_color | default $light_color }} {{ $color := $hero.color | default $dark_color }} - #hero { color: {{ $color }}; } - #hero { background-color: {{ $bg_color }}; } - #hero h1 { color: {{ $hero.headline_color | default $color }}; } - #hero h2 { color: {{ $hero.subheadline_color | default $color }}; } - #hero h3 { color: {{ $hero.subsubheadline_color | default $color }}; } - #hero h4 { color: {{ $hero.lines_color | default $color }}; } - #hero hr { border-top-color: {{ $hero.divider_color | default $color }}; } - + #hero { color: {{ $color }}; } - {{ with $hero }} + #hero { background-color: {{ $bg_color }}; } + {{ if eq $hero.text_shadow true }} + #hero { text-shadow: + {{ $hero.text_shadow_horz | default 2 }}px + {{ $hero.text_shadow_vert | default 2 }}px + {{ $hero.text_shadow_blur | default 0 }}px + {{ $hero.text_shadow_color | default $bg_color }}; } + {{ end}} + {{/* #hero { text-shadow: -1px 1px 2px white, + 1px 1px 2px white, + 1px -1px 0 white, + -1px -1px 0 white + } */}} + #hero h1 { color: {{ $hero.headline_color | default $color }}; } + #hero h2 { color: {{ $hero.subheadline_color | default $color }}; } + #hero h3 { color: {{ $hero.subsubheadline_color | default $color }}; } + #hero h4 { color: {{ $hero.lines_color | default $color }}; } + #hero hr { border-top-color: {{ $hero.divider_color | default $color }}; } +{{ $image := .Site.Params.hero.img | default "hero.jpg" }} +/* TODO mobile image substitution */ +{{ $image := print $imagesurl $image }} + #hero { background-image: url("{{ $image }}"); } - {{ with $.Site.Params.imagespath }} - {{ $.Scratch.Set "path" ( . ) }} - {{ else }} - {{ $.Scratch.Set "path" ( printf "%s/images/" ( $.Site.BaseURL | default "" ) ) }} - {{ end }} - #hero { - background-image: url("{{ $.Scratch.Get "path" }}{{ .img | default "hero.jpg" }}"); - } - - {{ with .font }} - #hero > .section__container { font-family:{{ . }},Helvetica,Arial,sans-serif;} - {{ end }} - - - - {{ if and ( .text_outline ) ( .text_shadow ) }} - #hero > .section__container { - text-shadow: - -2px -2px 0 {{ .text_outline }}, - 2px -2px 0 {{ .text_outline }}, - -2px 2px 0 {{ .text_outline }}, - 2px 2px 0 {{ .text_outline }}, - -7px -3px 0 {{ .text_shadow }}; - } - {{ else }} - - {{ with .text_outline }} - #hero > .section__container { - text-shadow: - -2px -2px 0 {{ . }}, - 2px -2px 0 {{ . }}, - -2px 2px 0 {{ . }}, - 2px 2px 0 {{ . }}; - } - {{ end }} - - {{ with .text_shadow }} - #hero > .section__container { - text-shadow: - -7px -3px 0 {{ . }} - } - {{ end }} - - {{ end }} - - - {{ with .headlines_font }} - #hero h1, #hero h2, #hero h3 { font-family: "{{ . }}",Helvetica,Arial,sans-serif; } - {{ end }} - - {{ with .headline_size }} - #hero h1 { font-size: {{ . }}em; } - {{ end }} - - {{ with .subheadline_size }} - #hero h2 { font-size: {{ . }}em; } - {{ end }} - - {{ with .subsubheadline_size }} - #hero h3 { font-size: {{ . }}em; } - {{ end }} - - {{ with .lines_size }} - #hero h4 { font-size: {{ . }}em; } - {{ end }} - - {{ with .divider_thickness }} - #hero hr { border-width: {{ . }}px; } - {{ end }} - - - {{ end }} /* end with hero */ {{ end }} /* end not custom hero diff --git a/layouts/partials/hero.html b/layouts/partials/hero.html index afc7281..0f98096 100644 --- a/layouts/partials/hero.html +++ b/layouts/partials/hero.html @@ -1,6 +1,6 @@
-
+
{{ with .Site.Params.hero }} {{ with .headline }}

{{ . }}

{{ end }} {{ with .subheadline }}

{{ . }}

{{ end }} diff --git a/layouts/partials/js.html b/layouts/partials/js.html index a76a3a3..96210b4 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -16,7 +16,6 @@ - {{ if isset .Site.Params "googleAnalytics" }} {{ end }} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 29f61aa..833ac0a 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -1,24 +1,27 @@ -