Skip to content

Commit 1594500

Browse files
authored
Merge pull request #523 from SpineEventEngine/theme-update
Get the latest documentation updates and bump the Hugo version
2 parents 6f3ba62 + 3698ef1 commit 1594500

File tree

6 files changed

+89
-43
lines changed

6 files changed

+89
-43
lines changed

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- staging
88

99
env:
10-
HUGO_VERSION: 0.147.8
10+
HUGO_VERSION: 0.150.0
1111
GH_USER: site-commons-machine-user
1212

1313
jobs:

AUTHORING.md

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ This document is a guide for adding content to the [spine.io](https://spine.io)
1313
* [Main navigation](#main-navigation)
1414
* [Documentation side navigation](#documentation-side-navigation)
1515
* [Documentation “Next/Prev” buttons](#documentation-nextprev-buttons)
16-
* [Adding code samples to the site](#adding-code-samples-to-the-site)
16+
* [Adding code samples to the site](#adding-code-samples-to-the-site)
1717
* [Testing broken links](#testing-broken-links)
18-
* [Cloak email](#cloak-email)
19-
* [Note blocks](#note-blocks)
18+
* [Cloak email](#cloak-email)
19+
* [Note blocks](#note-blocks)
20+
* [Code blocks](#code-blocks)
21+
* [With triple backticks](#1-with-triple-backticks)
22+
* [Using `highlight` shortcode](#2-using-highlight-shortcode)
2023

2124
<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
2225

@@ -156,3 +159,60 @@ You can use only predefined classes such as: `note`, `warning`, or `lead`.
156159
The test lead block.
157160
{{% /note-block %}}
158161
```
162+
163+
# Code blocks
164+
165+
There are two ways to add code blocks with syntax highlighting.
166+
167+
### 1. With triple backticks
168+
169+
Please always specify the [language syntax][syntax-highlighting-languages]
170+
to avoid problems with the layout.
171+
172+
````markdown
173+
```bash
174+
git clone [email protected]:spine-examples/hello.git
175+
```
176+
````
177+
178+
You can configure the appearance of Hugo code blocks using parameters,
179+
as described in the official [documentation][code-fences-doc]:
180+
181+
* `linenos=table` – configures line numbers and renders them in a table view.
182+
The table view is necessary for correct copying of code.
183+
* `hl_lines=[8,"15-17"]` – lists a set of line numbers or line number ranges
184+
to be additionally highlighted.
185+
* `linenostart=199` – starts the line number count from 199.
186+
187+
````markdown
188+
```java {linenos=table,hl_lines=[8,"15-17"],linenostart=199}
189+
// ... code
190+
```
191+
````
192+
193+
### 2. Using `highlight` shortcode"
194+
195+
The `highlight` shortcode allows to set custom visibility options related to this project,
196+
such as custom CSS classes, the text highlighting on the selected line, a file name bar, etc.
197+
198+
```markdown
199+
{{< highlight lang="java" params="hl_lines=10 19, linenos=table" class="hl-text-only" >}}
200+
@BeforeEach
201+
void sendCommand() {
202+
...
203+
}
204+
{{< /highlight >}}
205+
```
206+
207+
Where:
208+
209+
* `lang` – the language syntax. See the [supported languages][syntax-highlighting-languages].
210+
* `params` – optional standard Hugo highlighting parameters as a string.
211+
* `file` – an optional name of the code file to display on the code header panel.
212+
* `class` – an optional class name that the code block will be wrapped in.
213+
214+
The class `hl-text-only` is predefined and used to highlight only the text without highlighting
215+
the entire line with background.
216+
217+
[code-fences-doc]: https://gohugo.io/content-management/syntax-highlighting/#highlighting-in-code-fences
218+
[syntax-highlighting-languages]: https://gohugo.io/content-management/syntax-highlighting/#languages

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ into the pages, please see the [`_code/EMBEDDING.md`](_code/EMBEDDING.md) file.
1717

1818
## Prerequisites
1919

20-
1. Install [Java JDK] version `11` to build the site.
21-
2. Install [Go][go] at least version `1.12`.
22-
2. Install [Node.js][nodejs]. Its version should be `18+`.
23-
3. Install [Hugo Extended][hugo-quick-start] at least version `v0.145` or higher.
24-
4. Get access to the [`site-commons`][site-commons] repository from the admins
25-
to be able to download the theme.
26-
5. Make sure [SSH][site-commons-ssh] is configured correctly and the passphrase is stored in the keychain.
27-
6. Install project dependencies from the `site` directory by running `npm install`.
20+
1. JDK 8 (x86_64).
21+
2. [Go][go] `1.12` or newer.
22+
3. [Node.js][nodejs] `18+`.
23+
4. [Hugo Extended][hugo-quick-start] in version `v0.150.0` or higher.
24+
5. Access to the [`site-commons`][site-commons] repository — to download the theme.
25+
26+
## Configuration
27+
28+
1. Make sure [SSH][site-commons-ssh] configured correctly and the passphrase is stored in the keychain.
29+
2. Install project dependencies from the `site` directory by running `npm install`.
2830

2931
## Running the site locally
3032

@@ -47,6 +49,16 @@ Another way to run the site locally is to follow these steps:
4749
hugo server
4850
```
4951

52+
If you receive a `permission denied` message, but you are sure that you have
53+
all the rights to the [required repositories](#prerequisites), try clearing
54+
the cache:
55+
56+
```shell
57+
hugo mod clean --all
58+
```
59+
60+
Then run the `hugo serve` again.
61+
5062
## Documentation
5163

5264
The documentation is located in a [separate repository][documentation-repo].

site/assets/scss/base/_override.scss

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,34 +41,8 @@ a:focus {
4141
text-decoration: underline;
4242
}
4343

44-
a:focus {text-decoration: none;}
45-
46-
a.external-link {
47-
white-space: nowrap;
48-
49-
&:after {
50-
content: '\2192';
51-
font-weight: 300;
52-
width: 8px;
53-
height: 8px;
54-
overflow: hidden;
55-
text-align: right;
56-
line-height: 6px;
57-
text-indent: -11px;
58-
opacity: .6;
59-
transform: rotate(-45deg);
60-
transition: opacity .16s ease-in;
61-
vertical-align: super;
62-
font-size: smaller;
63-
text-decoration: none;
64-
display: inline-block;
65-
}
66-
67-
&:hover {
68-
&:after {
69-
color: $second-brand-color;
70-
}
71-
}
44+
a:focus {
45+
text-decoration: none;
7246
}
7347

7448
.nofloat {

site/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module github.com/SpineEventEngine/SpineEventEngine.github.io
33
go 1.22.0
44

55
require (
6-
github.com/SpineEventEngine/documentation/docs v0.0.0-20251217134201-04d842c3fd36 // indirect
6+
github.com/SpineEventEngine/documentation/docs v0.0.0-20251218172704-bae518144b35 // indirect
77
github.com/TeamDev-Ltd/site-commons v0.0.0-20251202150534-a795438915ff // indirect
88
)

site/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
github.com/SpineEventEngine/documentation/docs v0.0.0-20251217134201-04d842c3fd36 h1:DNwC/NGdu7h44/QOJCfJZlfh/jPKNcKufFxY6eK6+90=
2-
github.com/SpineEventEngine/documentation/docs v0.0.0-20251217134201-04d842c3fd36/go.mod h1:0lSB4kPZY9Qk429mepYiraNIEucYDIwiNVhJ3Wn3gKo=
1+
github.com/SpineEventEngine/documentation/docs v0.0.0-20251218172704-bae518144b35 h1:ejTQ+jaJMC6Erz5wAcnTYV52VOEYtDsGYqsqmS3GqYk=
2+
github.com/SpineEventEngine/documentation/docs v0.0.0-20251218172704-bae518144b35/go.mod h1:0lSB4kPZY9Qk429mepYiraNIEucYDIwiNVhJ3Wn3gKo=
33
github.com/TeamDev-Ltd/site-commons v0.0.0-20251202150534-a795438915ff h1:8kjfGJhf6LeS+IlK9NRktxtcv6O/WDneBuQD3QLPGIs=
44
github.com/TeamDev-Ltd/site-commons v0.0.0-20251202150534-a795438915ff/go.mod h1:atDeksDWBzsIidpW6Ivz2yYHwp2JPa1i1KXIxkctQ3c=

0 commit comments

Comments
 (0)