Bläddra i källkod

Merge pull request #15 from digitalcraftsman/change-theme-in-configs-globally

Added an option change the theme globally in the configs
digitalcraftsman 9 år sedan
förälder
incheckning
cd672f87b7
4 ändrade filer med 17 tillägg och 8 borttagningar
  1. 14
    5
      README.md
  2. 1
    1
      layouts/_default/list.html
  3. 1
    1
      layouts/_default/single.html
  4. 1
    1
      layouts/index.html

+ 14
- 5
README.md Visa fil

@@ -60,12 +60,21 @@ There are eight themes available at this time.
60 60
 
61 61
 ![Hyde theme classes](https://f.cloud.github.com/assets/98681/1817044/e5b0ec06-6f68-11e3-83d7-acd1942797a1.png)
62 62
 
63
-To use a theme, add anyone of the available theme classes to the `<body>` element in the `default.html` layout, like so:
63
+To use a theme, add the `themeColor` variable under `params``, like so:
64 64
 
65
-```html
66
-<body class="theme-base-08">
67
-  ...
68
-</body>
65
+**TOML**
66
+```toml
67
+theme = "hyde"
68
+
69
+[params]
70
+  themeColor = "theme-base-09"
71
+```
72
+
73
+**YAML**
74
+```
75
+theme: "hyde"
76
+params:
77
+  themeColor: "theme-base-09"
69 78
 ```
70 79
 
71 80
 To create your own theme, look to the Themes section of [included CSS file](https://github.com/poole/hyde/blob/master/public/css/hyde.css). Copy any existing theme (they're only a few lines of CSS), rename it, and change the provided colors.

+ 1
- 1
layouts/_default/list.html Visa fil

@@ -1,5 +1,5 @@
1 1
 {{ partial "head.html" . }}
2
-<body>
2
+<body class="{{ .Site.Params.themeColor }}">
3 3
 
4 4
 {{ partial "sidebar.html" . }}
5 5
 

+ 1
- 1
layouts/_default/single.html Visa fil

@@ -1,5 +1,5 @@
1 1
 {{ partial "head.html" . }}
2
-<body>
2
+<body class="{{ .Site.Params.themeColor }}">
3 3
 
4 4
 {{ partial "sidebar.html" . }}
5 5
 

+ 1
- 1
layouts/index.html Visa fil

@@ -1,5 +1,5 @@
1 1
 {{ partial "head.html" . }}
2
-<body>
2
+<body class="{{ .Site.Params.themeColor }}">
3 3
 
4 4
 {{ partial "sidebar.html" . }}
5 5