mirror of https://github.com/onweru/compose.git

weru
08.11.2020 ebef8d3e199de1e0850102245333cb2982e1fb3e
edit page
1 files added
2 files modified
74 ■■■■ changed files
exampleSite/content/docs/clarity/customize.md 35 ●●●●● patch | view | raw | blame | history
exampleSite/content/docs/clarity/features.md 2 ●●●●● patch | view | raw | blame | history
exampleSite/content/docs/clarity/theme-overrides.md 37 ●●●●● patch | view | raw | blame | history
exampleSite/content/docs/clarity/customize.md
@@ -75,25 +75,6 @@
If using Google Analytics, configure the `ga_analytics` global parameter in your site with your ID.
### Custom CSS and JS
To minimize HTTP requests per page, we would recommend loading CSS styles and JavaScript helpers in single bundles. That is to say, one CSS file and one JavaScript file. Using Hugo minify functions, these files will be minified to optimize the size.
Going by the above 👆🏻 reason, we recommend adding custom CSS and JS via [this custom SASS file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_custom.sass) and [custom JavaScript file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/js/custom.js).
However, sometimes you may need to load additional style or script files. In such cases, you can add custom `.css` and `.js` files by listing them in the `config.toml` file (see the snippet below). Similar to images, these paths should be relative to the `static` directory.
```yaml
[params]
...
customCSS = ["css/custom.css"] # Include custom CSS files
customJS = ["js/custom.js"] # Include custom JS files
...
```
> __Pro Tip__: You can change the theme colors via the [this variable's SASS file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_variables.sass)
### Forcing light or dark mode
By default, sites authored using Clarity will load in the browser with the user's system-wide settings. I.e., if the underlying OS is set to dark mode, the site will automatically load in dark mode. Regardless of the default mode, a UI control switch exists to override the theme mode at the user's discretion.
@@ -139,22 +120,6 @@
sed '/^\[pt]$/,$d' -i config/_default/languages.toml   &&   rm config/_default/menus/menu.pt.toml
```
### Hooks
Clarity provides some hooks for adding code on page.
If you need to add some code(CSS import, HTML meta or similar) to the head section on every page, add a partial to your project:
```
layouts/partials/hooks/head-end.html
```
Similar, if you want to add some code right before the body end, create your own version of the following file:
```
layouts/partials/hooks/body-end.html
```
### Comments
Clarity supports Hugo built-in Disqus partial, you can enable Disqus simply by setting [`disqusShortname`](https://gohugo.io/templates/internal/#configure-disqus) in your configuration file.
exampleSite/content/docs/clarity/features.md
@@ -3,8 +3,6 @@
Weight: 13
---
## Features
* Blog with tagging and category options
* Deeplinks
* Native Image Lazy Loading
exampleSite/content/docs/clarity/theme-overrides.md
New file
@@ -0,0 +1,37 @@
+++
title = "Theme Overrides"
+++
### Custom CSS and JS
To minimize HTTP requests per page, we would recommend loading CSS styles and JavaScript helpers in single bundles. That is to say, one CSS file and one JavaScript file. Using Hugo minify functions, these files will be minified to optimize the size.
Going by the above 👆🏻 reason, we recommend adding custom CSS and JS via [this custom SASS file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_custom.sass) and [custom JavaScript file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/js/custom.js).
However, sometimes you may need to load additional style or script files. In such cases, you can add custom `.css` and `.js` files by listing them in the `config.toml` file (see the snippet below). Similar to images, these paths should be relative to the `static` directory.
```yaml
[params]
...
customCSS = ["css/custom.css"] # Include custom CSS files
customJS = ["js/custom.js"] # Include custom JS files
...
```
> __Pro Tip__: You can change the theme colors via the [this variable's SASS file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_variables.sass)
### Hooks
Clarity provides some hooks for adding code on page.
If you need to add some code(CSS import, HTML meta or similar) to the head section on every page, add a partial to your project:
```
layouts/partials/hooks/head-end.html
```
Similar, if you want to add some code right before the body end, create your own version of the following file:
```
layouts/partials/hooks/body-end.html
```