Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/niklasbuschmann/contrast-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Buschmann <niklasbuschmann@posteo.org>2020-02-05 23:54:37 +0300
committerNiklas Buschmann <niklasbuschmann@posteo.org>2020-02-05 23:54:37 +0300
commit5047a8d02e117c005c303517003ad2129b7bdfec (patch)
tree892fa9b6b90a4b0fcd803f82897bc9ce48893aea
parent068f48121bfb417de867e2e27ab8a55d023a7622 (diff)
merge upstream
-rw-r--r--README.md58
-rw-r--r--layouts/_default/baseof.html7
-rw-r--r--static/css/classes.css14
-rw-r--r--static/css/sidebar.css34
4 files changed, 46 insertions, 67 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 <a href="">John Doe</a>'
+ sidebar: true
+ fontawesome: true
+ description: 'Made by <a href="">Blog Author</a>'
menu:
main:
- - identifier = "home"
- name = "Home"
- url = "/"
- weight = 1
- pre = "<span class='fas fa-home hidden'></span>"
- - identifier = "about"
- name = "About"
- url = "/about/"
- weight = 2
- pre = "<span class='fas fa-address-card hidden'></span>"
- - identifier = "github"
- name = "Github"
- url = "https://github.com/"
- weight = 3
- pre = "<span class='fab fa-github hidden'></span>"
- - identifier = "feed"
- name = "Subscribe"
- url = "/index.xml"
- weight = 4
- pre = "<span class='fas fa-rss hidden'></span>"
+ - identifier: "home"
+ name: "Home"
+ url: "/"
+ weight: 1
+ pre: "<span class='fas fa-home hidden'></span>"
+ - identifier: "about"
+ name: "About"
+ url: "/about/"
+ weight: 2
+ pre: "<span class='fas fa-address-card hidden'></span>"
+ - identifier: "github"
+ name: "Github"
+ url: "https://github.com/"
+ weight: 3
+ pre: "<span class='fab fa-github hidden'></span>"
+ - identifier: "feed"
+ name: "Subscribe"
+ url: "/index.xml"
+ weight: 4
+ pre: "<span class='fas fa-rss hidden'></span>"
```
## 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 }}
-<header class="{{ if .Site.Params.darkheader }}dark{{ end }} {{ if gt (len .Site.Menus) 1 }}full{{ end }}">
- {{ $url := .RelPermalink }}
- {{ if not .Site.Params.hidetitle }}<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>{{ end }}
- {{ range .Site.Menus }}<nav>{{ range . }}<a href="{{ .URL }}" {{ if (eq $url .URL) }}class="selected"{{ end }}>{{ .Pre }}{{ .Name }}{{ .Post }}</a>{{ end }}</nav>{{ end }}
+<header>
+ {{ if not (gt (len .Site.Menus) 1) }}<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>{{ end }}
+ {{ range .Site.Menus }}<nav>{{ range . }}<a href="{{ .URL }}" {{ if (eq $.RelPermalink .URL) }}class="selected"{{ end }}>{{ .Pre }}{{ .Name }}{{ .Post }}</a>{{ end }}</nav>{{ end }}
{{ with .Site.Params.description }}<div class="hidden">{{ safeHTML . }}</div>{{ end }}
</header>
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;
}
-.hidden {
- display: inline-block;
-}
-
header > div {
- margin-top: 3em;
-}
-
-body > header > a {
- display: none;
+ position: absolute;
+ margin: 2em 0;
+ bottom: 0;
}
-.fa, .fab, .fad, .fal, .far, .fas {
- margin-right: 1.2em;
+.hidden {
+ display: inline-block;
}