From 5047a8d02e117c005c303517003ad2129b7bdfec Mon Sep 17 00:00:00 2001 From: Niklas Buschmann Date: Wed, 5 Feb 2020 21:54:37 +0100 Subject: [PATCH] merge upstream --- README.md | 58 +++++++++++++++++------------------- layouts/_default/baseof.html | 7 ++--- static/css/classes.css | 14 +-------- static/css/sidebar.css | 36 ++++++++++------------ 4 files changed, 47 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 30d7bb1..db91b5e 100644 --- a/README.md +++ b/README.md @@ -7,50 +7,46 @@ To install Contrast as your default theme, first install this repository in the $ cd themes/ $ git clone https://github.com/niklasbuschmann/contrast-hugo.git -Second, specify `contrast-hugo` as your default theme in the `config.toml` file. Just add the line +Second, specify `contrast-hugo` as your default theme in the `config.yaml` file. Just add the line - theme = "contrast-hugo" + theme: "contrast-hugo" at the top of the file. -## Options - -In the `params` section of your config, you can enable a dark header style with `darkheader = true` and [icon](https://fontawesome.com/icons) support with `fontawesome = true` - which can be used by adding `pre` entries to your site's [menu](https://gohugo.io/content-management/menus/). The site title in the header can also be hidden with `hidetitle = true`. - ## Sidebar -Instead of the horizontal menu, a sidebar can be enabled with `sidebar = true`. See [here](https://niklasbuschmann.github.io/contrast/) for an example of the sidebar in action. Adding a `hidden` class to the icon tag will hide the icon on mobile devices. +Instead of the horizontal menu, a sidebar can be enabled with `sidebar: true`. See [here](https://niklasbuschmann.github.io/contrast/) for an example of the sidebar in action. Adding a `hidden` class to the icon tag will hide the icon on mobile devices. -An example `config.yaml` could look like this: +An example `config.yaml` section could look like this: ```yaml params: - sidebar = true - fontawesome = true - description = 'Made by John Doe' + sidebar: true + fontawesome: true + description: 'Made by Blog Author' menu: main: - - identifier = "home" - name = "Home" - url = "/" - weight = 1 - pre = "" - - identifier = "about" - name = "About" - url = "/about/" - weight = 2 - pre = "" - - identifier = "github" - name = "Github" - url = "https://github.com/" - weight = 3 - pre = "" - - identifier = "feed" - name = "Subscribe" - url = "/index.xml" - weight = 4 - pre = "" + - identifier: "home" + name: "Home" + url: "/" + weight: 1 + pre: "" + - identifier: "about" + name: "About" + url: "/about/" + weight: 2 + pre: "" + - identifier: "github" + name: "Github" + url: "https://github.com/" + weight: 3 + pre: "" + - identifier: "feed" + name: "Subscribe" + url: "/index.xml" + weight: 4 + pre: "" ``` ## Features diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index ac31931..035389f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -22,10 +22,9 @@ {{ partial "math.html" . }} {{- end }} -
- {{ $url := .RelPermalink }} - {{ if not .Site.Params.hidetitle }}{{ .Site.Title }}{{ end }} - {{ range .Site.Menus }}{{ end }} +
+ {{ if not (gt (len .Site.Menus) 1) }}{{ .Site.Title }}{{ end }} + {{ range .Site.Menus }}{{ end }} {{ with .Site.Params.description }}{{ end }}
diff --git a/static/css/classes.css b/static/css/classes.css index 19cf715..0fef62e 100644 --- a/static/css/classes.css +++ b/static/css/classes.css @@ -1,9 +1,3 @@ -.dark { - background: #1e1f25; - color: #fff; - border-bottom: 1px solid rgba(255, 255, 255, 0.05); -} - .archive li { font-size: 1.1em; } @@ -14,16 +8,10 @@ margin: 0 .2em; } -.full > a { - font-size: 1.5em; - width: 100%; - margin: .1em 0 .6em; -} - .hidden { display: none; } .fa, .fab, .fad, .fal, .far, .fas { - margin-right: .6em; + margin-right: 1.2em; } diff --git a/static/css/sidebar.css b/static/css/sidebar.css index a076e56..ad55dab 100644 --- a/static/css/sidebar.css +++ b/static/css/sidebar.css @@ -1,11 +1,10 @@ body { - font-size: 18px; - padding: 0 4em; + font-size: 1.08em; margin-left: 16em; } -body > article, body > footer { - margin: 0 auto; +body > article { + margin: 0 4em; padding: 2em 0; max-width: 55em; } @@ -17,7 +16,7 @@ body > header { color: #fff; border: none; box-shadow: none; - opacity: .96; + opacity: .98; margin: 0; padding: 2.2em 2em; width: 12em; @@ -37,30 +36,27 @@ nav a { } nav a:hover, nav a.selected { - background: #23242a; + background: #212228; text-decoration: inherit; } -nav a svg { - margin-right: 1.2em; +body > header > a { + font-family: "PT Serif", Georgia; + font-size: 2.2em; + display: block; + margin: 0 0 1.5rem; } article header h1 { font-size: 2em; } +header > div { + position: absolute; + margin: 2em 0; + bottom: 0; +} + .hidden { display: inline-block; } - -header > div { - margin-top: 3em; -} - -body > header > a { - display: none; -} - -.fa, .fab, .fad, .fal, .far, .fas { - margin-right: 1.2em; -}