add site-js setting

This commit is contained in:
Dean Attali 2020-09-12 16:59:47 +00:00
parent 2128b1c48b
commit 53cf8f01db
5 changed files with 22 additions and 13 deletions

View File

@ -5,26 +5,26 @@ One of the major changes in this version is that a lot of time was spent on reth
#### Breaking changes
- Renamed `description` YAML parameter to `share-description` to be more clear
- Renamed `description` config parameter to `rss-description` since it was only used in RSS (the FAQ explains the difference between YAML parameters and config parameters if you're confused)
- Renamed `description` config setting to `rss-description` since it was only used in RSS (the FAQ explains the difference between YAML parameters and config settings if you're confused)
- Removed YAML parameter `use-site-title` (you can now specify the exact title using `share-title`)
- Removed undocumented YAML parameters `meta-title` and `meta-description`
- Removed `link-tags` config parameter because it wasn't necessary. If you use tags, there will now always be a tags page created; if you don't use tags there won't be a tags page.
- The YAML setting `show-avatar` is now true by default. This has always been the case for GitHub Pages users, but not for `remote_theme` users. For consistency, it's now the default for everyone. (#715)
- Removed `link-tags` config setting because it wasn't necessary. If you use tags, there will now always be a tags page created; if you don't use tags there won't be a tags page.
- The YAML parameter `show-avatar` is now true by default. This has always been the case for GitHub Pages users, but not for `remote_theme` users. For consistency, it's now the default for everyone. (#715)
#### New parameters
#### New parameters and settings
- Added `full-width` YAML parameter to allow having full-width pages
- Added `feed_show_excerpt` config parameter to show/hide the post excerpts on the feed page
- Added `feed_show_tags` config parameter to show/hide the list of tags on post previews on the feed page
- Added `feed_show_excerpt` config setting to show/hide the post excerpts on the feed page
- Added `feed_show_tags` config setting to show/hide the list of tags on post previews on the feed page
- Added `share-title` YAML parameter to give control over the search engine/social media title
- Added `before-content` and `after-content` YAML parameters that allow you to add some common HTML before the main content of a page (below the title) or after the main content (above the footer). Works in a similar way to `footer-extra`.
- Added `head-extra` YAML parameter which is similar to `footer-extra` but is used to include custom HTML code in a page's `<head>` tag
- Added `site-js` config setting to provide JavaScript files that are used on all pages in the site
#### New features and improvements
- Improved the `footer-extra` YAML parameter to support multiple files instead of only a single file
- Added automatic navbar color detection (#702)
- Added a blank template CSS file `assets/css/custom.css` that's automatically included in all pages that can be used to overwrite any default Beautiful Jekyll ruless
- When `nav-short` is turned on, the avatar will also be shorter
- Changed navbar and footer background colour to be slightly darker, for better contrast with the default white page background for accessibility reasons
- Changed the behaviour of `site-css` to include site-wide CSS file **before** instead of after page-specific files

View File

@ -243,7 +243,7 @@ Beautiful Jekyll is used by 50,000+ people with wildly varying degrees of web sk
- ### How do I change the number of posts per page OR the colour of the navigation bar OR the image in the navigation bar OR ...?
Beautiful Jekyll is built to be very customizable, and as such, many questions about "how do I change ..." can be answered by looking at the `_config.yml` file and modifying the parameters there.
Beautiful Jekyll is built to be very customizable, and as such, many questions about "how do I change ..." can be answered by looking at the `_config.yml` file and modifying the settings there.
- ### What's the difference between the config file and the YAML parameters?
@ -255,7 +255,7 @@ Beautiful Jekyll is used by 50,000+ people with wildly varying degrees of web sk
- ### How do I make small modifications to how my website looks?
If you want to make any visual changes that are not in `_config.yml`, you'll need to add your own CSS rules to the file `assets/css/custom.css` in order to overwrite the default Beautiful Jekyll style. If you don't know how to use CSS, I highly recommend spending 30 minutes to [learn the basics](https://www.w3schools.com/css/).
If you want to make any visual changes that are not in `_config.yml`, you'll need to add your own CSS rules to the file `assets/css/custom-styles.css` and enable the `site-css` setting in the config file. This will allow you to overwrite the default Beautiful Jekyll styles. If you don't know how to use CSS, I highly recommend spending 30 minutes to [learn the basics](https://www.w3schools.com/css/).
- ### How do I use a custom domain for my site?
@ -271,7 +271,7 @@ Beautiful Jekyll is used by 50,000+ people with wildly varying degrees of web sk
- ### How do I move the blog to another page instead of having it on the home page?
The default style of Beautiful Jekyll is to feature the blog feed on the front page. For some sites that's not the ideal structure, and you may want to have a separate dedicated page for the blog posts. To have the blog hosted on a different URL (for example at `<mysite.com>/blog`), copy the `index.html` file into a folder with the same name as the desired page (for example, to `blog/index.html`), and in the `_config.yml` file you need to add a parameter `paginate_path: "/<page name>/page:num/"` (for example `paginate_path: "/blog/page:num/"`).
The default style of Beautiful Jekyll is to feature the blog feed on the front page. For some sites that's not the ideal structure, and you may want to have a separate dedicated page for the blog posts. To have the blog hosted on a different URL (for example at `<mysite.com>/blog`), copy the `index.html` file into a folder with the same name as the desired page (for example, to `blog/index.html`), and in the `_config.yml` file you need to add a setting `paginate_path: "/<page name>/page:num/"` (for example `paginate_path: "/blog/page:num/"`).
- ### How do I use math equations in my posts?

View File

@ -115,10 +115,14 @@ footer-link-col: "#404040"
# Suggest a colour for mobile browsers to use as the browser's theme. This is only supported by a few mobile browsers.
#mobile-theme-col: "#0085A1"
# For any extra customization, you can include additional CSS files in every page on your site. List any custom CSS files here
# For any extra visual customization, you can include additional CSS files in every page on your site. List any custom CSS files here
#site-css:
# - "/assets/css/custom-styles.css"
# If you have common JavaScript files that should be included in every page, list them here
#site-js:
# - "/assets/js/custom-script.js"
# --- Web Analytics Section --- #
# Fill in your Google Analytics gtag.js ID to track your website using gtag

View File

@ -19,6 +19,12 @@
{% endfor %}
{% endif %}
{% if site.site-js %}
{% for js in site.site-js %}
<script src="{{ js | relative_url }}"></script>
{% endfor %}
{% endif %}
{% if page.ext-js %}
{% for js in page.ext-js %}
{% include ext-js.html js=js %}

View File

@ -1 +0,0 @@
/* Add your own CSS rules here to overwrite any Beautiful Jekyll defaults */