diff options
author | edavidaja <edavidaja@gmail.com> | 2020-04-25 20:18:50 +0300 |
---|---|---|
committer | edavidaja <edavidaja@gmail.com> | 2020-04-25 20:18:50 +0300 |
commit | 10645c920f0719600d3789961ae83f97832d3996 (patch) | |
tree | e1955b6a033fbcbad59d71d23c0f1759757f2832 | |
parent | 211ceb1fe1f3cc842f955f504d78701ada214f8a (diff) |
added configurable brand color to theme
- use hugo extended image from gitlab registry
- update README
- main.css is moved to scss template
- example site config modified to reflect brand_color option
- commit resources so users not using extended can install
- bumped min hugo version since no testing on intermediate versions
-rw-r--r-- | .gitlab-ci.yml | 2 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | assets/sass/template.scss (renamed from static/assets/css/main.css) | 8 | ||||
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | exampleSite/resources/_gen/assets/scss/sass/template.scss_a4f67715571c07e60af265b7eb62fb3e.content | 1 | ||||
-rw-r--r-- | exampleSite/resources/_gen/assets/scss/sass/template.scss_a4f67715571c07e60af265b7eb62fb3e.json | 1 | ||||
-rw-r--r-- | layouts/partials/head.html | 4 | ||||
-rw-r--r-- | theme.toml | 2 |
8 files changed, 20 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4dd4bcc..55198dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: registry.gitlab.com/pages/hugo:latest +image: registry.gitlab.com/pages/hugo_extended:latest variables: GIT_SUBMODULE_STRATEGY: recursive @@ -20,3 +20,7 @@ The sidebar will be built automatically from the content in `page`. You can use ### posts You can create blog posts in `post`. The most recent five by date will be displayed on the home page. + +## brand color + +You can set the color for the website using the `brand_color` option in `config.toml`. This requires the use of `hugo-extended`.
\ No newline at end of file diff --git a/static/assets/css/main.css b/assets/sass/template.scss index dd55f90..c99b593 100644 --- a/static/assets/css/main.css +++ b/assets/sass/template.scss @@ -1,3 +1,7 @@ +$brand_color: {{ .Site.Params.brand_color | default "#0039ac" }}; + +// main + /* Main.css ================================== @@ -182,7 +186,7 @@ Navigation .sidebar-nav li:active, .sidebar-nav .sidebar-nav-active { color: #75787b; - border-left: 4px solid #0039ac; + border-left: 4px solid $brand_color; background-color: transparent; border-bottom: 1px solid #babbbd; } @@ -246,7 +250,7 @@ section:before { header { width: 100%; - border-bottom: 4px solid #0039ac; + border-bottom: 4px solid $brand_color; background-color: #fff; padding: 2em 0; } diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 508db86..bd0cc2b 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -28,3 +28,6 @@ theme = "docter" # main sections # change the main section to set the directory where the top articles are sourced mainSections = ["post"] + + # brand color + # brand_color = "#7300ac"
\ No newline at end of file diff --git a/exampleSite/resources/_gen/assets/scss/sass/template.scss_a4f67715571c07e60af265b7eb62fb3e.content b/exampleSite/resources/_gen/assets/scss/sass/template.scss_a4f67715571c07e60af265b7eb62fb3e.content new file mode 100644 index 0000000..6b6f43f --- /dev/null +++ b/exampleSite/resources/_gen/assets/scss/sass/template.scss_a4f67715571c07e60af265b7eb62fb3e.content @@ -0,0 +1 @@ +*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html,body{height:100%}body{font-family:open sans,Arial,sans-serif;font-weight:400;font-style:normal;line-height:1.466666667}h1,h3,h4,h5,strong{font-family:open sans,Arial,sans-serif;font-weight:600}.site-title{font-size:1.625em;font-family:open sans,Arial,sans-serif;font-weight:400;color:#919395;margin:0;line-height:1.2941176470588236;display:inline-block}h2{font-weight:400;font-style:normal;font-size:1.375em;margin:1.4em 0 0}h4{font-size:1em;text-transform:uppercase}.page-title{margin-top:.727272727em}.main-content ul{padding-left:1.1em}.main-content li{margin-bottom:1em}li h3,li h4{margin:0}li p{margin-top:0}a{-webkit-transition:.2s;-moz-transition:.2s;transition:.2s}a,a:link,a:visited{color:#0072ce;border-bottom:1px dotted #0072ce;text-decoration:none}a:hover{border-bottom:1px solid #7eb8dd;color:#7eb8dd;text-decoration:none}a:active{border-bottom:1px solid #002d72;color:#002d72;text-decoration:none}a:focus{border-bottom:1px solid #0072ce;color:#0072ce;outline:thin dotted;text-decoration:none}a.title-link{color:#75787b;border-bottom:none}a.title-link:hover,a.title-link:active,a.title-link:focus{color:#7eb8dd;border-bottom:none}a.skip-link{color:#0072ce;border-bottom:none;padding:.25em}a.skip-link:hover,a.skip-link:active,a.skip-link:focus{background-color:#0072ce;color:#fff;border-bottom:none}.sidebar-nav a{display:block;padding:10px;-webkit-transition:unset;transition:unset}.sidebar-nav a,.sidebar-nav a:link,.sidebar-nav a:visited{border-bottom:none;color:#75787b}.sidebar-nav li:hover,.sidebar-nav a:focus,.sidebar-nav li:active,.sidebar-nav .sidebar-nav-active{color:#75787b;border-left:4px solid #0039ac;background-color:transparent;border-bottom:1px solid #babbbd}.sidebar-nav li:hover,.sidebar-nav li:active,.sidebar-nav .sidebar-nav-active{padding-left:0}.sidebar-nav a:focus{padding-left:6px}.sidebar-nav li:hover a:focus,.sidebar-nav li:active a:focus{border-left:none;padding-left:10px}.sidebar-nav ul{margin:0;padding:0}.sidebar-nav li{list-style:none;border-bottom:1px solid #babbbd;font-size:1.125em;padding-left:4px}.sidebar-nav li:last-child{border-bottom:none}.logo{display:block}.content{padding-top:2em;padding-bottom:2em}section:before{display:block;content:"";height:60px;margin:-60px 0 0}.wrap{max-width:1200px;margin:0 auto;padding-left:20px;padding-right:20px}header{width:100%;border-bottom:4px solid #0039ac;background-color:#fff;padding:2em 0}.container{display:table;height:100%;width:100%}footer{display:table-row;height:1px;border-top:2px solid #babbbd;background:#f1f2f2;width:100%;font-size:.875em}footer .wrap{padding-top:2em;padding-bottom:2em}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.intro{color:#75787b}li h4{margin:0}.license{font-family:open sans,Arial,sans-serif;font-weight:400;font-style:normal}pre{max-width:100%;font-size:.875em;overflow-y:scroll;background-color:#f1f2f2;padding:10px}ul.posts{padding:0}.posts li{list-style:none}.post-date{color:#75787b}ul.repo-list{margin:.5em 0 1em;padding:0}.repo-list li{list-style:none}.repo-list p{margin:0;font-size:.875em}.repo-list h4{text-transform:none}.group:before,.group:after{content:" ";display:table}.group:after{clear:both}.group{*zoom:1}@media screen and (min-width:45em) and (min-height:32.5em){.logo{max-width:30%;padding-right:20px;float:right}aside{width:30%;float:left}.main-content{width:67%;float:right;margin-bottom:120px}.repo-list li{list-style:none;display:block;float:left;height:4.0625em;max-height:4.0625em;background-color:#e7e7e6;border-left:1px solid #babbbd;width:30%}.repo-list a:link,.repo-list a:visited{display:block;max-height:4.0625em;background-color:#e7e7e6;border-bottom:none;padding:.625em 1em 1em}.repo-list a:hover{color:#4d5f87;background-color:#cde3f1}.repo-list li:first-child{text-align:center;border-left:none;line-height:60px;padding:.625em 1em;width:10%}}@media screen and (max-width:54.375em) and (min-height:32.5em){.repo-list li{height:6em;max-height:6em}.repo-list a:link,.repo-list a:visited{max-height:6em}}@media screen and (max-width:40.5em){.main-content{margin-top:1.5em}}
\ No newline at end of file diff --git a/exampleSite/resources/_gen/assets/scss/sass/template.scss_a4f67715571c07e60af265b7eb62fb3e.json b/exampleSite/resources/_gen/assets/scss/sass/template.scss_a4f67715571c07e60af265b7eb62fb3e.json new file mode 100644 index 0000000..875c206 --- /dev/null +++ b/exampleSite/resources/_gen/assets/scss/sass/template.scss_a4f67715571c07e60af265b7eb62fb3e.json @@ -0,0 +1 @@ +{"Target":"main.min.a4d98ec492518b88ee795eea910fb95bf2d9dfefec6213db90fb211aef46afa2.css","MediaType":"text/css","Data":{"Integrity":"sha256-pNmOxJJRi4jueV7qkQ+5W/LZ3+/sYhPbkPshGu9Gr6I="}}
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 1cdf055..9dab550 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -7,7 +7,9 @@ <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="{{ .Site.BaseURL }}assets/css/normalize.css"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet"> - <link rel="stylesheet" href="{{ .Site.BaseURL }}assets/css/main.css"> + {{ $sassTemplate := resources.Get "sass/template.scss" }} + {{ $style := $sassTemplate | resources.ExecuteAsTemplate "main.scss" . | toCSS | minify | fingerprint }} + <link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}"> <link rel="stylesheet" href="{{ .Site.BaseURL }}assets/css/syntax.css"> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> @@ -7,7 +7,7 @@ description = "docter for hugo" homepage = "https://github.com/edavidaja/docter" tags = ["documentation", "blog"] features = ["blog"] -min_version = "0.41" +min_version = "0.69.2" [author] name = "edavidaja" |