Allow <head> and footer scripts to be changed via config (#1241)

* Allow `<head>` and footer scripts to be changed via config
* Update JavaScript documentation

Close #1238
This commit is contained in:
Michael Rose
2017-09-12 12:27:36 -04:00
committed by GitHub
parent 93c4fbc4b9
commit 8fc9bccda8
8 changed files with 83 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
title: "Configuration"
permalink: /docs/configuration/
excerpt: "Settings for configuring and customizing the theme."
last_modified_at: 2017-09-12T10:38:09-04:00
last_modified_at: 2017-09-12T12:25:16-04:00
---
Settings that affect your entire site can be changed in [Jekyll's configuration file](https://jekyllrb.com/docs/configuration/): `_config.yml`, found in the root of your project. If you don't have this file you'll need to copy or create one using the theme's [default `_config.yml`](https://github.com/mmistakes/minimal-mistakes/blob/master/_config.yml) as a base.
@@ -167,6 +167,21 @@ If you don't set `repository` correctly you may see the following error when try
For more information on how `site.github` data can be used with Jekyll check out [`github-metadata`'s documentation](https://github.com/jekyll/github-metadata).
### Site Scripts
Add scripts to the `<head>` or closing `</body>` elements by assigning paths to either `head_scripts` and/or `footer_scripts`.
For example, to add a CDN version of jQuery to page's head along with a custom script you'd do the following:
```yaml
head_scripts:
- https://code.jquery.com/jquery-3.2.1.min.js
- /assets/js/your-custom-head-script.js
```
Consult the [JavaScript documentation]({{ site.baseurl }}{% link _docs/17-javascript.md %}) for more information on working with theme scripts.
{: .notice--info}
### Site Default Teaser Image
To assign a fallback teaser image used in the "**Related Posts**" module, place a graphic in the `/assets/images/` directory and add the filename to `_config.yml` like so: