Browse Source

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

Added an option change the theme globally in the configs
digitalcraftsman 9 years ago
parent
commit
cd672f87b7
4 changed files with 17 additions and 8 deletions
  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 View File

60
 
60
 
61
 ![Hyde theme classes](https://f.cloud.github.com/assets/98681/1817044/e5b0ec06-6f68-11e3-83d7-acd1942797a1.png)
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
 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.
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 View File

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

+ 1
- 1
layouts/_default/single.html View File

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

+ 1
- 1
layouts/index.html View File

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