Theme Files Update

This commit is contained in:
GitHub Action 2023-10-15 11:10:47 +00:00
parent bdde5ebff0
commit e27a5df3b4
3 changed files with 0 additions and 13 deletions

View file

@ -121,13 +121,6 @@ If you prefer to use different analytics system other than google analytics, the
If you'd like to customize theme color or fonts, you can simply override `assets/scss/_predefined.scss`, by simply copy it to site's root (keep the same relative path) then edit those variables. But keep in mind, you'll need **Hugo extended version** which has the ability to rebuild SCSS. You don't have to use extended version in production but in this case it's necessary to make sure the `resources` folder is committed and "up to date" (by running `hugo` or `hugo server` locally using the extended version). But anyway, always use the extended version if you can. If you'd like to customize theme color or fonts, you can simply override `assets/scss/_predefined.scss`, by simply copy it to site's root (keep the same relative path) then edit those variables. But keep in mind, you'll need **Hugo extended version** which has the ability to rebuild SCSS. You don't have to use extended version in production but in this case it's necessary to make sure the `resources` folder is committed and "up to date" (by running `hugo` or `hugo server` locally using the extended version). But anyway, always use the extended version if you can.
For adding other custom CSS to the theme, you can assign an array of references in `config.toml` like following:
```
[params]
customCSS = ["css/foo.css", "css/bar.css"]
```
You may reference as many stylesheets as you want. Their paths need to be relative to the `static` folder or it can be a full URL for external resources.
#### Code injection #### Code injection
You can inject any html code to every page's document head or right above the closing body tag. This makes it easier to add any html meta data, custom css/js, dns-prefetch etc. To do this you simply need to create a file at site's `layouts/partials/extra-head.html` or `layouts/partials/extra-foot.html`, code inside will be injected to every page. You can inject any html code to every page's document head or right above the closing body tag. This makes it easier to add any html meta data, custom css/js, dns-prefetch etc. To do this you simply need to create a file at site's `layouts/partials/extra-head.html` or `layouts/partials/extra-foot.html`, code inside will be injected to every page.

View file

@ -89,9 +89,6 @@ enableEmoji = true
relatedPosts = true # Add a related content section to all single posts page relatedPosts = true # Add a related content section to all single posts page
code_copy_button = true # Turn on/off the code-copy-button for code-fields code_copy_button = true # Turn on/off the code-copy-button for code-fields
# Add custom css
# customCSS = ["css/foo.css", "css/bar.css"]
# Social Icons # Social Icons
# Check https://github.com/Track3/hermit#social-icons for more info. # Check https://github.com/Track3/hermit#social-icons for more info.

View file

@ -18,9 +18,6 @@
{{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}} {{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}}
<link rel="stylesheet" href="{{ $style.Permalink }}" {{ printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"> <link rel="stylesheet" href="{{ $style.Permalink }}" {{ printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous">
{{- block "head" . -}}{{- end }} {{- block "head" . -}}{{- end }}
{{- range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
{{- if templates.Exists "partials/extra-head.html" -}} {{- if templates.Exists "partials/extra-head.html" -}}
{{ partial "extra-head.html" . }} {{ partial "extra-head.html" . }}
{{- end }} {{- end }}