Update demo

This commit is contained in:
Aditya Telange 2023-12-15 21:52:06 +05:30
parent 0dfff4e1ce
commit ff475e3fd7
No known key found for this signature in database
GPG key ID: 82E844EF3DA99E77
15 changed files with 590 additions and 556 deletions

View file

@ -1,20 +1,18 @@
---
title: "FAQs"
summary: Frequently Asked Questions
title: "FAQs / How To's Guide"
summary: We'll try to answer frequently asked qestions by users.
date: 2021-01-20
aliases: ["/papermod-how-to-guide"]
tags: ["PaperMod"]
author: "Aditya Telange"
tags: ["PaperMod", "Docs"]
author: ["PaperMod Contributors"]
draft: true
aliases: [/posts/papermod/papermod-how-to]
weight: 3
---
## Intro
- **We'll be using `yml/yaml` format for all examples down below, I recommend using `yml` over `toml` as it is easier to read.**
- You can find any [YML to TOML](https://www.google.com/search?q=yml+to+toml) converters if necessary.
> - **We'll be using `yml/yaml` format for all examples down below, I recommend using `yml` over `toml` as it is easier to read.**
>
> - You can find any [YML to TOML](https://www.google.com/search?q=yml+to+toml) converters if necessary.
---
@ -43,9 +41,9 @@ When Hugo builds your site, your copy of `list.html` will be used instead of the
These include OpenGraph, Twitter Cards and Schema.
```yml
```yml {linenos=true}
params:
env: production
env: production
```
or set `HUGO_ENV` as "production" in system env-vars
@ -62,23 +60,23 @@ Why was the `asset` not loading ? : [How_browsers_handle_Subresource_Integrity](
Set the following in `config.yml`
```yml
```yml {linenos=true}
params:
assets:
disableFingerprinting: true
assets:
disableFingerprinting: true
```
Linked Issues:
- https://stackoverflow.com/questions/65056585/hugo-theme-not-loading
- https://stackoverflow.com/questions/65040931/hugo-failed-to-find-a-valid-digest-in-the-integrity-attribute-for-resource
- https://blog.gerardbeckerleg.com/posts/hugo-failed-to-find-a-valid-digest-in-the-integrity-attribute-for-resource/
- https://stackoverflow.com/questions/65056585/hugo-theme-not-loading
- https://stackoverflow.com/questions/65040931/hugo-failed-to-find-a-valid-digest-in-the-integrity-attribute-for-resource
- https://blog.gerardbeckerleg.com/posts/hugo-failed-to-find-a-valid-digest-in-the-integrity-attribute-for-resource/
---
## Bundling Custom css with theme's assets
- For adding custom css to be bundled inside one minimized css
- For adding custom css to be bundled inside one minimized css
Create folder in yout project directory as
@ -100,7 +98,7 @@ All `css` files inside `assets/css/extended` will be bundled !
Linked Issues:
- [Papermod Theme: How to add custom CSS?](https://discourse.gohugo.io/t/papermod-theme-how-to-add-custom-css/30165)
- [Papermod Theme: How to add custom CSS?](https://discourse.gohugo.io/t/papermod-theme-how-to-add-custom-css/30165)
---
@ -135,21 +133,21 @@ You can add menu entries which will appear in the header of every page.
To do so, add a `menu` section to your site's `config.yml`:
```yml
```yml {linenos=true}
menu:
main:
- identifier: categories
name: categories
url: /categories/
weight: 10
- identifier: tags
name: tags
url: /tags/
weight: 20
- identifier: example
name: example.org
url: https://example.org
weight: 30
main:
- identifier: categories
name: categories
url: /categories/
weight: 10
- identifier: tags
name: tags
url: /tags/
weight: 20
- identifier: example
name: example.org
url: https://example.org
weight: 30
```
`name` controls what will be displayed for the menu entry.
@ -166,22 +164,20 @@ Post can be pinned/ displayed top on the list by adding a `weight=<num>` var to
example:
```yml
```yml {linenos=true}
---
title: "My Important post"
date: 2020-09-15T11:30:03+00:00
weight: 1
---
```
```yml
```yml {linenos=true}
---
title: "My 2nd Important post"
date: 2020-09-15T11:30:03+00:00
weight: 2
---
```
---
@ -191,43 +187,39 @@ weight: 2
We support the following paths under `/static` directory
and can be added accordingly.
- `favicon.ico`
- `favicon-16x16.png`
- `favicon-32x32.png`
- `apple-touch-icon.png`
- `safari-pinned-tab.svg`
- `favicon.ico`
- `favicon-16x16.png`
- `favicon-32x32.png`
- `apple-touch-icon.png`
- `safari-pinned-tab.svg`
1. Favicon(s) can be generated by [Favicon.io](https://favicon.io)
and can be simply put in `/static` folder.
1. Favicon(s) can be generated by [Favicon.io](https://favicon.io) and can be simply put in `/static` folder.
2. Other way is to add favicon(s) NOT located in `/static` folder.
In site config add the following:
In site config add the following:
```
params:
assets:
favicon: "<link / absolute url>"
favicon16x16: "<link / absolute url>"
favicon32x32: "<link / absolute url>"
apple_touch_icon: "<link / absolute url>"
safari_pinned_tab: "<link / absolute url>"
```
```yml {linenos=true}
params:
assets:
favicon: "<link / absolute url>"
favicon16x16: "<link / absolute url>"
favicon32x32: "<link / absolute url>"
apple_touch_icon: "<link / absolute url>"
safari_pinned_tab: "<link / absolute url>"
```
- `absolute url` means direct links to external resource: ex. https://web.site/someimage.png
Note: `absolute url` means direct links to external resource: ex. `https://web.site/someimage.png`
example:
```
params:
assets:
favicon: "/favicon.ico"
favicon16x16: "/favicon-16x16.png"
favicon32x32: "/favicon-32x32.png"
apple_touch_icon: "/apple-touch-icon.png"
safari_pinned_tab: "/safari-pinned-tab.svg"
```
```yml {linenos=true}
params:
assets:
favicon: "/favicon.ico"
favicon16x16: "/favicon-16x16.png"
favicon32x32: "/favicon-32x32.png"
apple_touch_icon: "/apple-touch-icon.png"
safari_pinned_tab: "/safari-pinned-tab.svg"
```
---
@ -235,7 +227,7 @@ and can be added accordingly.
Add `#center` after image to center align an image
```md
```md {linenos=true}
![name](path/to/image.png#center)
```
@ -243,9 +235,7 @@ Add `#center` after image to center align an image
use `align=center` to center image with captions
ex.
```md
```md {linenos=true}
{{</* figure align=center src="image.jpg" */>}}
```
@ -255,38 +245,38 @@ ex.
1. Disable Highlight.js in site `config.yml`
```yml
params:
assets:
disableHLJS: true
```
```yml {linenos=true}
params:
assets:
disableHLJS: true
```
2. Set hugo's markdown styling in site `config.yml`
```yml
markup:
highlight:
# anchorLineNos: true
codeFences: true
guessSyntax: true
lineNos: true
# noClasses: false
style: monokai
```
```yml {linenos=true}
markup:
highlight:
# anchorLineNos: true
codeFences: true
guessSyntax: true
lineNos: true
# noClasses: false
style: monokai
```
3. If you want `lineNos: true`, the background won't be proper.
This will only work with `noClasses: false` or `pygmentsUseClasses: true`.
Read [Generate Syntax Highlighter CSS](https://gohugo.io/content-management/syntax-highlighting/#generate-syntax-highlighter-css)
Add the following to `assets/css/extended/custom.css`
Add the following to `assets/css/extended/custom.css`
```css
.chroma {
background-color: unset;
}
```
```css {linenos=true}
.chroma {
background-color: unset;
}
```
More Info : [Configure Markup - Highlight](https://gohugo.io/getting-started/configuration-markup#highlight)
More Info : [Configure Markup - Highlight](https://gohugo.io/getting-started/configuration-markup#highlight)
---
@ -302,7 +292,7 @@ We have used this insted of assigning `baseURL` so as to work with multilingual
To fix for _single_ language websites hosting assets from CDN, this you may [override](#override-theme-template) [fastsearch.js#L35](https://github.com/adityatelange/hugo-PaperMod/blob/fb4988cfb6d0d6e4e489f17d89f0fa618def3396/assets/js/fastsearch.js#L35) and placing appropriate URL as in
```js
```js {linenos=true}
xhr.open("GET", "https://example.com/index.json");
```
@ -310,4 +300,4 @@ xhr.open("GET", "https://example.com/index.json");
## References
- [Override a Hugo theme](https://zwbetz.com/override-a-hugo-theme/)
- [Override a Hugo theme](https://zwbetz.com/override-a-hugo-theme/)