Skip to content

Commit 1885b93

Browse files
authored
Merge pull request #35 from markdumay/develop
Develop
2 parents ebebdf4 + ad0cf26 commit 1885b93

File tree

9 files changed

+163
-149
lines changed

9 files changed

+163
-149
lines changed

.markdownlint-cli2.jsonc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"MD024": false,
66
"MD026": false,
77
"MD033": false,
8-
"MD034": false
8+
"MD034": false,
9+
"MD053": false
910
},
1011
"ignores": ["node_modules", "CHANGELOG.md"]
1112
}

content/en/blog/child.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ date: 2022-04-14
55
description: "The Hinode child theme ensures your site uses future Hinode updates."
66
tags: ["theme"]
77
thumbnail: img/forest.jpg
8-
credits: Photo by <a href="https://unsplash.com/@lucabravo">Luca Bravo</a> on <a href="https://unsplash.com/photos/ESkw2ayO2As">Unsplash</a>
8+
photoCredits: <a href="https://unsplash.com/@lucabravo">Luca Bravo</a>
9+
photoSource: <a href="https://unsplash.com/photos/ESkw2ayO2As">Unsplash</a>
910
---
1011

1112
Hinode is available as a [child theme](https://github.com/markdumay/hugo-theme-hinode-child), and a [main theme](https://github.com/markdumay/hugo-theme-hinode). The child theme uses [npm](https://www.npmjs.com) to link to the latest available version of the Hinode theme. As such, it is less applicable if you plan to customize a lot. Vice versa, the main theme allows for heavy customization, but is not synchronized with the latest available Hinode theme automatically.

content/en/blog/code-highlighting.md

Lines changed: 4 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ date: 2022-04-16
55
description: "Examples on how to enable code highlighting"
66
tags: ["code"]
77
thumbnail: img/notepad.jpg
8-
credits: Photo by <a href="https://unsplash.com/@frederickjmedina">Frederick Medina</a> on <a href="https://unsplash.com/photos/PdfRE-xB--s">Unsplash</a>
8+
photoCredits: <a href="https://unsplash.com/@frederickjmedina">Frederick Medina</a>
9+
photoSource: <a href="https://unsplash.com/photos/PdfRE-xB--s">Unsplash</a>
910
---
1011

1112
## Code Fencing
@@ -29,9 +30,9 @@ Use code fencing to highlight the syntax of a specific language.
2930
</div>
3031
```
3132

32-
## Highlight Partial
33+
## Highlight Shortcode
3334

34-
Use the `highlight` partial to customize the layout of a specific code block.
35+
Use the `highlight` shortcode to customize the layout of a specific code block.
3536

3637
{{< highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" >}}
3738
// GetTitleFunc returns a func that can be used to transform a string to
@@ -55,129 +56,3 @@ func GetTitleFunc(style string) func(s string) string {
5556
}
5657
}
5758
{{< / highlight >}}
58-
59-
## Command Prompt Shortcode
60-
61-
The `command` shortcode generates terminal output for either `bash`, `powershell`, or `sql` shell languages.
62-
63-
### Bash (default shell)
64-
65-
Use the `command` shortcode to generate a block with a default bash command prompt.
66-
67-
```html
68-
{{%/* command */%}}
69-
export MY_VAR=123
70-
{{%/* /command */%}}
71-
```
72-
73-
The result looks like this:
74-
{{% command %}}
75-
export MY_VAR=123
76-
{{% /command %}}
77-
78-
Specify `user` and `host` to add the user context to the prompt. In addition, use `(out)` to specify an output line and use `\` to denote a line continuation.
79-
80-
```html
81-
{{%/* command user="user" host="localhost" */%}}
82-
export MY_VAR=123
83-
echo "hello"
84-
(out)hello
85-
echo one \
86-
two \
87-
three
88-
(out)one two three
89-
echo "goodbye"
90-
(out)goodbye
91-
{{%/* /command */%}}
92-
```
93-
94-
The result looks like this:
95-
{{% command user="user" host="localhost" %}}
96-
export MY_VAR=123
97-
echo "hello"
98-
(out)hello
99-
echo one \
100-
two \
101-
three
102-
(out)one two three
103-
echo "goodbye"
104-
(out)goodbye
105-
{{% /command %}}
106-
107-
### PowerShell
108-
109-
Set the `shell` argument to `powershell` to generate a PowerShell terminal. Override the `prompt` to add a directory if needed. Use the backtick `` ` `` symbol to denote a line continuation.
110-
111-
```html
112-
{{%/* command prompt="PS C:\Users\User>" shell="powershell" */%}}
113-
Write-Host `
114-
'Hello' `
115-
'from' `
116-
'PowerShell!'
117-
(out)Hello from PowerShell!
118-
Write-Host 'Goodbye from PowerShell!'
119-
(out)Goodbye from PowerShell!
120-
{{%/* /command */%}}
121-
```
122-
123-
The result looks like this:
124-
{{% command prompt="PS C:\Users\User>" shell="powershell" %}}
125-
Write-Host `
126-
'Hello' `
127-
'from' `
128-
'PowerShell!'
129-
(out)Hello from PowerShell!
130-
Write-Host 'Goodbye from PowerShell!'
131-
(out)Goodbye from PowerShell!
132-
{{% /command %}}
133-
134-
### SQL
135-
136-
Set the `shell` argument to `sql` to generate a SQL terminal. Use the `(con)` suffix to denote a line continuation.
137-
138-
```html
139-
{{%/* command prompt="mysql>" shell="sql" */%}}
140-
set @my_var = 'foo';
141-
set @my_other_var = 'bar';
142-
CREATE TABLE people ((con)
143-
first_name VARCHAR(30) NOT NULL,(con)
144-
last_name VARCHAR(30) NOT NULL(con)
145-
);
146-
(out)Query OK, 0 rows affected (0.09 sec)
147-
insert into people(con)
148-
values ('John', 'Doe');
149-
(out)Query OK, 1 row affected (0.02 sec)
150-
select *(con)
151-
from people(con)
152-
order by last_name;
153-
(out)+------------+-----------+
154-
(out)| first_name | last_name |
155-
(out)+------------+-----------+
156-
(out)| John | Doe |
157-
(out)+------------+-----------+
158-
(out)1 row in set (0.00 sec)
159-
{{%/* /command */%}}
160-
```
161-
162-
The result looks like this:
163-
{{% command prompt="mysql>" shell="sql" %}}
164-
set @my_var = 'foo';
165-
set @my_other_var = 'bar';
166-
CREATE TABLE people ((con)
167-
first_name VARCHAR(30) NOT NULL,(con)
168-
last_name VARCHAR(30) NOT NULL(con)
169-
);
170-
(out)Query OK, 0 rows affected (0.09 sec)
171-
insert into people(con)
172-
values ('John', 'Doe');
173-
(out)Query OK, 1 row affected (0.02 sec)
174-
select *(con)
175-
from people(con)
176-
order by last_name;
177-
(out)+------------+-----------+
178-
(out)| first_name | last_name |
179-
(out)+------------+-----------+
180-
(out)| John | Doe |
181-
(out)+------------+-----------+
182-
(out)1 row in set (0.00 sec)
183-
{{% /command %}}

content/en/blog/custom-shortcodes.md

Lines changed: 137 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,148 @@ The result looks like this:
4646
{{< img src="img/dunes.jpg" caption="slide 3" >}}
4747
{{< /carousel >}}
4848

49+
## Command Prompt Shortcode
50+
51+
The `command` shortcode generates terminal output for either `bash`, `powershell`, or `sql` shell languages. The shortcode supports the following arguments:
52+
53+
| Argument | Required | Description |
54+
|-----------|----------|-------------|
55+
| user | No | Optional user to add to the prompt, e.g. "user". |
56+
| host | No | Optional host to add to the prompt, e.g. "localhost". |
57+
| prompt | No | Optional prompt override, e.g. "PS C:\Users\User>". |
58+
| shell | No | Type of shell, either "bash" (default), "powershell", or "sql". |
59+
{.table}
60+
61+
### Bash (default shell)
62+
63+
Use the `command` shortcode to generate a block with a default bash command prompt.
64+
65+
```html
66+
{{%/* command */%}}
67+
export MY_VAR=123
68+
{{%/* /command */%}}
69+
```
70+
71+
The result looks like this:
72+
{{% command %}}
73+
export MY_VAR=123
74+
{{% /command %}}
75+
76+
Specify `user` and `host` to add the user context to the prompt. In addition, use `(out)` to specify an output line and use `\` to denote a line continuation.
77+
78+
```html
79+
{{%/* command user="user" host="localhost" */%}}
80+
export MY_VAR=123
81+
echo "hello"
82+
(out)hello
83+
echo one \
84+
two \
85+
three
86+
(out)one two three
87+
echo "goodbye"
88+
(out)goodbye
89+
{{%/* /command */%}}
90+
```
91+
92+
The result looks like this:
93+
{{% command user="user" host="localhost" %}}
94+
export MY_VAR=123
95+
echo "hello"
96+
(out)hello
97+
echo one \
98+
two \
99+
three
100+
(out)one two three
101+
echo "goodbye"
102+
(out)goodbye
103+
{{% /command %}}
104+
105+
### PowerShell
106+
107+
Set the `shell` argument to `powershell` to generate a PowerShell terminal. Override the `prompt` to add a directory if needed. Use the backtick `` ` `` symbol to denote a line continuation.
108+
109+
```html
110+
{{%/* command prompt="PS C:\Users\User>" shell="powershell" */%}}
111+
Write-Host `
112+
'Hello' `
113+
'from' `
114+
'PowerShell!'
115+
(out)Hello from PowerShell!
116+
Write-Host 'Goodbye from PowerShell!'
117+
(out)Goodbye from PowerShell!
118+
{{%/* /command */%}}
119+
```
120+
121+
The result looks like this:
122+
{{% command prompt="PS C:\Users\User>" shell="powershell" %}}
123+
Write-Host `
124+
'Hello' `
125+
'from' `
126+
'PowerShell!'
127+
(out)Hello from PowerShell!
128+
Write-Host 'Goodbye from PowerShell!'
129+
(out)Goodbye from PowerShell!
130+
{{% /command %}}
131+
132+
### SQL
133+
134+
Set the `shell` argument to `sql` to generate a SQL terminal. Use the `(con)` suffix to denote a line continuation.
135+
136+
```html
137+
{{%/* command prompt="mysql>" shell="sql" */%}}
138+
set @my_var = 'foo';
139+
set @my_other_var = 'bar';
140+
CREATE TABLE people ((con)
141+
first_name VARCHAR(30) NOT NULL,(con)
142+
last_name VARCHAR(30) NOT NULL(con)
143+
);
144+
(out)Query OK, 0 rows affected (0.09 sec)
145+
insert into people(con)
146+
values ('John', 'Doe');
147+
(out)Query OK, 1 row affected (0.02 sec)
148+
select *(con)
149+
from people(con)
150+
order by last_name;
151+
(out)+------------+-----------+
152+
(out)| first_name | last_name |
153+
(out)+------------+-----------+
154+
(out)| John | Doe |
155+
(out)+------------+-----------+
156+
(out)1 row in set (0.00 sec)
157+
{{%/* /command */%}}
158+
```
159+
160+
The result looks like this:
161+
{{% command prompt="mysql>" shell="sql" %}}
162+
set @my_var = 'foo';
163+
set @my_other_var = 'bar';
164+
CREATE TABLE people ((con)
165+
first_name VARCHAR(30) NOT NULL,(con)
166+
last_name VARCHAR(30) NOT NULL(con)
167+
);
168+
(out)Query OK, 0 rows affected (0.09 sec)
169+
insert into people(con)
170+
values ('John', 'Doe');
171+
(out)Query OK, 1 row affected (0.02 sec)
172+
select *(con)
173+
from people(con)
174+
order by last_name;
175+
(out)+------------+-----------+
176+
(out)| first_name | last_name |
177+
(out)+------------+-----------+
178+
(out)| John | Doe |
179+
(out)+------------+-----------+
180+
(out)1 row in set (0.00 sec)
181+
{{% /command %}}
182+
49183
## Image Shortcode
50184

51-
Use the `image` shortcode to display a responsive image with a specific aspect ratio. The source link can refer to either an image available in the `/assets/img` folder of your site or a public web location. The shortcode renders the image as a so-called [image set][mozilla_image] to optimize the image for different screen sizes and resolutions. Behind the scenes, Hugo renders the images in `WebP` format and stores them in a local folder (`resources` or `public`). Supported image types are `.png`, `.jpeg`, `.gif`, `.tiff`, `.bmp`, and `.webp`. The shortcode supports the following arguments:
185+
Use the `image` shortcode to display a responsive image with a specific aspect ratio. The source link can refer to either an image available in the `/assets/img` folder of your site or a public web location. The shortcode renders the image as a so-called [image set][mozilla_image] to optimize the image for different screen sizes and resolutions. Behind the scenes, Hugo renders the images in `WebP` format and stores them in a local folder (`resources` or `public`). The images are processed using the quality setting specified in the `[imaging]` section of the main [config file][hugo_imaging] (defaults to 75). Supported image types are `.png`, `.jpeg`, `.gif`, `.tiff`, `.bmp`, and `.webp`. A fallback image of type `.jpeg` is provided for older browsers.The shortcode supports the following arguments:
52186

53187
| Argument | Required | Description |
54188
|-----------|----------|-------------|
55189
| src | Yes | Required url of the image, e.g. "img/boots.jpg" or "https://picsum.photos/id/27/3264/1836". |
56-
| ratio | No | Aspect ratio of the image, either "1x1", "4x3" (default), "16x9", or "21x9". |
190+
| ratio | No | Optional aspect ratio of the image, either "1x1", "4x3", "16x9", or "21x9". It not specified the original aspect ratio of the image is preserved. |
57191
| class | No | Optional class attribute of the inner `img` element, e.g. "rounded". |
58192
| title | No | Optional alternate text of the image. |
59193
| caption | No | Optional figure caption. |
@@ -68,5 +202,5 @@ As an example, the following shortcode displays an image with rounded corners an
68202
The result looks like this:
69203
{{< image src="img/flowers.jpg" ratio="21x9" caption="Figure caption" class="rounded">}}
70204

71-
<!-- MARKDOWN MAINTAINED LINKS -->
72205
[mozilla_image]: https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
206+
[hugo_imaging]: https://gohugo.io/content-management/image-processing/#imaging-configuration

content/en/blog/emoji-support.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ date: 2021-07-15
55
description: "Guide to emoji usage in Hugo"
66
tags: ["emoji"]
77
thumbnail: img/dunes.jpg # https://picsum.photos/id/184/4288/2848
8-
credits: Photo by <a href="https://unsplash.com/@timdegroot">Tim de Groot</a> on <a href="https://unsplash.com/photos/yNGQ830uFB4">Unsplash</a>
8+
photoCredits: <a href="https://unsplash.com/@timdegroot">Tim de Groot</a>
9+
photoSource: <a href="https://unsplash.com/photos/yNGQ830uFB4">Unsplash</a>
910
---
1011

1112
Emoji can be enabled in a Hugo project in a number of ways.

content/en/blog/markdown-syntax.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ description: "Sample article showcasing basic Markdown syntax and formatting for
55
tags: ["markdown", "css", "html"]
66
date: 2022-01-14
77
thumbnail: img/phone.jpg # https://picsum.photos/id/160/3200/2119
8-
credits: Photo by <a href="https://unsplash.com/@thomweerd">Thom</a> on <a href="https://unsplash.com/photos/Zdcq3iKly6g">Unsplash</a>
8+
photoCredits: <a href="https://unsplash.com/@thomweerd">Thom</a>
9+
photoSource: <a href="https://unsplash.com/photos/Zdcq3iKly6g">Unsplash</a>
910
---
1011

1112
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.

content/en/blog/rich-content.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ date: 2021-07-13
55
description: "A brief description of Hugo Shortcodes"
66
tags: ["shortcodes", "privacy"]
77
thumbnail: img/flowers.jpg # https://picsum.photos/id/106/2592/1728
8-
credits: Photo by <a href="https://unsplash.com/@flutterhappy">Arvee Marie</a> on <a href="https://unsplash.com/photos/YnfGtpt2gf4">Unsplash</a>
8+
photoCredits: <a href="https://unsplash.com/@flutterhappy">Arvee Marie</a>
9+
photoSource: <a href="https://unsplash.com/photos/YnfGtpt2gf4">Unsplash</a>
910
---
1011

1112
Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.

0 commit comments

Comments
 (0)