Browse Source

Initial Commit

master
Arsen Musayelyan 3 months ago
parent
commit
80ad96d0c4
  1. 6
      archetypes/default.md
  2. 13
      config.toml
  3. 25
      content/_index.md
  4. 12
      content/configuration/_index.md
  5. 12
      content/configuration/about.md
  6. 105
      content/configuration/sections.md
  7. 12
      content/getting-started/_index.md
  8. 37
      content/getting-started/features.md
  9. 15
      content/getting-started/note.md
  10. 10
      content/getting-started/purpose.md
  11. 338
      content/socket/API.md
  12. 12
      content/socket/_index.md
  13. 33
      content/socket/types.md
  14. 1
      layouts/partials/logo.html
  15. 1
      layouts/shortcodes/raw.html
  16. 16
      themes/hugo-theme-relearn/.editorconfig
  17. 14
      themes/hugo-theme-relearn/.github/actions/build_site/action.yaml
  18. 73
      themes/hugo-theme-relearn/.github/actions/check_milestone/action.yaml
  19. 17
      themes/hugo-theme-relearn/.github/actions/deploy_site/action.yaml
  20. 64
      themes/hugo-theme-relearn/.github/actions/release_milestone/action.yaml
  21. 28
      themes/hugo-theme-relearn/.github/contributing.md
  22. 20
      themes/hugo-theme-relearn/.github/workflows/build.yaml
  23. 25
      themes/hugo-theme-relearn/.github/workflows/deploy.yaml
  24. 42
      themes/hugo-theme-relearn/.github/workflows/release.yaml
  25. 4
      themes/hugo-theme-relearn/.gitignore
  26. 36
      themes/hugo-theme-relearn/.grenrc.js
  27. 23
      themes/hugo-theme-relearn/LICENSE
  28. 52
      themes/hugo-theme-relearn/README.md
  29. 12
      themes/hugo-theme-relearn/archetypes/chapter.md
  30. 6
      themes/hugo-theme-relearn/archetypes/default.md
  31. 106
      themes/hugo-theme-relearn/exampleSite/config.toml
  32. 52
      themes/hugo-theme-relearn/exampleSite/content/_index.en.md
  33. 4
      themes/hugo-theme-relearn/exampleSite/content/_index.pir.md
  34. 228
      themes/hugo-theme-relearn/exampleSite/content/basics/CHANGELOG.md
  35. 11
      themes/hugo-theme-relearn/exampleSite/content/basics/_index.en.md
  36. 6
      themes/hugo-theme-relearn/exampleSite/content/basics/_index.pir.md
  37. 135
      themes/hugo-theme-relearn/exampleSite/content/basics/configuration/_index.en.md
  38. 5
      themes/hugo-theme-relearn/exampleSite/content/basics/configuration/_index.pir.md
  39. BIN
      themes/hugo-theme-relearn/exampleSite/content/basics/configuration/images/home_button_defaults.png
  40. 133
      themes/hugo-theme-relearn/exampleSite/content/basics/customization/_index.en.md
  41. 5
      themes/hugo-theme-relearn/exampleSite/content/basics/customization/_index.pir.md
  42. BIN
      themes/hugo-theme-relearn/exampleSite/content/basics/customization/images/blue-variant.png
  43. BIN
      themes/hugo-theme-relearn/exampleSite/content/basics/customization/images/green-variant.png
  44. BIN
      themes/hugo-theme-relearn/exampleSite/content/basics/customization/images/red-variant.png
  45. BIN
      themes/hugo-theme-relearn/exampleSite/content/basics/customization/images/standard-variant.png
  46. 5
      themes/hugo-theme-relearn/exampleSite/content/basics/history/_index.en.md
  47. 5
      themes/hugo-theme-relearn/exampleSite/content/basics/history/_index.pir.md
  48. 102
      themes/hugo-theme-relearn/exampleSite/content/basics/installation/_index.en.md
  49. 5
      themes/hugo-theme-relearn/exampleSite/content/basics/installation/_index.pir.md
  50. BIN
      themes/hugo-theme-relearn/exampleSite/content/basics/installation/images/chapter.png
  51. 92
      themes/hugo-theme-relearn/exampleSite/content/basics/migration/_index.en.md
  52. 5
      themes/hugo-theme-relearn/exampleSite/content/basics/migration/_index.pir.md
  53. 11
      themes/hugo-theme-relearn/exampleSite/content/basics/requirements/_index.en.md
  54. 6
      themes/hugo-theme-relearn/exampleSite/content/basics/requirements/_index.pir.md
  55. BIN
      themes/hugo-theme-relearn/exampleSite/content/basics/requirements/images/magic.gif
  56. 11
      themes/hugo-theme-relearn/exampleSite/content/cont/_index.en.md
  57. 6
      themes/hugo-theme-relearn/exampleSite/content/cont/_index.pir.md
  58. 58
      themes/hugo-theme-relearn/exampleSite/content/cont/archetypes.en.md
  59. 5
      themes/hugo-theme-relearn/exampleSite/content/cont/archetypes.pir.md
  60. 71
      themes/hugo-theme-relearn/exampleSite/content/cont/i18n/_index.en.md
  61. 5
      themes/hugo-theme-relearn/exampleSite/content/cont/i18n/_index.pir.md
  62. BIN
      themes/hugo-theme-relearn/exampleSite/content/cont/i18n/images/i18n-menu.gif
  63. 41
      themes/hugo-theme-relearn/exampleSite/content/cont/icons.en.md
  64. 5
      themes/hugo-theme-relearn/exampleSite/content/cont/icons.pir.md
  65. 696
      themes/hugo-theme-relearn/exampleSite/content/cont/markdown.en.md
  66. 5
      themes/hugo-theme-relearn/exampleSite/content/cont/markdown.pir.md
  67. 113
      themes/hugo-theme-relearn/exampleSite/content/cont/menushortcuts.en.md
  68. 5
      themes/hugo-theme-relearn/exampleSite/content/cont/menushortcuts.pir.md
  69. 186
      themes/hugo-theme-relearn/exampleSite/content/cont/pages/_index.en.md
  70. 5
      themes/hugo-theme-relearn/exampleSite/content/cont/pages/_index.pir.md
  71. BIN
      themes/hugo-theme-relearn/exampleSite/content/cont/pages/images/frontmatter-icon.png
  72. BIN
      themes/hugo-theme-relearn/exampleSite/content/cont/pages/images/pages-chapter.png
  73. BIN
      themes/hugo-theme-relearn/exampleSite/content/cont/pages/images/pages-default.png
  74. 61
      themes/hugo-theme-relearn/exampleSite/content/cont/syntaxhighlight.en.md
  75. 5
      themes/hugo-theme-relearn/exampleSite/content/cont/syntaxhighlight.pir.md
  76. 36
      themes/hugo-theme-relearn/exampleSite/content/cont/tags.en.md
  77. 6
      themes/hugo-theme-relearn/exampleSite/content/cont/tags.pir.md
  78. 27
      themes/hugo-theme-relearn/exampleSite/content/credits.en.md
  79. 5
      themes/hugo-theme-relearn/exampleSite/content/credits.pir.md
  80. 14
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/INCLUDE_ME.md
  81. 19
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/_index.en.md
  82. 6
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/_index.pir.md
  83. BIN
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/attachments.en.files/BachGavotteShort.mp3
  84. BIN
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/attachments.en.files/Carroll_AliceAuPaysDesMerveilles.pdf
  85. BIN
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/attachments.en.files/adivorciarsetoca00cape.pdf
  86. BIN
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/attachments.en.files/hugo.png
  87. 1
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/attachments.en.files/hugo.txt
  88. BIN
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/attachments.en.files/movieselectricsheep-flock-244-32500-2.mp4
  89. 94
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/attachments.en.md
  90. 1
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/attachments.pir.files/NoTreasure.txt
  91. 7
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/attachments.pir.md
  92. 16
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/button.en.md
  93. 5
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/button.pir.md
  94. 51
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/children/_index.en.md
  95. 6
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/children/_index.pir.md
  96. 13
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/children/children-1/_index.en.md
  97. 8
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/children/children-1/_index.pir.md
  98. 12
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.en.md
  99. 7
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.pir.md
  100. 12
      themes/hugo-theme-relearn/exampleSite/content/shortcodes/children/children-1/children-1-1/children-1-1-1/_index.en.md

