Page Value: slug
SLUG attribute in the header allows a page name to be overwritten in the URL
rather than using the file name.
This value can also be used to override the URL. By setting the permalinks
value for posts to the /:slug attribute.
This prevents/removes the default url of /posts
being prefixed on each document URL.
This is most useful for conversions from my old system.
In order for the chronological ARCHIVES log to continue to work, pages are
still located in the /posts source directory.
https://gohugo.io/content-management/organization#slug
# Post Header Value
slug: hugo_notes
# config.yml
permalinks:
posts: /:slug
Page Value: alias
On a page/post header, the alias attribute will allow alternative URL’s to automatically redirect to the current page. Useful for site conversions from other systems to keep external links working.
# Placed on a page header
aliases: [/hugo_redirect_test/]
Posting Code
Theme Adjustment (when I have more time)
https://github.com/adityatelange/hugo-PaperMod/discussions/119
<pre><\pre>
does not work well due to highlighting.
Styling is needed when in PaperMod LIGHT mode.
(I should file a bug or suggest a solution)
select * from dual;
select * from dual;
Using tripple tick `
and a syntax typing
-- Auto Type is thrown off when you mix types
select * from dual;
<value1>Some Value</value1>
-- SQL
select * from dual;
-- TEXT
select * from dual;
Using Blank Line and Indentation
select * from dual;
Different language
<html> <body> Some body </body> </html>
Tripple tick `
inline works well.
Just remember to end the line
code here
Image Processing
Basic processing such as size
https://gohugo.io/content-management/image-processing/
Dynamic Image Selection based on responsive size
https://mertbakir.gitlab.io/hugo/image-processing-in-hugo/
Additional Notes
Notes and details from HUGO
Privacy
Hugo ships with several Built-in Shortcodes for rich content, along with a Privacy Config and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.
Reference
Hugo Quick Start | https://gohugo.io/getting-started/quick-start/ |
Short Codes | https://gohugo.io/content-management/shortcodes/ |
Taxonomies | https://gohugo.io/content-management/taxonomies/ |
Organization | https://gohugo.io/content-management/organization/ |
GitLab Pages
GitLab Pages - Hosting on GitLab
GitLab Pages - Starting
Hugo + Fedora + Snap
https://gohugo.io/hugo-pipes/postcss/
If you are using the Hugo Snap package, PostCSS and plugin(s) need to be installed
locally within your Hugo site directory,
e.g., npm install postcss-cli
without the -g
flag.
Condition for Dates
https://discourse.gohugo.io/t/content-is-it-same-for-page-and-post-and-how-to-hide-date/2246/3
Image Gallery
- Broken in the default
https://pages.gitlab.io/hugo/post/2017-03-20-photoswipe-gallery-sample/
- Needs research / implementation
https://github.com/liwenyip/hugo-easy-gallery/
Links to External Locations in New Tab
- New Template Condition : https://digitaldrummerj.me/hugo-links-to-other-pages/
<a href="{{ .Destination | safeURL }}"
{{ with .Title}} title="{{ . }}"{{ end }}
{{ if or (strings.HasPrefix .Destination "http") (strings.HasPrefix .Destination "https") }}
target="_blank"
{{ end }} >
{{ .Text | safeHTML }}
</a>