2021-12-29 - Changed to cheap shoes felt calf pain - Fourth day
After changed to SGD15 shoes, felt calf pain on the fourth day, slow moving.
After changed shoes, which is only SGD15, from Decathlon, performance is quite good compare with my old Nike, quite surprise. In fact, the distance should be also a bit longer as recorded in other days, I always jogging in same route.
Today, migrate a few windows from smaller SSD larger one.
Use dd
command to duplicate from old device to new device
Use Partition Assistant - AOMEI
to move the last partition to the end
Use disk manager
extend partition.
Download from https://github.com/gohugoio/hugo/releases
Create folder Hugo/bin
and extract the files into this folder.
Rename hugo.sh
to hugo
Update system path
Then check the version
hugo version
Install Homebrew
Install hugo
brew install hugo
hugo version
hugo new site <site_name>
Then the folder created.
Go to https://themes.gohugo.io to check
Download theme from learning site https://github.com/giraffeacademy/ga-hugo-theme
Unzip to themes
folder, and rename the theme ga-hugo-theme-master
to ga-hugo-theme
Add following line in config.toml
theme = "ga-hugo-theme"
hugo server
, then access https://localhost:1313.hugo new a.md
hugo new dir1/b.md
Run hugo in draft mode
hugo server -D
Display one page content.
List other single contents in the page. The list page for Level 1 directories are automatically created hugo.
Force hugo create list page, create _index.md
file in the directory, and update the content of _index.md
file will show on the list page
hugo new dir1/dir2/_index.md
YAML
---
title: "title"
date: 2017-...
draft: true
---
TOML
+++
title = "title"
date = 2017-...
draft = true
+++
The file archetypes/default.md
has the template of new files.
---
tltle: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ .Date }}
draft: true
---
The template file can be named as directory name, such as dir1.md
, it will be used for contents created in dir1
hugo new dir1/b.md
The predefined shortcodes can be found in hugo shortcode page, it also can be customized using shortcode template.
{{< youtube w7Ft2ymGmfc >}}
Tags and categories
---
tags: [ "tag1", "tag2", "tag3"]
categories: [ "cat1"]
---
The tags and categories will be shown in contents if using learning theme.
Access tags and categories from page
https://localhost:1313/tags/tag1/
https://localhost:1313/categories/cat1/
In content file
---
Moods: [ "Happy", "Upbeat" ]
---
In config.toml
file
[taxonomies]
tag = "tags"
category = "categories"
mood = "moods"
Note: If taxonomies session exists in config.toml
file, then tag
and category
also must be included.
Templates are in themes/ga-hugo-theme/layouts/_default
. The list.html
is for list page, the single.html
is for single page.
Create in layouts/_default/list.html
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
{{.Content}}
<ul>
{{ range .Pages }}
<li><a href="{{.URL}}">{{.Title}}</a></li>
{{end}}
</ul>
</body>
</html>
Create in layouts/_default/page.html
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>Header</h1>
<h3>{{.Title}}</h3>
<h4>{{.Date}}</h4>
{{.Content}}
<h2>Footer</h2>
</body>
</html>
Home page is a special list page. Create in layouts/index.html
.
Create in layouts/_default/<dir_name>/single.html
, which replace the template for files in <dir_name>
.
Create in layouts/_default/baseof.html
, it is the template for all pages.
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
Top of baseof
<hr>
{{ block "main" . }}
{{end}}
{{ block "footer" . }}
<br>
{{end}}
<hr>
Bottom of baseof
</body>
</html>
The create layouts/_default/single.html
{{ define "main" }}
This is the single template
{{end}}
{{ define "footer" }}
This is the single footer
{{end}}
The create layouts/_default/list.html
{{ define "main" }}
This is the list template
{{end}}
Note: no overwrite in layouts/_default/list.html
for footer.
Hugo variables only can be used in templates in layout.
For example:
<h1 style="color: {{ .Params.color }}">Single Template</h1><hr><br>
{{ .Title }} {{ .Date }} {{ .URL }}
{{ .Params.myVar }}
The myVar
and color
are custom variables defined in markdown file
---
myVar: "myValue"
color: "blue"
---
{{ $myVarName := "string value" }}
<h1>{{ $myVarName }}</h1>
Hugo functions only can be used in templates in layout.
{{ funcName param1 param2 }}
For example:
{{ truncate 10 "This is a very long string" }}
{{ add 1 5 }}
{{ sub 1 5 }}
{{ singularize "dogs" }}
{{ range .Pages }}
{{ .Title }} <br>
{{ end }}
{{ $var1 := "dog" }}
{{ $var2 := "cat" }}
{{ if not (eq $var1 $var2) }}
True
{{ else if ... }}
{{ else }}
False
{{ end }}
{{ if and (lt $var1 $var2) (lt $var1 $var3) }}
eq
lt
le
gt
ge
not
{{ $title := .Title }}
{{ range .Site.Pages }}
<li><a href="{{.URL}}" style="{{ if eq .Title $title }} background-color:yellow; {{end}}">{{.Title}}</a></li>
{{ end }}
The JSON, YAML, TOML files, for example, data/states.json
{{ range .Site.Data.states }}
{{.name}} <br> {{.capital}}
{{end}}
Header, footer, etc. Create file in layouts/partials/header.html
<h1>{{.Title}}</h1>
<p>{{.Date}}</p>
<hr>
<br>
In layouts/_default/single.html
{{ partial "header" . }}
<h1>Single Template</h1><hr><br>
Note: The .
after "header" is indicating the entire scope of variables.
<h1>{{.myTitle}}</h1>
<p>{{.myDate}}</p>
<hr>
<br>
In layouts/_default/single.html
{{ partial "header" (dict "myTitle" "myCustomTitle" "myDate" "myCustomDate")}}
<h1>Single Template</h1><hr><br>
Note: It is the same as myTitle := myCustomTitle, myDate := myCustomDate
Shortcode is used in markdown file, created in layouts/shortcodes
.
For example, layouts/shortcodes/myshortcode.html
This is my shortcode file.
<p style="color: {{.Get `color`}}">This is the frameworks text</p>
Note: the "
is replaced to "`"
In markdown file
{{< myshortcode color="blue">}}
For example, layouts/shortcodes/myshortcode.html
This is my shortcode file.
<p style="color: {{.Get 0}}">This is the frameworks text</p>
Note: the "
is replaced to "`"
In markdown file
{{< myshortcode blue >}}
In markdown file
{{< myshortcode >}}
This is the text inside the shortcode tags
{{< /myshortcode >}}
In template file
<p style="background-color: yellow;">{{.Inner}}</p>
If you want to use markdown in shortcode, do follow
{{% myshortcode %}}
**bold text**
{{% /myshortcode %}}
huge server -D
If you just want to build the site into public
folder
huge
Note: delete public
folder first.
Proxmox supports LXC, TrueNAS supports kubernates. The difference between LXC and docker container is, the LXC runs full OS without kernel, docker container only runs application.
Docker container also can be saved as image to be used next time. But the execution parameters can not be saved. To relaunch again, docker compose file can be a good choice if no change after container created.
LXC is a running VM sharing kernel and drivers with host, so OS and it's configue are in LXC.
The disadvantages of LXC are
Migration difficult
Scaling is not at application level
LXC/LXD vs Docker Which is better?
Linux Container (LXC) Introduction
In post Turn on Hibernate in Windows 10, describe how to turn on Hibernate in Windows 10.
In Windows 11, even click on Change settings that are currently unavailable, Hibernate option is still missing.
Run following command in Administrator command line to show the Hibernate option
powercfg /h /type full
The Morefine S500+ makes lots of noise, the fan speed can be changed by accessing BIOS.
Press Delete
key when booting.
S500+5900H-5900HX MOREFINE 9040BIOS1103
FAQs & Test Rep
FAQs & Test Rep (Cache)
Total air cumulatived by fans inwards the case.
Total air cumulatived by fans outwards the case.
Positive pressure can have better air flow direction. The dust comes from only inwards fans.
How To: Properly Plan And Pick Parts For An Air-Cooled PC, Part 2
To install Windows 11 on ramdisk, the software of ramdisk can be downloaded from https://www.romexsoftware.com/en-us/primo-ramdisk/.
In fact, I'm more interesting in RAM disk card.
How to install Windows 11 into memory instead of hard drive
【Fun科技】把Win11装在128G的内存条里:能跑的比PCIe5.0固态硬盘还要快么?