Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README.md - github.com/peaceiris/hugo-theme-iris.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 087437c631e54a5ba91b29c4b2004e2757d3cc85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<h2 align="center">
Hugo IRIS Theme
</h2>

<div align="center">
  <img src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/images/tn.png" alt="Hugo Iris Theme thumbnail" width="500px">

[![LICENSE](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/peaceiris/hugo-theme-iris/blob/main/LICENSE)
[![release](https://img.shields.io/github/release/peaceiris/hugo-theme-iris.svg)](https://github.com/peaceiris/hugo-theme-iris/releases/latest)
[![release date](https://img.shields.io/github/release-date/peaceiris/hugo-theme-iris.svg)](https://github.com/peaceiris/hugo-theme-iris/releases)
[![release feed](https://img.shields.io/badge/release-feed-yellow)](https://github.com/peaceiris/hugo-theme-iris/releases.atom)
![deploy status](https://github.com/peaceiris/hugo-theme-iris/workflows/CI/badge.svg?branch=main&event=push)
[![hugo themes](https://img.shields.io/static/v1?label=Hugo%20Themes&message=IRIS&color=blueviolet)](https://themes.gohugo.io/themes/hugo-theme-iris/)
[![lighthouse score](https://img.shields.io/static/v1?label=Lighthouse%20Score&message=Good&color=green)](https://hugothemeiris.peaceiris.app/report.html)

</div>

[Go to the demo site](https://hugothemeiris.peaceiris.app/).



## Table of Contents

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Overview](#overview)
  - [Features](#features)
  - [Roadmap](#roadmap)
- [Getting Started](#getting-started)
  - [Install Hugo](#install-hugo)
  - [Install Go](#install-go)
  - [Install Node.js and npm](#install-nodejs-and-npm)
  - [Initialize New Hugo Project](#initialize-new-hugo-project)
  - [Create a Post Page](#create-a-post-page)
  - [Create a Slide Page](#create-a-slide-page)
- [Customize Theme](#customize-theme)
  - [config](#config)
  - [content](#content)
  - [assets](#assets)
  - [data](#data)
  - [i18n](#i18n)
  - [static](#static)
- [Hosting](#hosting)
  - [Netlify](#netlify)
  - [GitHub Pages using Actions](#github-pages-using-actions)
- [Shortcodes](#shortcodes)
  - [circle](#circle)
  - [button](#button)
  - [mermaid](#mermaid)
  - [repo](#repo)
  - [github-sponsors-list](#github-sponsors-list)
  - [table](#table)
  - [math](#math)
- [How to Update the Theme](#how-to-update-the-theme)
- [Special Thanks](#special-thanks)
- [Changelog](#changelog)
- [Maintainer](#maintainer)
- [Contributing](#contributing)
- [License](#license)
- [Development](#development)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->



## Overview

This repository includes a [Hugo] theme.

### Features

- Dark Theme
- Responsive
- Support Multilingual
- Pagination
- SEO
  - Google Analytics
  - Open Graph Protocol
  - JSON-LD
  - Canonical URL on header
- Performance
  - [PageSpeed Insights Scores: Good](https://developers.google.com/speed/pagespeed/insights/?hl=EN&url=https%3A%2F%2Fhugothemeiris.peaceiris.app%2F)
  - [Lighthouse Scores: Good](https://hugothemeiris.peaceiris.app/report.html)
- Contents
  - Breadcrumb List
  - Syntax Highlighting
  - Table of Contents
  - Random Post List
  - [MathJax]: Beautiful math in all browsers.
  - [mermaid]: Generation of diagram and flowchart from text in a similar manner as markdown.
  - [reveal.js]: Writing slides using Markdown.
- Image
  - Responsive
  - Eye-catching Image
  - OGP Image
  - WebP: requiring a Hugo extended version
- Disqus Comment System
- Keyboard Shortcut: Press `?` (`Shift+/`) to show help modal.

### Roadmap

- Share Buttons
- Netlify, Netlify CMS
- Categories, Tags, Authors
- Font Awesome
- Related posts, next and previous post

<div align="right"><a href="#table-of-contents">Back to TOC ☝️</a></div>



## Getting Started

### Install Hugo

You can find the minimum supported Hugo version in [theme.toml] `min_version`. Using Hugo extended version is desirable.

[theme.toml]: https://github.com/peaceiris/hugo-theme-iris/blob/main/theme.toml

### Install Go

This theme depends on Hugo Modules.

- [Download and install - The Go Programming Language](https://golang.org/doc/install)

### Install Node.js and npm

This theme depends on `node` and `npm`.

cf. [Installing Node.js via package manager | Node.js](https://nodejs.org/en/download/package-manager/)

### Initialize New Hugo Project

Here is [the setup script](https://github.com/peaceiris/hugo-theme-iris/blob/main/scripts/setup.sh).

```sh
mkdir homepage
wget https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/scripts/setup.sh
bash ./setup.sh homepage "your_github_id"
cd homepage
npm ci
hugo server
```

- http://localhost:1313/

*Customize your site! ʕ◔ϖ◔ʔ*

### Create a Post Page

```sh
hugo new posts/new.md
```

### Create a Slide Page

```sh
hugo new --kind slide posts/new-slide.md
```

<div align="right"><a href="#table-of-contents">Back to TOC ☝️</a></div>



## Customize Theme

TBW.

### config

### content

### assets

### data

### i18n

### static

<div align="right"><a href="#table-of-contents">Back to TOC ☝️</a></div>



## Hosting

### Netlify

<!-- Deploy to Netlify Button -->
<!-- https://www.netlify.com/docs/deploy-button/ -->
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/peaceiris/hugo-theme-iris)

### GitHub Pages using Actions

The following actions are useful to deploy your site to GitHub Pages using GitHub Actions.

- [peaceiris/actions-hugo: GitHub Actions for Hugo](https://github.com/peaceiris/actions-hugo)
- [peaceiris/actions-gh-pages: GitHub Actions for GitHub Pages](https://github.com/peaceiris/actions-gh-pages)

<div align="right"><a href="#table-of-contents">Back to TOC ☝️</a></div>



## Shortcodes

### circle

If your logo image is located at `assets/images/logo.jpg`.

```md
{{< circle src="images/logo.jpg" alt="hugo-theme-iris logo" >}}
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_circle.jpg" alt="Shortcode mermaid">

### button

```md
<div class="buttons">
  {{< button href="https://gohugo.io/" txt="Hugo Homepage" >}}
  {{< button href="https://github.com/gohugoio/" txt="Hugo GitHub" >}}
  {{< button href="https://discourse.gohugo.io/" txt="Hugo Forum" >}}
  {{< button href="https://twitter.com/GoHugoIO" txt="Hugo Twitter" >}}
</div>
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_button.jpg" alt="Shortcode button">

### mermaid

```md
{{< mermaid >}}
sequenceDiagram
  participant Alice
  participant Bob
  Alice->>John: Hello John, how are you?
  loop Healthcheck
    John->>John: Fight against hypochondria
  end
  Note right of John: Rational thoughts <br/>prevail!
  John-->>Alice: Great!
  John->>Bob: How about you?
  Bob-->>John: Jolly good!
{{< /mermaid >}}
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_mermaid.jpg" alt="Shortcode mermaid">

### repo

Run the following script to get the latest repository data.
The script requires the [gh] command.

[gh]: https://github.com/cli/cli

For more details: [scripts/fetch_data.sh](https://github.com/peaceiris/hugo-theme-iris/blob/main/exampleSite/scripts/fetch_data.sh)

```sh
brew install gh
gh auth login
```

```sh
cd ./your_hugo_project
export GH_USER_ID="peaceiris"
bash ./scripts/fetch_data.sh "${GH_USER_ID}" > "./data/github/${GH_USER_ID}.json"
```

We can show a repository card like as follows.

```md
{{< repo id="peaceiris" name="actions-gh-pages" >}}

{{< repo id="peaceiris" name="actions-hugo" >}}
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_repo.jpg" alt="Shortcode repo">

### github-sponsors-list

Please follow the instruction as the same as the `repo` shortcode.

```md
{{< github-sponsors-list id="peaceiris" >}}
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_github-sponsors-list.jpg" alt="Shortcode github-sponsors-list">

### table

```md
{{< table >}}
| Key | Value |
|---|---|
| Static Site Generator | Hugo |
| Language | Go |
{{< /table >}}
```

| Mouse out | Mouse over |
|---|---|
| ![Shortcode table mouse out](https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_table_1.jpg) | ![Shortcode table mouse over](https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_table_2.jpg) |

### math

See also [the example page](https://hugothemeiris.peaceiris.app/posts/math/).

When you use the ampersand sign `&`, you need to use the following math shortcode.

```md
{{< math >}}
\begin{vmatrix}a & b\\
c & d
\end{vmatrix}
{{< /math >}}
```

<div align="right"><a href="#table-of-contents">Back to TOC ☝️</a></div>



## How to Update the Theme

```sh
cd your_hugo_project
hugo mod get -u hugo mod get -u github.com/peaceiris/hugo-theme-iris
hugo mod tidy && hugo mod verify
git add go.mod go.sum
git commit -m "deps: bump hugo-theme-iris"
```

<div align="right"><a href="#table-of-contents">Back to TOC ☝️</a></div>



## Special Thanks

- [Hugo]
- [Bulma]
- [reveal.js]
- [MathJax]
- [mermaid]
- [jaywcjlove/hotkeys](https://github.com/jaywcjlove/hotkeys)

<!-- - Font Awesome -->

<div align="right"><a href="#table-of-contents">Back to TOC ☝️</a></div>



## Changelog

- [hugo-theme-iris/CHANGELOG.md](https://github.com/peaceiris/hugo-theme-iris/blob/main/CHANGELOG.md)



## Maintainer

- [peaceiris homepage](https://peaceiris.com)



## Contributing

To contribute to this Hugo theme.

You can find more detail in our [Contributing Guide].



## License

- [MIT License - peaceiris/hugo-theme-iris](https://github.com/peaceiris/hugo-theme-iris/blob/main/LICENSE)



## Development

```sh
{{ partial "console-log" $hoge }}
```

---

<div align="right"><a href="#table-of-contents">Back to TOC ☝️</a></div>



<!-- Internal References -->
[Contributing Guide]: https://github.com/peaceiris/hugo-theme-iris/blob/main/CONTRIBUTING.md

<!-- External References -->
[Hugo]: https://gohugo.io/
[Bulma]: https://bulma.io/
[reveal.js]: https://github.com/hakimel/reveal.js/
[MathJax]: https://www.mathjax.org/
[mermaid]: https://github.com/knsv/mermaid