6
archetypes/default.md

@ -0,0 +1,6 @@
+++
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
+++

13
config.toml

@ -0,0 +1,13 @@
baseURL = 'https://itd.arsenm.dev/'
languageCode = 'en-us'
title = 'ITD'
# Change the default theme to be use when building the site with Hugo
theme = "hugo-theme-relearn"
# For search functionality
[outputs]
home = [ "HTML", "RSS", "JSON"]
[params]
themeVariant = "blue"

25
content/_index.md

@ -0,0 +1,25 @@
+++
title = "Home"
date = 2021-10-23T00:11:38-07:00
+++
# ITD
{{% notice warning %}}
There is currently a bug in the bluetooth library used for ITD that will cause the following error when using BlueZ 5.62+:
```
MapToStruct: Field not found: MTU
```
This is mentioned in [an issue](https://gitea.arsenm.dev/Arsen6331/infinitime/issues/3).
{{% /notice %}}
ITD is a daemon written in Go that communicates with the [InfinitTime](https://github.com/InfiniTimeOrg/InfiniTime) firmware running on the [PineTime](https://www.pine64.org/pinetime/) smartwatch.
ITD is meant to be fast and easy to use. As such, it is is only a single binary that works on all Linux systems since it is statically compiled and thus does not rely on any dynamic libraries.
ITD comes with `itctl`, a binary that uses the provided socket to control ITD and, by extension, the connected watch.
`itgui` is a gui frontend in ITD's repo. I do not compile it in CI as it requires OpenGL which makes cross-compiling a massive pain.

12
content/configuration/_index.md

@ -0,0 +1,12 @@
+++
chapter = true
pre = "<b>II. </b>"
title = "Configuration"
weight = 2
+++
### Chapter II
# Configuration
This chapter is about configuring ITD, including documentation about its config file and locations where it can be put.

12
content/configuration/about.md

@ -0,0 +1,12 @@
+++
title = "About"
date = 2021-10-23T23:04:51-07:00
draft = true
weight = 1
+++
ITD has a config file. It's a TOML file that is, by default, at `/etc/itd.toml`. ITD will also search `~/.config/itd.toml` for a config and will choose the one in home if possible.
ITD can also be configured with environment variables. They take priority over the config. Variable names should be formatted as follows: ITD_&lt;config field&gt;. For example, socket path is `socket.path` in the config, so it would be `ITD_SOCKET_PATH` as an environment variable. To change which transliterators to use, `ITD_NOTIFS_TRANSLIT_USE` would be the variable, since the config field is `notifs.translit.use`.
In most cases, config edits come into effect immediately, and no restart of ITD is needed.

105
content/configuration/sections.md

@ -0,0 +1,105 @@
+++
title = "Sections"
date = 2021-10-23T23:04:51-07:00
draft = true
weight = 2
+++
This page is about the various sections in the config, their purpose, and how to use them.
### cfg.version
This field is temporary and was added because I changed the config format a while ago and wanted to make sure no one was still using the old config with a new version of ITD.
---
### socket
This section contains options for the control socket exposed by ITD.
#### path
This field is a string indicating the filepath at which the control socket should be opened.
---
### conn
The conn secton contains options for ITD's connection to the PineTime.
#### reconnect
This field is a boolean that dictates whether ITD will attempt to reconnect to the PineTime in case of a disconnect.
---
### on.connect
This section contains options for what happens when ITD first connects to a PineTime.
#### notify
This field is a boolean that dictates whether a notification should be sent to InfiniTime upon connection.
---
### on.reconnect
This section contains options for what happens when ITD reconnects to a PineTime after a disconnect.
#### notify
This field is a boolean that dictates whether a notification should be sent to InfiniTime upon reconnect.
#### setTime
This field is a boolean that dictates whether the time should be updated when ITD reconnects to InfiniTime.
---
### notifs.translit
#### use
This field is an array of strings which sets which transliterators should be used when transliterating text. The full list of transliterators can be found [here](https://gitea.arsenm.dev/Arsen6331/itd#transliteration) in the readme.
#### custom
This field is an array of strings which is a custom transliteration map. It can replace anything with something else. For example:
```toml
custom = [
"test", "replaced",
"æ", "ae",
"ē", "e",
]
```
An array is used because Golang does not preserve the order of a map.
---
### notifs.ignore
#### sender
This field is an array of strings which contains senders from which notifications are ignored.
#### summary
This field is an array of strings which contains notification summaries whose notifications will be ignored.
#### body&nbsp;
This field is an array of strings which contains notification bodies whose notifications will be ignored.
---
### music
This section contains options for music control
#### vol.interval
This field is an integer indicating how much the volume should be changed for each volume up or down event from the music control app.

12
content/getting-started/_index.md

@ -0,0 +1,12 @@
+++
chapter = true
pre = "<b>I. </b>"
title = "Getting Started"
weight = 1
+++
### Chapter I
# Getting Started
This chapter is about `itd`, its purpose, and what it does. It also includes a note about my age and ability to respond.

37
content/getting-started/features.md

@ -0,0 +1,37 @@
+++
title = "Features"
date = 2021-10-23T23:04:51-07:00
draft = true
weight = 2
+++
The list of features is mentioned [here](https://gitea.arsenm.dev/Arsen6331/itd#features) in the readme. This page will describe how certain features work and how new ones are added.
### Notification Relay
The notification relay works by listening for method calls on the `org.freedesktop.Notifications` DBus interface. Any such method call represents a notification being sent. ITD reads the data from the method call and creates a notification suitable for ANS (Alert Notification Service) which is used by InfniTime to display notifications. This means DBus must be installed and running for ITD to relay notifications.
### Transliteration
Transliteration for ITD is implemented in a custom `translit` package. It consists of a `Transliterator` interface which looks like this:
```go
type Transliterator interface {
Transliterate(string) string
Init()
}
```
Anything that satisfies that interface can be added to the `Transliterators` map and then used in ITD's config in the `notifs.translit.use` array.
### Music Control
Music control is implemented using `playerctl` which uses the MPRIS DBus interface. This means it will work with any music player which supports MPRIS. `playerctl` must be installed for ITD to do music control.
### Control Socket
ITD exposes a UNIX socket at `/tmp/itd/socket` by default. This socket can be used to control the daemon. It is how `itctl` and `itgui` work. This can be used in any language which supports UNIX sockets which is nearly all of them. Even bash can be used with `netcat`.
### New Features
New features are added whenever I find out they exist from InfiniTime's repo or developers. This means ITD's master branch may contain features not yet released in InfiniTime.

15
content/getting-started/note.md

@ -0,0 +1,15 @@
+++
title = "Note"
date = 2021-10-23T22:55:22-07:00
draft = true
weight = 3
+++
This is a note for anyone using or planning to contribute to ITD. I am {{<raw>}}<span id="age">Loading...</span>{{</raw>}} years old and, at times, may be busy with school and unable to answer questions and/or work on the project for a while. If you do not get an answer quickly, I am probably busy. However, I sometimes answer questions, comment on issues, or push code while in school. That means there may be pauses where I cannot answer questions or comment on issues because I am moving between classes or busy doing an assignment. Please do not bombard me with messages if this occurs, I will answer as soon as I can.
{{<raw>}}
<script>
birthday = new Date("April 24, 2005")
document.getElementById("age").innerHTML = (new Date).getFullYear() - birthday.getFullYear()
</script>
{{</raw>}}

10
content/getting-started/purpose.md

@ -0,0 +1,10 @@
+++
title = "Purpose"
date = 2021-10-23T22:34:32-07:00
draft = true
weight = 1
+++
ITD was created because I could not find a good InfiniTime companion for Linux. There is [Siglo](https://github.com/alexr4535/siglo) which cannot do much beyond syncing time and updating the watch and is not very reliable. There is [Amazfish](https://github.com/piggz/harbour-amazfish) which works, but at least for me, is a bit clunky and unreliable.
I wanted something that was easy enough to use that I could just run it and forget about it, and had any feature I may want to use. Also, I needed it to work on Linux because I only own Linux devices, including my phone, which is a PinePhone. This leads to the next requirement. I needed it to be easily cross-compiled so that I could use it on all my computers as well as aarch64 devices such as my PinePhone and Raspberry Pi 4s. All of these reasons contributed to me deciding to make ITD and they are what I try to emphasize.

338
content/socket/API.md

@ -0,0 +1,338 @@
+++
title = "API"
date = 2021-10-23T23:04:51-07:00
draft = true
weight = 2
+++
This page documents the API of ITD's control socket.
## Request format
Request sent to ITD's socket should be valid JSON with the following format:
| Field | Type |
|-------|------|
| type | int |
| data | any |
Example:
```json
{"type": 5, "data": {"title": "title1", "body": "body1"}}
```
Sends notification titled "title1" with a body "body1".
---
## Response format
Responses received from ITD will be valid JSON and have the following format:
| Field | Type |
|--------|--------|
| type | int |
| value? | any |
| msg? | string |
| id? | string |
| error | bool |
(Fields marked with "?" may not exist in all responses)
Examples:
```json
{"type":1,"value":66,"error":false}
```
```json
{"type":6,"msg":"Data required for settime request","error":true}
```
```json
{"type":6,"error":false}
```
---
## Requests
This section will document each request type, its response, and what data it needs.
### Heart Rate
The heart rate request's type is 0. It requires no data and returns a `uint8` in its value field.
Example request:
```json
{"type":0}
```
Example response:
```json
{"type":0,"value":92,"error":false}
```
---
### Battery Level
The battery level request's type is 1. It requires no data and returns a `uint8` in its value field.
Example request:
```json
{"type":1}
```
Example response:
```json
{"type":1,"value":65,"error":false}
```
---
### Firmware Version
The firmware version request's type is 2. It requires no data and returns a string in its value field.
Example request:
```json
{"type":2}
```
Example response:
```json
{"type":2,"value":"1.6.0","error":false}
```
---
### Firmware Upgrade
The firmware upgrade request's type is 3. It requires data in the following format:
| Field | Type |
|-------|----------|
| type | int |
| files | []string |
Example requests:
```json
{"type": 3, "data": {"type": 0, "files": ["pinetime-mcuboot-app-dfu-1.6.0.zip"]}}
```
```json
{"type": 3, "data": {"type": 1, "files": ["pinetime-mcuboot-app-image-1.6.0.bin", "pinetime-mcuboot-app-image-1.6.0.dat"]}}
```
The paths need to be absolute. They are not absolute here as this is an example.
Example response:
```json
{"type":3,"value":{"sent":2800,"recvd":2800,"total":361152},"error":false}
```
Responses will be sent continuously until the transfer is complete.
---
### Bluetooth Address
The bluetooth address request's type is 4. It requires no data and returns a string in its value field.
Example request:
```json
{"type":4}
```
Example response:
```json
{"type":4,"value":"ED:47:AC:47:F4:FB","error":false}
```
---
### Notify
The notify request's type is 5. It reques data in the following format:
| Field | Type |
|-------|--------|
| title | string |
| body | string |
Example request:
```json
{"type": 5, "data": {"title": "title1", "body": "body1"}}
```
Example response:
```json
{"type":5,"error":false}
```
---
### Set Time
The set time request's type is 6. It requires a string as data. The string must be a date and time formatted as ISO8601/RFC3339 or the string "now".
Example requests:
```json
{"type":6,"data":"2021-10-24T06:40:35-07:00"}
```
```json
{"type":6,"data":"now"}
```
Example response:
```json
{"type":6,"error":false}
```
---
### Watch Heart Rate
The watch heart rate request's type is 7. It requires no data. It returns a uint8 as its value every time the heart rate changes until it is canceled via the cancel request. It also returns an ID for use with the cancel request.
Example request:
```json
{"type":7}
```
Example response:
```json
{"type":7,"value":83,"id":"d12e2ec2-accd-400c-9da7-be86580b067f","error":false}
```
---
### Watch Battery Level
The watch battery level request's type is 8. It requires no data. It returns a uint8 as its value every time the battery level changes until it is canceled via the cancel request. It also returns an ID for use with the cancel request.
Example request:
```json
{"type":8}
```
Example response:
```json
{"type":8,"value":63,"id":"70cce449-d8b8-4e07-a000-0ca4ee7a9c42","error":false}
```
---
### Motion
The motion request's type is 9. It requires no data. It returns data in the following format:
| Field | Type |
|-------|--------|
| X | 1nt16 |
| Y | 1nt16 |
| Z | 1nt16 |
The values will only update if the watch is not sleeping.
Example request:
```json
{"type":9}
```
Example response:
```json
{"type":9,"value":{"X":-220,"Y":475,"Z":-893},"error":false}
```
---
### Watch Motion
The watch motion request's type is 10. It requires no data. It returns the same data as the motion request as its value every time the watch moves until it is canceled via the cancel request. It also returns an ID for use with the cancel request.
Example request:
```json
{"type":10}
```
Example response:
```json
{"type":10,"value":{"X":-220,"Y":475,"Z":-893},"id":"d084789d-9fdc-4fce-878b-4408cd616901","error":false}
```
---
### Step Count
The step count request's type is 11. It requires no data and returns a `uint32` in its value field.
Example request:
```json
{"type":11}
```
Example response:
```json
{"type":11,"value":1043,"error":false}
```
---
### Watch Step Count
The watch step count request's type is 12. It requires no data. It returns a `uint32` in its value field every time the step count changes until it is canceled via the cancel request. It also returns an ID for use with the cancel request.
Example request:
```json
{"type":12}
```
Example response:
```json
{"type":12,"value":1045,"id":"54583e8f-80f6-45e3-a97f-b111defc0edc","error":false}
```
---
### Cancel
The cancel request's type is 13. It requires a string as data, containing the ID returned by a watch request. Once run, it will terminate the watch request, clean up anything it was using, and cause ITD to stop listening for its value from the watch.
Example request:
```json
{"type":13,"data":"54583e8f-80f6-45e3-a97f-b111defc0edc"}
```
Example response:
```json
{"type":13,"error":false}
```

12
content/socket/_index.md

@ -0,0 +1,12 @@
+++
chapter = true
pre = "<b>III. </b>"
title = "Socket"
weight = 3
+++
### Chapter III
# Socket
This chapter will document the API of the control socket exposed by ITD.

33
content/socket/types.md

@ -0,0 +1,33 @@
+++
title = "Types"
date = 2021-10-23T23:04:51-07:00
draft = true
weight = 1
+++
When making a request to ITD or receiving a response from it, a type integer is used to indicate what kind of request is being made. This page will document the integers and what they mean.
Here is a list of all the request types:
```go
const (
ReqTypeHeartRate = 0
ReqTypeBattLevel = 1
ReqTypeFwVersion = 2
ReqTypeFwUpgrade = 3
ReqTypeBtAddress = 4
ReqTypeNotify = 5
ReqTypeSetTime = 6
ReqTypeWatchHeartRate = 7
ReqTypeWatchBattLevel = 8
ReqTypeMotion = 9
ReqTypeWatchMotion = 10
ReqTypeStepCount = 11
ReqTypeWatchStepCount = 12
ReqTypeCancel = 13
)
```
The response types are always the same as the request type used.
ITD uses Go's `iota` keyword to generate these numbers, but I have placed their actual values on this page to make it easier to use them in other languages.

1
layouts/partials/logo.html

@ -0,0 +1 @@
<span style="font-size: 24pt;">ITD</span>

1
layouts/shortcodes/raw.html

@ -0,0 +1 @@
{{.Inner}}

16
themes/hugo-theme-relearn/.editorconfig

@ -0,0 +1,16 @@
# https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
[*.js]
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

14
themes/hugo-theme-relearn/.github/actions/build_site/action.yaml

@ -0,0 +1,14 @@
name: Build site
description: Builds the Hugo exampleSite for later deploy on GitHub-Pages
runs:
using: composite
steps:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
- name: Build site
shell: bash
run: |
hugo --minify --source ${GITHUB_WORKSPACE}/exampleSite --destination ${GITHUB_WORKSPACE}/../public --cleanDestinationDir --gc --baseURL https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/ --theme ${GITHUB_WORKSPACE}

73
themes/hugo-theme-relearn/.github/actions/check_milestone/action.yaml

@ -0,0 +1,73 @@
name: Check milestone
description: Checks if the given milestone and its according tag are valid to be released
inputs:
milestone:
description: Milestone for this release
required: true
github_token:
description: Secret GitHub token
required: true
outputs:
outcome:
description: Result of the check, success or failure
value: ${{ steps.outcome.outputs.outcome }}
runs:
using: composite
steps:
- name: Get tag uniqueness
id: unique_tag
uses: mukunku/tag-exists-action@v1.0.0
with:
tag: ${{ env.MILESTONE }}
env:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
- name: Get closed issues for milestone
id: closed_issues
uses: octokit/graphql-action@v2.x
with:
query: |
query {
search(first: 1, type: ISSUE, query: "user:${{ github.repository_owner }} repo:${{ github.event.repository.name }} milestone:${{ env.MILESTONE }} state:closed") {
issueCount
}
}
env:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
- name: Get open issues for milestone
id: open_issues
uses: octokit/graphql-action@v2.x
with:
query: |
query {
search(first: 1, type: ISSUE, query: "user:${{ github.repository_owner }} repo:${{ github.event.repository.name }} milestone:${{ env.MILESTONE }} state:open") {
issueCount
}
}
env:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
- name: Set outcome
id: outcome
shell: bash
run: |
if [ "${{ fromJSON(steps.closed_issues.outputs.data).search.issueCount > 0 && fromJSON(steps.open_issues.outputs.data).search.issueCount == 0 && steps.unique_tag.outputs.exists == 'false' }}" = "true" ]; then
echo "::set-output name=outcome::success"
else
echo "::set-output name=outcome::failure"
fi
- name: Log results and exit
shell: bash
run: |
echo outcome : ${{ steps.outcome.outputs.outcome }}
echo has unique tag : ${{ steps.unique_tag.outputs.exists == 'false' }}
echo has closed issues: ${{ fromJSON(steps.closed_issues.outputs.data).search.issueCount > 0 }}
echo has open issues : ${{ fromJSON(steps.open_issues.outputs.data).search.issueCount > 0 }}
if [ "${{ steps.outcome.outputs.outcome }}" = "failure" ]; then
exit 1
fi

17
themes/hugo-theme-relearn/.github/actions/deploy_site/action.yaml

@ -0,0 +1,17 @@
name: Deploy site
description: Deploys a built site on GitHub-Pages
inputs:
github_token:
description: Secret GitHub token
required: true
runs:
using: composite
steps:
- name: Deploy site
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ env.GITHUB_TOKEN }}
publish_dir: ${{ env.GITHUB_WORKSPACE }}/../public
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
GITHUB_WORKSPACE: ${{ github.workspace }}

64
themes/hugo-theme-relearn/.github/actions/release_milestone/action.yaml

@ -0,0 +1,64 @@
name: Release milestone
description: Creates a release with changelog and tag out of a given milestone
inputs:
milestone:
description: Milestone for this release
required: true
github_token:
description: Secret GitHub token
required: true
runs:
using: composite
steps:
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Close milestone
uses: Akkjon/close-milestone@v2
with:
milestone_name: ${{ env.MILESTONE }}
env:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
- name: Create provisionary tag
shell: bash
env:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git tag --message "" "$MILESTONE"
git push origin "$MILESTONE"
- name: Update changelog
shell: bash
env:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
npx github-release-notes@0.17.1 changelog --generate --override --tags=all
git add *
git commit --message "Ship tag $MILESTONE"
git push origin main
- name: Create final tag
shell: bash
env:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
git tag --force --message "" "$MILESTONE"
git push --force origin "$MILESTONE"
- name: Publish release
shell: bash
env:
MILESTONE: ${{ inputs.milestone }}
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
npx github-release-notes@0.17.1 release --tags "$MILESTONE"

28
themes/hugo-theme-relearn/.github/contributing.md

@ -0,0 +1,28 @@
# Guidelines
## For Development
- help us putting your code into production by opening a meaningful issue
- stay simple for the user by focusing on the mantra "convention over configuration"
- at installation the site should work reasonable without (m)any configuration
- stay close to the Hugo way
- don't use npm or any preprocessing, our contributors may not be front-end developers
- document new features in exampleSite
- don't break existing features if you don't have to
- remove reported issue from the browser's console
- be compatible to IE11, at least for main functionality, for Javascript this means:
- test in IE11
- check caniuse.com
- don't use arrow functions
- don't use template literals
- don't use other fancy new ES5/6 stuff
## For Release
- create releases following [semver policy](https://semver.org/)
- we are using GitHub actions to create new releases
- a release is based on a milestone named like the release itself - just the version number, eg: 1.1.0
- remember that there have to be at least one closed issue assigned to the milestone
- the release action only runs successfully if all assigned issues for this milestone are closed
- the milestone itself will be closed during execution of the action
- a once released milestone can not be released again

20
themes/hugo-theme-relearn/.github/workflows/build.yaml

@ -0,0 +1,20 @@
name: Build
on:
push: # Build on all pushes but only deploy for main branch
pull_request: # Build on all PRs regardless what branch
workflow_dispatch: # Allow this task to be manually started (you'll never know)
jobs:
ci:
name: Run build
runs-on: ubuntu-latest
if: github.event_name != 'push' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
- name: Build site
uses: ./.github/actions/build_site

25
themes/hugo-theme-relearn/.github/workflows/deploy.yaml

@ -0,0 +1,25 @@
name: Deploy
on:
push: # Build on all pushes but only deploy for main branch
workflow_dispatch: # Allow this task to be manually started (you'll never know)
jobs:
deploy:
name: Run deploy
runs-on: ubuntu-latest
if: github.event_name != 'push' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Build site
uses: ./.github/actions/build_site
- name: Deploy site
uses: ./.github/actions/deploy_site
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

42
themes/hugo-theme-relearn/.github/workflows/release.yaml

@ -0,0 +1,42 @@
name: Release
on:
workflow_dispatch:
inputs:
milestone:
description: 'Milestone for this release'
required: true
jobs:
release:
name: Run release
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Check milestone
id: check
uses: ./.github/actions/check_milestone
with:
milestone: ${{ github.event.inputs.milestone }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
if: ${{ steps.check.outputs.outcome == 'success' }}
uses: ./.github/actions/release_milestone
with:
milestone: ${{ github.event.inputs.milestone }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# We need to deploy the site again to show the updated changelog
- name: Build site
uses: ./.github/actions/build_site
- name: Deploy site
uses: ./.github/actions/deploy_site
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

4
themes/hugo-theme-relearn/.gitignore

@ -0,0 +1,4 @@
.DS_Store
public/
exampleSite/public
exampleSite/hugo*.exe

36
themes/hugo-theme-relearn/.grenrc.js

@ -0,0 +1,36 @@
module.exports = {
changelogFilename: "exampleSite/content/basics/CHANGELOG.md",
dataSource: "milestones",
groupBy: {
"Enhancements": [
"feature",
],
"Fixes": [
"bug"
],
"Maintenance": [
"task",
],
"Uncategorised": [
"closed",
],
},
ignoreLabels: [
"discussion",
"documentation",
"duplicate",
"hugo",
"invalid",
"support",
"wontfix",
],
ignoreTagsWith: [
"Relearn",
],
milestoneMatch: "{{tag_name}}",
onlyMilestones: true,
template: {
group: "\n### {{heading}}\n",
release: ({ body, date, release }) => `## ${release} (` + date.replace( /(\d+)\/(\d+)\/(\d+)/, '$3-$2-$1' ) + `)\n${body}`,
},
};

23
themes/hugo-theme-relearn/LICENSE

@ -0,0 +1,23 @@
The MIT License (MIT)
Copyright (c) 2021 Sören Weber
Copyright (c) 2017 Valere JEANTET
Copyright (c) 2016 MATHIEU CORNIC
Copyright (c) 2014 Grav
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

52
themes/hugo-theme-relearn/README.md

@ -0,0 +1,52 @@
# Hugo Relearn Theme
A theme for [Hugo](https://gohugo.io/) designed for documentation.
![Overview](https://github.com/McShelby/hugo-theme-relearn/raw/main/images/screenshot.png)
## Motivation
The theme initially was a fork of the great [Learn theme](https://github.com/matcornic/hugo-theme-learn) with the aim of fixing long outstanding bugs and adepting to latest Hugo features. As far as possible this theme tries to be a drop-in replacement for the Learn theme.
## Main features
- Automatic Search
- Multilingual mode
- Unlimited menu levels
- Automatic next/prev buttons to navigate through menu entries
- Image resizing, shadow…
- Attachments files
- List child pages
- Mermaid diagram (flowchart, sequence, gantt)
- Customizable look and feel and theme variants
- Buttons
- Tip/Note/Info/Warning boxes
- Expand
- Tabs
- File inclusion
## Installation
Visit the [installation instructions](https://mcshelby.github.io/hugo-theme-relearn/basics/installation) to learn how to setup the theme in your Hugo installation.
## Usage
Visit the [documentation](https://mcshelby.github.io/hugo-theme-relearn/) to learn about all available features and how to use them.
## Changelog
See the [changelog](https://mcshelby.github.io/hugo-theme-relearn/basics/history) for a complete list of releases.
## Contribution
You are most welcome to contribute to the source code but please visit the [contribution guidelines](https://github.com/McShelby/hugo-theme-relearn/blob/main/.github/contributing.md) first.
## License
This theme is licensed under the [MIT License](https://github.com/McShelby/hugo-theme-relearn/blob/main/LICENSE).
## Credits
Special thanks to [everyone who has contributed](https://github.com/McShelby/hugo-theme-relearn/graphs/contributors) to this project.
Many thanks to [@matcornic](https://github.com/matcornic) for his work on the [Learn theme](https://github.com/matcornic/hugo-theme-learn).

12
themes/hugo-theme-relearn/archetypes/chapter.md

@ -0,0 +1,12 @@
+++
chapter = true
pre = "<b>X. </b>"
title = "{{ replace .Name "-" " " | title }}"
weight = 5
+++
### Chapter X
# Some Chapter title
Lorem Ipsum.

6
themes/hugo-theme-relearn/archetypes/default.md

@ -0,0 +1,6 @@
+++
title = "{{ replace .Name "-" " " | title }}"
weight = 5
+++
Lorem Ipsum.

106
themes/hugo-theme-relearn/exampleSite/config.toml

@ -0,0 +1,106 @@
baseURL = "https://example.com"
canonifyURLs = true
languageCode = "en"
defaultContentLanguage = "en"
title = "Hugo Relearn Documentation"
theme = "hugo-theme-relearn"
themesdir = "../.."
relativeURLs = true
[params]
editURL = "https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/"
description = "Documentation for Hugo Relearn Theme"
author = "Sören Weber"
showVisitedLinks = true
disableBreadcrumb = false
disableNextPrev = false
disableLandingPageButton = true
disableMermaid = false
titleSeparator = "::"
themeVariant = "relearn"
disableSeoHiddenPages = true
[outputs]
home = ["HTML", "RSS", "JSON"] # add JSON to the home page to support lunr search
[markup]
[markup.highlight]
style = "base16-snazzy" # choose a color theme or create your own
guessSyntax = false # if set to true, avoid unstyled code if no language was given but mermaid code fences will not work anymore
[markup.goldmark.renderer]
unsafe= true
[module]
[module.hugoVersion]
min = "0.25"
[Languages]
[Languages.en]
title = "Documentation for Hugo Relearn Theme"
weight = 1
languageName = "English"
landingPageURL = "/"
landingPageName = "<i class='fas fa-home'></i> Home"
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-tags'></i> Tags"
url = "/tags/"
weight = 5
[[Languages.en.menu.shortcuts]]
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "/showcase/"
weight = 11
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bookmark'></i> Hugo Documentation"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
url = "/credits/"
weight = 30
[Languages.pir]
title = "Documentat'n fer Cap'n Hugo Relearrrn Theme"
weight = 1
languageName = "Arrr! Pirrrates"
landingPageURL = "/pir/"
landingPageName = "<i class='fas fa-home'></i> Arrr! Home"
[[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-tags'></i> Arrr! Tags"
url = "/tags/"
weight = 5
[[Languages.pir.menu.shortcuts]]
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
[[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "/showcase/"
weight = 11
[[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentat'n"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20
[[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Crrredits"
url = "/credits/"
weight = 30

52
themes/hugo-theme-relearn/exampleSite/content/_index.en.md

@ -0,0 +1,52 @@
+++
title = "Relearn Theme for Hugo"
+++
# Hugo Relearn Theme
The [Relearn theme](http://github.com/McShelby/hugo-theme-relearn) is a theme for [Hugo](https://gohugo.io/), a static website generator written in Go. Where Hugo is often used for blogs, this theme is designed with documentation in mind.
{{% notice info %}}
The theme initially was a fork of the great [Learn theme](https://github.com/matcornic/hugo-theme-learn) with the aim of fixing long outstanding bugs and adepting to latest Hugo features. As far as possible this theme tries to be a drop-in replacement for Learn theme.
{{% /notice %}}
## Main features
{{% notice tip %}}
See [what's new]({{% relref "basics/migration" %}}) within the latest update.
{{% /notice %}}
* [Automatic Search]({{%relref "basics/configuration/_index.md#activate-search" %}})
* [Multilingual mode]({{%relref "cont/i18n" %}})
* Unlimited menu levels
* Automatic next/prev buttons to navigate through menu entries
* [Image resizing, shadow...]({{%relref "cont/markdown#images" %}})
* [Attachments files]({{%relref "shortcodes/attachments" %}})
* [List child pages]({{%relref "shortcodes/children" %}})
* [Mermaid diagram]({{%relref "shortcodes/mermaid" %}}) (flowchart, sequence, gantt)
* [Customizable look and feel and theme variants]({{%relref "basics/customization"%}})
* [Buttons]({{%relref "shortcodes/button" %}})
* [Tip/Note/Info/Warning boxes]({{%relref "shortcodes/notice" %}})
* [Expand]({{%relref "shortcodes/expand" %}})
* [Tabs]({{%relref "shortcodes/tabs" %}})
* [File inclusion]({{%relref "shortcodes/include" %}})
![Screenshot](https://github.com/McShelby/hugo-theme-relearn/raw/main/images/screenshot.png?width=40pc&classes=shadow)
## Getting support
To get support, feel free to open a new [discussion topic](https://github.com/McShelby/hugo-theme-relearn/discussions) or [issue](https://github.com/McShelby/hugo-theme-relearn/issues) in the official repository on GitHub.
## Become a contributor
Feel free to update this documentation by just clicking the **Edit this page** link displayed on top right of each page. Your changes will be deployed automatically once they were reviewed.
You are most welcome to contribute bugfixes or even new features to the source code by making pull requests to the [official repository](https://github.com/McShelby/hugo-theme-relearn) via GitHub. Please visit the [contribution guidelines](https://github.com/McShelby/hugo-theme-relearn/blob/main/.github/contributing.md) first.
## License
This theme is licensed under the [MIT License](https://github.com/McShelby/hugo-theme-relearn/blob/main/LICENSE).
## Credits
This theme would not be possible without the work of many others. See the [credits]({{%relref "credits" %}}) for a detailed list.

4
themes/hugo-theme-relearn/exampleSite/content/_index.pir.md

@ -0,0 +1,4 @@
+++
title = "Relearrrn Theme fer Cap'n Hugo"
+++
{{< piratify >}}

228
themes/hugo-theme-relearn/exampleSite/content/basics/CHANGELOG.md

@ -0,0 +1,228 @@
# Changelog
## 2.6.0 (2021-10-21)
### Fixes
- [**bug**] theme: generate correct links if theme served from subdirectory [#120](https://github.com/McShelby/hugo-theme-relearn/issues/120)
+++
## 2.5.1 (2021-10-12)
### Fixes
- [**bug**] security: fix XSS for malicioius image URLs [#117](https://github.com/McShelby/hugo-theme-relearn/issues/117)
+++
## 2.5.0 (2021-10-08)
### Enhancements
- [**feature**] syntax highlight: provide default colors for unknown languages [#113](https://github.com/McShelby/hugo-theme-relearn/issues/113)
### Fixes
- [**bug**] security: fix XSS for malicioius URLs [#114](https://github.com/McShelby/hugo-theme-relearn/issues/114)
- [**bug**] menu: write correct local shortcut links [#112](https://github.com/McShelby/hugo-theme-relearn/issues/112)
+++
## 2.4.1 (2021-10-07)
### Fixes
- [**bug**] theme: remove runtime styles from print [#111](https://github.com/McShelby/hugo-theme-relearn/issues/111)
+++
## 2.4.0 (2021-10-07)
### Enhancements
- [**feature**] lang: add vietnamese translation [#109](https://github.com/McShelby/hugo-theme-relearn/issues/109)
- [**feature**] theme: simplify stylesheet for color variants [#107](https://github.com/McShelby/hugo-theme-relearn/issues/107)
- [**feature**] hidden pages: remove from RSS feed, JSON, taxonomy etc [#102](https://github.com/McShelby/hugo-theme-relearn/issues/102)
- [**feature**] theme: announce alternative content in header [#101](https://github.com/McShelby/hugo-theme-relearn/issues/101)
- [**feature**] menu: frontmatter option to change sort predicate [#98](https://github.com/McShelby/hugo-theme-relearn/issues/98)
- [**feature**] menu: add default setting for menu expansion [#97](https://github.com/McShelby/hugo-theme-relearn/issues/97)
- [**feature**] theme: improve print style [#93](https://github.com/McShelby/hugo-theme-relearn/issues/93)
- [**feature**] theme: improve style [#92](https://github.com/McShelby/hugo-theme-relearn/issues/92)
### Fixes
- [**bug**] include: don't generate additional HTML if file should be displayed "as is" [#110](https://github.com/McShelby/hugo-theme-relearn/issues/110)
- [**bug**] attachments: fix broken links if multilang config is used [#105](https://github.com/McShelby/hugo-theme-relearn/issues/105)
- [**bug**] theme: fix sticky header to remove horizontal scrollbar [#82](https://github.com/McShelby/hugo-theme-relearn/issues/82)
### Maintenance
- [**task**] chore: update fontawesome [#94](https://github.com/McShelby/hugo-theme-relearn/issues/94)
+++
## 2.3.2 (2021-09-20)
### Fixes
- [**bug**] docs: rename history pirate translation [#91](https://github.com/McShelby/hugo-theme-relearn/issues/91)
+++
## 2.3.1 (2021-09-20)
### Fixes
- [**bug**] docs: rename english pirate translation to avoid crash on rendering [#90](https://github.com/McShelby/hugo-theme-relearn/issues/90)
+++
## 2.3.0 (2021-09-13)
### Fixes
- [**bug**] theme: fix usage of section element [#88](https://github.com/McShelby/hugo-theme-relearn/issues/88)
### Maintenance
- [**task**] theme: ensure IE11 compatiblity [#89](https://github.com/McShelby/hugo-theme-relearn/issues/89)
- [**task**] docs: Arrr! showcase multilang featurrre [#87](https://github.com/McShelby/hugo-theme-relearn/issues/87)
+++
## 2.2.0 (2021-09-09)
### Enhancements
- [**feature**] sitemap: hide hidden pages from sitemap and SEO indexing [#85](https://github.com/McShelby/hugo-theme-relearn/issues/85)
### Fixes
- [**bug**] theme: fix showVisitedLinks in case Hugo is configured to modify relative URLs [#86](https://github.com/McShelby/hugo-theme-relearn/issues/86)
### Maintenance
- [**task**] theme: switch from data-vocabulary to schema [#84](https://github.com/McShelby/hugo-theme-relearn/issues/84)
+++
## 2.1.0 (2021-09-07)
### Enhancements
- [**feature**] search: open expand if it contains search term [#80](https://github.com/McShelby/hugo-theme-relearn/issues/80)
- [**feature**] menu: scroll active item into view [#79](https://github.com/McShelby/hugo-theme-relearn/issues/79)
- [**feature**] search: disable search in hidden pages [#76](https://github.com/McShelby/hugo-theme-relearn/issues/76)
- [**feature**] search: improve readablility of index.json [#75](https://github.com/McShelby/hugo-theme-relearn/issues/75)
- [**feature**] search: increase performance [#74](https://github.com/McShelby/hugo-theme-relearn/issues/74)
- [**feature**] search: improve search context preview [#73](https://github.com/McShelby/hugo-theme-relearn/issues/73)
### Fixes
- [**bug**] search: hide non-site content [#81](https://github.com/McShelby/hugo-theme-relearn/issues/81)
- [**bug**] menu: always hide hidden sub pages [#77](https://github.com/McShelby/hugo-theme-relearn/issues/77)
+++
## 2.0.0 (2021-08-28)
### Enhancements
- [**feature**] tabs: enhance styling [#65](https://github.com/McShelby/hugo-theme-relearn/issues/65)
- [**feature**] theme: improve readability [#64](https://github.com/McShelby/hugo-theme-relearn/issues/64)
- [**feature**] menu: show hidden pages if accessed directly [#60](https://github.com/McShelby/hugo-theme-relearn/issues/60)
- [**feature**] theme: treat pages without title as hidden [#59](https://github.com/McShelby/hugo-theme-relearn/issues/59)
- [**feature**] search: show search results if field gains focus [#58](https://github.com/McShelby/hugo-theme-relearn/issues/58)
- [**feature**] theme: add partial templates for pre/post menu entries [#56](https://github.com/McShelby/hugo-theme-relearn/issues/56)
- [**feature**] theme: make chapter archetype more readable [#55](https://github.com/McShelby/hugo-theme-relearn/issues/55)
- [**feature**] children: add parameter for container style [#53](https://github.com/McShelby/hugo-theme-relearn/issues/53)
- [**feature**] theme: make content a template [#50](https://github.com/McShelby/hugo-theme-relearn/issues/50)
- [**feature**] menu: control menu expansion with alwaysopen parameter [#49](https://github.com/McShelby/hugo-theme-relearn/issues/49)
- [**feature**] include: new shortcode to include other files [#43](https://github.com/McShelby/hugo-theme-relearn/issues/43)
- [**feature**] theme: adjust print styles [#35](https://github.com/McShelby/hugo-theme-relearn/issues/35)
- [**feature**] code highligher: switch to standard hugo highlighter [#32](https://github.com/McShelby/hugo-theme-relearn/issues/32)
### Fixes
- [**bug**] arrow-nav: default sorting ignores ordersectionsby [#63](https://github.com/McShelby/hugo-theme-relearn/issues/63)
- [**bug**] children: default sorting ignores ordersectionsby [#62](https://github.com/McShelby/hugo-theme-relearn/issues/62)
- [**bug**] arrow-nav: fix broken links on (and below) hidden pages [#61](https://github.com/McShelby/hugo-theme-relearn/issues/61)
- [**bug**] theme: remove superflous singular taxonomy from taxonomy title [#46](https://github.com/McShelby/hugo-theme-relearn/issues/46)
- [**bug**] theme: missing --MENU-HOME-LINK-HOVER-color in documentation [#45](https://github.com/McShelby/hugo-theme-relearn/issues/45)
- [**bug**] theme: fix home link when base URL has some path [#44](https://github.com/McShelby/hugo-theme-relearn/issues/44)
### Maintenance
- [**task**] docs: include changelog in exampleSite [#33](https://github.com/McShelby/hugo-theme-relearn/issues/33)
+++
## 1.2.0 (2021-07-26)
### Enhancements
- [**feature**] theme: adjust copy-to-clipboard [#29](https://github.com/McShelby/hugo-theme-relearn/issues/29)
- [**feature**] attachments: adjust style between notice boxes and attachments [#28](https://github.com/McShelby/hugo-theme-relearn/issues/28)
- [**feature**] theme: adjust blockquote contrast [#27](https://github.com/McShelby/hugo-theme-relearn/issues/27)
- [**feature**] expand: add option to open on page load [#25](https://github.com/McShelby/hugo-theme-relearn/issues/25)
- [**feature**] expand: rework styling [#24](https://github.com/McShelby/hugo-theme-relearn/issues/24)
- [**feature**] attachments: sort output [#23](https://github.com/McShelby/hugo-theme-relearn/issues/23)
- [**feature**] notice: make restyling of notice boxes more robust [#20](https://github.com/McShelby/hugo-theme-relearn/issues/20)
- [**feature**] notice: fix contrast issues [#19](https://github.com/McShelby/hugo-theme-relearn/issues/19)
- [**feature**] notice: align box colors to common standards [#18](https://github.com/McShelby/hugo-theme-relearn/issues/18)
- [**feature**] notice: use distinct icons for notice box type [#17](https://github.com/McShelby/hugo-theme-relearn/issues/17)
### Fixes
- [**bug**] attachments: support i18n for attachment size [#21](https://github.com/McShelby/hugo-theme-relearn/issues/21)
- [**bug**] notice: support i18n for box labels [#16](https://github.com/McShelby/hugo-theme-relearn/issues/16)
- [**bug**] notice: support multiple blocks in one box [#15](https://github.com/McShelby/hugo-theme-relearn/issues/15)
### Maintenance
- [**task**] dependency: upgrade jquery to 3.6.0 [#30](https://github.com/McShelby/hugo-theme-relearn/issues/30)
+++
## 1.1.1 (2021-07-04)
### Maintenance
- [**task**] theme: prepare for new hugo theme registration [#13](https://github.com/McShelby/hugo-theme-relearn/issues/13)
+++
## 1.1.0 (2021-07-02)
### Enhancements
- [**feature**] mermaid: expose options in config.toml [#4](https://github.com/McShelby/hugo-theme-relearn/issues/4)
### Fixes
- [**bug**] mermaid: config option for CDN url not used [#12](https://github.com/McShelby/hugo-theme-relearn/issues/12)
- [**bug**] mermaid: only highlight text in HTML elements [#10](https://github.com/McShelby/hugo-theme-relearn/issues/10)
- [**bug**] mermaid: support pan & zoom for graphs [#9](https://github.com/McShelby/hugo-theme-relearn/issues/9)
- [**bug**] mermaid: code fences not always rendered [#6](https://github.com/McShelby/hugo-theme-relearn/issues/6)
- [**bug**] mermaid: search term on load may bomb chart [#5](https://github.com/McShelby/hugo-theme-relearn/issues/5)
### Maintenance
- [**task**] mermaid: update to 8.10.2 [#7](https://github.com/McShelby/hugo-theme-relearn/issues/7)
+++
## 1.0.1 (2021-07-01)
### Maintenance
- [**task**] Prepare for hugo showcase [#3](https://github.com/McShelby/hugo-theme-relearn/issues/3)
+++
## 1.0.0 (2021-07-01)
### Maintenance
- [**task**] Fork project [#1](https://github.com/McShelby/hugo-theme-relearn/issues/1)

11
themes/hugo-theme-relearn/exampleSite/content/basics/_index.en.md

@ -0,0 +1,11 @@
+++
chapter = true
title = "Basics"
weight = 1
+++
### Chapter 1
# Basics
Discover what this Hugo theme is all about and the core-concepts behind it.

6
themes/hugo-theme-relearn/exampleSite/content/basics/_index.pir.md

@ -0,0 +1,6 @@
+++
chapter = true
title = "Basics"
weight = 1
+++
{{< piratify >}}

135
themes/hugo-theme-relearn/exampleSite/content/basics/configuration/_index.en.md

@ -0,0 +1,135 @@
+++
title = "Configuration"
weight = 20
+++
## Global site parameters
On top of [Hugo global configuration](https://gohugo.io/overview/configuration/), the Relearn theme lets you define the following parameters in your `config.toml` (here, values are default).
Note that some of these parameters are explained in details in other sections of this documentation.
```toml
[params]
# This controls whether submenus will be expanded (true), or collapsed (false) in the
# menu; if no setting is given, the first menu level is set to false, all others to true;
# this can be overridden in the pages frontmatter
alwaysopen = true
# Prefix URL to edit current page. Will display an "Edit this page" button on top right hand corner of every page.
# Useful to give opportunity to people to create merge request for your doc.
# See the config.toml file from this documentation site to have an example.
editURL = ""
# Author of the site, will be used in meta information
author = ""
# Description of the site, will be used in meta information
description = ""
# Shows a checkmark for visited pages on the menu
showVisitedLinks = false
# Disable search function. It will hide search bar
disableSearch = false
# Disable search in hidden pages, otherwise they will be shown in search box
disableSearchHiddenPages = false
# Disables hidden pages from showing up in the sitemap and on Google (et all), otherwise they may be indexed by search engines
disableSeoHiddenPages = false
# Disables hidden pages from showing up on the tags page although the tag term will be displayed even if all pages are hidden
disableTagHiddenPages = false
# Javascript and CSS cache are automatically busted when new version of site is generated.
# Set this to true to disable this behavior (some proxies don't handle well this optimization)
disableAssetsBusting = false
# Set this to true to disable copy-to-clipboard button for inline code.
disableInlineCopyToClipBoard = false
# A title for shortcuts in menu is set by default. Set this to true to disable it.
disableShortcutsTitle = false
# If set to false, a Home button will appear below the search bar on the menu.
# It is redirecting to the landing page of the current language if specified. (Default is "/")
disableLandingPageButton = true
# When using mulitlingual website, disable the switch language button.
disableLanguageSwitchingButton = false
# Hide breadcrumbs in the header and only show the current page title
disableBreadcrumb = true
# If set to true, prevents Hugo from including the Mermaid module if not needed (will reduce load times and traffic)
disableMermaid = false
# Specifies the remote location of the Mermaid js
customMermaidURL = "https://unpkg.com/mermaid@8.8.0/dist/mermaid.min.js"
# Initialization parameter for Mermaid, see Mermaid documentation
mermaidInitialize = "{ \"theme\": \"default\" }"
# Hide Next and Previous page buttons normally displayed full height beside content
disableNextPrev = true
# Order sections in menu by "weight" or "title". Default to "weight";
# this can be overridden in the pages frontmatter
ordersectionsby = "weight"
# Change default color scheme with a variant one. Can be "red", "blue", "green".
themeVariant = ""
# Provide a list of custom css files to load relative from the `static/` folder in the site root.
custom_css = ["css/foo.css", "css/bar.css"]
# Change the title separator. Default to "::".
titleSeparator = "-"
```
## A word on running your site in a subfolder
The theme runs best if your site is installed in the root of your webserver. If your site is served from a subfolder, eg. `https://example.com/mysite/`, you have to set the following lines to your `config.toml`
````toml
baseURL = "https://example.com/mysite/"
canonifyURLs = true
````
Without `canonifyURLs=true` URLs in sublemental pages (like `sitemap.xml`, `rss.xml`) will be generated falsly while your HTML files will still work. See https://github.com/gohugoio/hugo/issues/5226.
## Activate search
If not already present, add the follow lines in the same `config.toml` file.
```toml
[outputs]
home = [ "HTML", "RSS", "JSON"]
```
Relearn theme uses the last improvement available in hugo version 20+ to generate a json index file ready to be consumed by lunr.js javascript search engine.
> Hugo generate lunrjs index.json at the root of public folder.
> When you build the site with `hugo server`, hugo generates it internally and of course it doesn’t show up in the filesystem
## Mermaid
The Mermaid configuration parameters can also be set on a specific page. In this case, the global parameter would be overwritten by the local one. See [Mermaid]({{< relref "shortcodes/mermaid.md" >}}) for additional documentation.
> Example:
>
> Mermaid is globally disabled. By default it won't be loaded by any page.
> On page "Architecture" you need a class diagram. You can set the Mermaid parameters locally to only load mermaid on this page (not on the others).
You also can disable Mermaid for specific pages while globally enabled.
## Home Button Configuration
If the `disableLandingPageButton` option is set to `false`, a Home button will appear
on the left menu. It is an alternative for clicking on the logo. To edit the
appearance, you will have to configure two parameters for the defined languages:
```toml
[Lanugages]
[Lanugages.en]
...
landingPageURL = "/"
landingPageName = "<i class='fas fa-home'></i> Home"
...
[Lanugages.pir]
...
landingPageURL = "/pir/"
landingPageName = "<i class='fas fa-home'></i> Arrr! Homme"
...
```
If those params are not configured for a specific language, they will get their
default values:
```toml
landingPageURL = "/"
landingPageName = "<i class='fas fa-home'></i> Home"
```
The home button is going to look like this:
![Default Home Button](/basics/configuration/images/home_button_defaults.png?width=100%)

5
themes/hugo-theme-relearn/exampleSite/content/basics/configuration/_index.pir.md

@ -0,0 +1,5 @@
+++
title = "Configurrrat'n"
weight = 20
+++
{{< piratify >}}

BIN
themes/hugo-theme-relearn/exampleSite/content/basics/configuration/images/home_button_defaults.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

133
themes/hugo-theme-relearn/exampleSite/content/basics/customization/_index.en.md

@ -0,0 +1,133 @@
+++
title = "Customization"
weight = 25
+++
The Relearn theme has been built to be as configurable as possible by defining multiple [partials](https://gohugo.io/templates/partials/)
In `themes/hugo-theme-relearn/layouts/partials/`, you will find all the partials defined for this theme. If you need to overwrite something, don't change the code directly. Instead [follow this page](https://gohugo.io/themes/customizing/). You'd create a new partial in the `layouts/partials` folder of your local project. This partial will have the priority.
This theme defines the following partials :
- *content*: the content page itself. This can be overridden if you wan't to display page's meta data above or below the content.
- *header*: the header of the content page (contains the breadcrumbs). _Not meant to be overwritten_
- *custom-header*: custom headers in page. Meant to be overwritten when adding CSS imports. Don't forget to include `style` HTML tag directive in your file
- *footer*: the footer of the content page (contains the arrows). _Not meant to be overwritten_
- *custom-footer*: custom footer in page. Meant to be overwritten when adding Javacript. Don't forget to include `javascript` HTML tag directive in your file
- *favicon*: the favicon
- *logo*: the logo, on top left hand corner.
- *meta*: HTML meta tags, if you want to change default behavior
- *menu*: left menu. _Not meant to be overwritten_
- *menu-pre*: side-wide configuration to prepend to menu items. If you override this, it is your responsiblity to take the page's `pre` setting into account.
- *menu-post*: side-wide configuration to append to menu items. If you override this, it is your responsiblity to take the page's `post` setting into account.
- *menu-footer*: footer of the the left menu
- *search*: search box
- *toc*: table of contents
## Change the logo
Create a new file in `layouts/partials/` named `logo.html`. Then write any HTML you want.
You could use an `img` HTML tag and reference an image created under the *static* folder, or you could paste a SVG definition!
{{% notice note %}}
The size of the logo will adapt automatically
{{% /notice %}}
## Change the favicon
If your favicon is a png, just drop off your image in your local `static/images/` folder and name it `favicon.png`
If you need to change this default behavior, create a new file in `layouts/partials/` named `favicon.html`. Then write something like this:
```html
<link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" />
```
## Change default colors {#theme-variant}
The Relearn theme let you choose between some predefined color scheme variants, but feel free to add one yourself!