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

github.com/gyorb/hugo-dusk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGyorgy Orban <o.gyorgy@gmail.com>2017-11-18 16:26:42 +0300
committerGitHub <noreply@github.com>2017-11-18 16:26:42 +0300
commit0f403803674f93f08a71fc3049d7eee16c5d1800 (patch)
tree634af2e45f751f7a2632e0cffdb7dad5338b8321
parentbd3909f96196607ea55556789d58648821c7b441 (diff)
parent49d0a3615b235703175adb90ff6b237714a837ab (diff)
Merge pull request #11 from gyorb/coloring_support
add theme color configuration support
-rw-r--r--README.md9
-rw-r--r--exampleSite/config.toml8
-rw-r--r--layouts/partials/head.html4
-rw-r--r--layouts/partials/theme-colors.css62
-rw-r--r--theme.toml2
5 files changed, 83 insertions, 2 deletions
diff --git a/README.md b/README.md
index a864fd4..e052e71 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,7 @@ Simple minimalistic dark theme for [Hugo](https://gohugo.io/).
## Features
* Responsive minimalistic design
+* Configurable theme colors
* Syntax highlight with [highlight.js](https://highlightjs.org/)
* [OpenGraph](http://ogp.me/), [Twitter cards](https://dev.twitter.com/cards/overview) support
* [Disqus](https://disqus.com/) comments support
@@ -64,4 +65,12 @@ SectionPagesMenu = "main"
twitter = "twitter id"
linkedin = "linkedin id"
email = "myemail"
+
+[params.colors]
+ # hugo-dusk colors
+ background = "#101010" # background color for the site
+ main = "#99cc66"
+ text = "#dbdbdb"
+ code-quote-back = "#1D1F21" # background color for quotes and code blocks
+ copyright = "#404040" # copyright text color
~~~~
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index fa012ad..020b4da 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -36,3 +36,11 @@ SectionPagesMenu = "main"
#gitlab = "gitlab id"
twitter = "twitter id"
#linkedin = "linkedin id"
+
+[params.colors]
+ # hugo-dusk colors
+ background = "#101010" # background color for the site
+ main = "#99cc66"
+ text = "#dbdbdb"
+ code-quote-back = "#1D1F21" # background color for quotes and code blocks
+ copyright = "#404040" # copyright text color
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index c3e45aa..fe1dae4 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -14,7 +14,9 @@
{{ template "_internal/schema.html" . }}
<link rel="stylesheet" href="css/layout.css" />
-<link rel="stylesheet" href="css/color-dark.css" />
+<style type="text/css">
+{{ partial "theme-colors.css" . | safeCSS }}
+</style>
{{ template "_internal/google_analytics_async.html" . }}
diff --git a/layouts/partials/theme-colors.css b/layouts/partials/theme-colors.css
new file mode 100644
index 0000000..d1f03d0
--- /dev/null
+++ b/layouts/partials/theme-colors.css
@@ -0,0 +1,62 @@
+body {
+ background-color: {{ .Param "colors.background" }};
+ color: {{ .Param "colors.text" }};
+}
+
+a { color: {{ .Param "colors.text" }}; }
+
+pre {
+ background: {{ .Param "colors.code-back" }};
+ border: 1px solid {{ .Param "colors.text" }};
+ border-radius: 5px;
+}
+
+code {
+ background: {{ .Param "colors.code-back" }};
+}
+
+blockquote {
+ background: {{ .Param "colors.code-back" }};
+ border-left: 3px solid {{ .Param "colors.text" }};
+}
+
+table {
+ margin: 1em auto;
+ border-collapse: collapse;
+}
+
+table, th, td {
+ border: 1px solid {{ .Param "colors.text" }};
+}
+
+th {
+ background: {{ .Param "colors.text" }};
+ color: {{ .Param "colors.background" }};
+}
+
+.siteTitle a { color: {{ .Param "colors.main" }}; }
+
+.post .content h1{ color: {{ .Param "colors.main" }}; }
+.post .content h2{ color: {{ .Param "colors.main" }}; }
+.post .content h3{ color: {{ .Param "colors.main" }}; }
+.post .content h4{ color: {{ .Param "colors.main" }}; }
+.post .content h5{ color: {{ .Param "colors.main" }}; }
+.post .content h6{ color: {{ .Param "colors.main" }}; }
+.post .content a:hover { color: {{ .Param "colors.main" }}; }
+.social-link:hover { color: {{ .Param "colors.main" }}; }
+.nav-item-title:hover { color: {{ .Param "colors.main" }}; }
+.tag a:hover { color: {{ .Param "colors.main" }}; }
+.copyright { color: {{ .Param "colors.copyright" }} }
+.poweredby { color: {{ .Param "colors.copyright" }} }
+.poweredby a { color: {{ .Param "colors.copyright" }}; }
+.post-preview .title a{ color: {{ .Param "colors.main" }}; }
+.content-item a:hover{
+ text-decoration: underline;
+ color: {{ .Param "colors.main" }};
+}
+.post-list .title { color: {{ .Param "colors.main" }}; }
+.rmore { color: {{ .Param "colors.main" }}; }
+.terms .term a:hover {
+ text-decoration: underline;
+ color: {{ .Param "colors.main" }};
+}
diff --git a/theme.toml b/theme.toml
index 350657f..21696f0 100644
--- a/theme.toml
+++ b/theme.toml
@@ -5,7 +5,7 @@ description = "A minimalistic dark responsive theme."
homepage = "https://github.com/gyorb/hugo-dusk"
tags = ["blog", "minimal", "clean", "dark"]
features = ["blog"]
-min_version = 0.17
+min_version = 0.20
[author]
name = "Gyorgy Orban"