Skip to content

Commit

Permalink
Documentation for the 'theme_config' setting (#634)
Browse files Browse the repository at this point in the history
The 'theme_config' setting, for configuring themes in the primary _config.yml file is extremely useful.
It doesn't appear in the documentation, so this commit adds it.

The example code is taken directly from the original pull request: hexojs/hexo#757
  • Loading branch information
Jack Sullivan authored and NoahDragon committed Jan 18, 2018
1 parent ead1e5e commit 5529153
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions source/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Setting | Description | Default
Setting | Description
--- | ---
`theme` | Theme name. `false` disables theming
`theme_config` | Theme configuration. Include any custom theme settings under this key to override theme defaults.
`deploy` | Deployment setting


Expand Down Expand Up @@ -120,3 +121,32 @@ Using multiple files combines all the config files and saves the merged settings

For instance, in the above example if `foo: bar` is in `custom.yml`, but `"foo": "dinosaur"` is in `custom2.json`, `_multiconfig.yml` will contain `foo: dinosaur`.

### Overriding Theme Config

Hexo themes are independent projects, with separate `_config.yml` files.

Instead of forking a theme, and maintaining a custom branch with your settings, you can configure it from your site's primary configuration file.

Example configuration:

```yml
# _config.yml
theme_config:
bio: "My awesome bio"
```

```yml
# themes/my-theme/_config.yml
bio: "Some generic bio"
logo: "a-cool-image.png"
```

Resulting theme configuration:

```json
{
bio: "My awesome bio",
logo: "a-cool-image.png"
}
```

0 comments on commit 5529153

Please # to comment.