Skip to content

Commit 3226543

Browse files
authored
Switch to "Hugo Relearn" theme (contao#1501)
1 parent 3cba55f commit 3226543

File tree

107 files changed

+1412
-2093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1412
-2093
lines changed

.github/workflows/build_and_deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Hugo
1818
uses: peaceiris/actions-hugo@v2
1919
with:
20-
hugo-version: '0.135.0'
20+
hugo-version: '0.144.2'
2121
- name: Build user manual
2222
run: make build-manual
2323
- name: Build developer manual

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "page/themes/hugo-theme-learn"]
2-
path = page/themes/hugo-theme-learn
3-
url = https://github.com/matcornic/hugo-theme-learn
1+
[submodule "page/themes/hugo-theme-relearn"]
2+
path = page/themes/hugo-theme-relearn
3+
url = https://github.com/McShelby/hugo-theme-relearn

CONTRIBUTING.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Only major versions are documented (e.g. Contao 4 and later on Contao 5).
99
## General rules
1010

1111
* Only use ATX style headlines (e.g. `# H1` or `### H3`).
12-
* See [learn.netlify.app/en/cont/markdown/](https://learn.netlify.app/en/cont/markdown/)
13-
and [learn.netlify.app/en/shortcodes/](https://learn.netlify.app/en/shortcodes/)
12+
* See [mcshelby.github.io/hugo-theme-relearn/authoring/markdown/](https://mcshelby.github.io/hugo-theme-relearn/authoring/markdown/index.html)
13+
and [mcshelby.github.io/hugo-theme-relearn/shortcodes/](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/index.html)
1414
for available markdown and shortcode syntax.
1515
* Always add two empty lines above each headline.
1616
* Add line breaks after 140 characters in paragraphs.
@@ -71,13 +71,13 @@ The short code tabs allows you to group content. Very handy for providing code s
7171
providing configuration in different formats.
7272

7373
```
74-
{{< tabs groupId="Example">}}
74+
{{< tabs groupid="Example" style="code" >}}
7575
76-
{{% tab name="PHP" %}}
76+
{{% tab title="PHP" %}}
7777
Lorem ipsum dolor sit amet ...
7878
{{% /tab %}}
7979
80-
{{% tab name="Twig" %}}
80+
{{% tab title="Twig" %}}
8181
Lorem ipsum dolor sit amet ...
8282
{{% /tab %}}
8383
@@ -118,6 +118,9 @@ Lorem ipsum dolor sit amet ...
118118
{{% /faq %}}
119119
```
120120

121+
_Note:_ only use this for actual FAQs - otherwise use the [`expand`](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/expand/index.html)
122+
shortcode.
123+
121124

122125
## New features
123126

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you just want to contribute content, read the [CONTRIBUTING](CONTRIBUTING.md)
88

99
## Cloning
1010

11-
The project installs the Hugo Learn theme as a git submodule. Thus when cloning
11+
The project installs the [Hugo Relearn Theme](https://mcshelby.github.io/hugo-theme-relearn/) as a git submodule. Thus when cloning
1212
the repository, you need to use the `--recurse-submodules` parameter:
1313

1414
```bash
@@ -23,12 +23,20 @@ git clone --recurse-submodules https://github.com/contao/docs.git
2323

2424
## Updating the Theme
2525

26-
To update the theme after cloning, simply run the following command:
26+
Due to the switch of the theme from Hugo Learn to Hugo Relearn, you will need to execute
2727

2828
```bash
29-
git submodule foreach git pull origin master
29+
git submodule sync
30+
git submodule update
3031
```
3132

33+
once, if you had already checked out the repository before the switch.
34+
35+
To update the theme after cloning - or after the theme switch, run the following command:
36+
37+
```bash
38+
git submodule foreach git pull origin main
39+
```
3240

3341
## Build
3442

docs/dev/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: "Contao Developer Documentation"
2+
title: Contao Developer Documentation
3+
type: home
34
---
45

56

docs/dev/framework/content-elements.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ As mentioned previously a content element is registered by registering a control
128128
| Option | Type | Description |
129129
| -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------|
130130
| name | `string` | Must be `contao.content_element`. |
131-
| type | `string` | _Optional:_ The *type* mentioned in [Type]({{< ref "#type" >}}) can be customized. |
131+
| type | `string` | _Optional:_ The *type* mentioned in [Type]({{% ref "#type" %}}) can be customized. |
132132
| category | `string` | Defines in which option group this content element will be placed in the content element selector. |
133133
| template | `string` | _Optional:_ Override the generated template name. |
134134
| renderer | `string` | _Optional:_ The renderer can be changed to `inline` or `esi`. Defaults to `forward`. See [Caching Fragments][fragments] for more details. |
@@ -137,9 +137,9 @@ As mentioned previously a content element is registered by registering a control
137137

138138
Applying the service tag can either be done via PHP attributes, annotations or via the YAML configuration.
139139

140-
{{< tabs groupId="attribute-annotation-yaml" >}}
140+
{{< tabs groupid="attribute-annotation-yaml" style="code" >}}
141141

142-
{{% tab name="Attribute" %}}
142+
{{% tab title="Attribute" %}}
143143
{{< version-tag "4.13" >}} A content element can be registered using the `AsContentElement` PHP attribute.
144144

145145
```php
@@ -190,7 +190,7 @@ class ExampleElementController extends AbstractContentElementController
190190
However, it is recommended to only define what you need and otherwise leave the defaults.
191191
{{% /tab %}}
192192

193-
{{% tab name="Annotation" %}}
193+
{{% tab title="Annotation" %}}
194194
{{< version-tag "4.8" >}} A content element can be registered using the `ContentElement` annotation. The annotation can be used on the class of the content element,
195195
if the class is invokable (has an `__invoke` method) or extends from the `AbstractContentElementController`. Otherwise the annotation can be
196196
used on the method that will deliver the response.
@@ -247,7 +247,7 @@ class ExampleElementController extends AbstractContentElementController
247247
However, it is recommended to only define what you need and otherwise leave the defaults.
248248
{{% /tab %}}
249249

250-
{{% tab name="YAML" %}}
250+
{{% tab title="YAML" %}}
251251
{{< version-tag "4.8" >}} A content element can be registered using the `contao.content_element` service tag.
252252

253253
```yaml
@@ -415,9 +415,9 @@ article of a page.
415415

416416
Allowing nested fragments for your content element works via the `nestedFragments` option in the service tag:
417417

418-
{{< tabs groupId="attribute-annotation-yaml" >}}
418+
{{< tabs groupid="attribute-annotation-yaml" style="code" >}}
419419

420-
{{% tab name="Attribute" %}}
420+
{{% tab title="Attribute" %}}
421421
```php
422422
#[AsContentElement(nestedFragments: true)]
423423
class ExampleElementController extends AbstractContentElementController
@@ -430,7 +430,7 @@ class ExampleElementController extends AbstractContentElementController
430430
```
431431
{{% /tab %}}
432432

433-
{{% tab name="Annotation" %}}
433+
{{% tab title="Annotation" %}}
434434
```php
435435
/**
436436
* @ContentElement(category="miscellaneous", nestedFragments=true)
@@ -445,7 +445,7 @@ class ExampleElementController extends AbstractContentElementController
445445
```
446446
{{% /tab %}}
447447

448-
{{% tab name="YAML" %}}
448+
{{% tab title="YAML" %}}
449449
```yaml
450450
services:
451451
App\Controller\ContentElement\ExampleElementController:
@@ -463,9 +463,9 @@ want to implement a specific slider content element which should only allow imag
463463
instead of defining `true` for the tag's `nestedFragments` option you can instead pass an additional option called
464464
`allowedTypes`:
465465

466-
{{< tabs groupId="attribute-annotation-yaml" >}}
466+
{{< tabs groupid="attribute-annotation-yaml" style="code" >}}
467467

468-
{{% tab name="Attribute" %}}
468+
{{% tab title="Attribute" %}}
469469
```php
470470
#[AsContentElement(nestedFragments: ['allowedTypes' => ['image', 'video']])]
471471
class ExampleElementController extends AbstractContentElementController
@@ -478,7 +478,7 @@ class ExampleElementController extends AbstractContentElementController
478478
```
479479
{{% /tab %}}
480480

481-
{{% tab name="Annotation" %}}
481+
{{% tab title="Annotation" %}}
482482
```php
483483
/**
484484
* @ContentElement(category="miscellaneous", nestedFragments={"allowedTypes" = {"image", "video"}})
@@ -493,7 +493,7 @@ class ExampleElementController extends AbstractContentElementController
493493
```
494494
{{% /tab %}}
495495

496-
{{% tab name="YAML" %}}
496+
{{% tab title="YAML" %}}
497497
```yaml
498498
services:
499499
App\Controller\ContentElement\ExampleElementController:

docs/dev/framework/cron.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ Generally cron jobs can be registered through the `contao.cronjob` service tag.
134134
| `interval` | Can be `minutely`, `hourly`, `daily`, `weekly`, `monthly`, `yearly` or a full CRON expression, like `*/5 * * * *`. |
135135
| `method` | Will default to `__invoke` or `onMinutely` etc. when a named interval is used. Otherwise a method name has to be defined. |
136136

137-
{{< tabs groupId="attribute-annotation-yaml-php" >}}
138-
{{% tab name="Attribute" %}}
137+
{{< tabs groupid="attribute-annotation-yaml-php" style="code" >}}
138+
{{% tab title="Attribute" %}}
139139
{{< version-tag "4.13" >}} Contao implements [PHP attributes](https://www.php.net/manual/en/language.attributes.overview.php) (available
140140
since **PHP 8**) with which you can tag your service to be registered as a cron job.
141141

@@ -159,7 +159,7 @@ In this case the cron job is executed once per hour. As mentioned before this pa
159159
`*/5 * * * *` for "every 5 minutes".
160160
{{% /tab %}}
161161

162-
{{% tab name="Annotation" %}}
162+
{{% tab title="Annotation" %}}
163163
{{< version-tag "4.9" >}} Contao also supports its own annotation formats via the [Service Annotation Bundle](https://github.com/terminal42/service-annotation-bundle).
164164

165165
```php
@@ -189,7 +189,7 @@ with `\`, since `*/` would close the PHP comment.
189189
{{% /notice %}}
190190
{{% /tab %}}
191191

192-
{{% tab name="YAML" %}}
192+
{{% tab title="YAML" %}}
193193
{{< version-tag "4.9" >}} As mentioned before you can manually add the `contao.cronjob` service tag in your service configuration.
194194

195195
```yaml
@@ -216,7 +216,7 @@ Only the `interval` parameter is required. In this case the cron job is executed
216216
be a full CRON expression, e.g. `*/5 * * * *` for "every 5 minutes".
217217
{{% /tab %}}
218218

219-
{{% tab name="PHP" %}}
219+
{{% tab title="PHP" %}}
220220

221221
{{% notice "info" %}}
222222
This method is deprecated since Contao **4.13** and does not work in Contao **5** anymore.

docs/dev/framework/csp.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ to an external source - e.g. via an `<iframe>` or `<script src="…">` etc. - th
6060
browser. However, your application might deliberately want to include external resources and thus it is necessary to
6161
allow this resource specifically (or at least the domain of that resource). This can be done via the `addSource` method:
6262

63-
{{< tabs groupId="csp-methods" >}}
64-
{{% tab name="PHP" %}}
63+
{{< tabs groupid="csp-methods" style="code" >}}
64+
{{% tab title="PHP" %}}
6565
```php
6666
$cspHandler->addSource('frame-src', 'https://www.youtube.com/embed/foobar123');
6767
```
6868
{{% /tab %}}
69-
{{% tab name="Twig" %}}
69+
{{% tab title="Twig" %}}
7070
```twig
7171
{% do csp_source('frame-src', 'https://www.youtube.com/embed/foobar123') %}
7272
```
7373
{{% /tab %}}
74-
{{% tab name="PHP Template" %}}
74+
{{% tab title="PHP Template" %}}
7575
```php
7676
<?php $this->addCspSource('frame-src', 'https://www.youtube.com/embed/foobar123') ?>
7777
```
@@ -93,18 +93,18 @@ without having to resort to allowing `'unsafe-inline'` in your directives. Conta
9393
instance still use inline JavaScript and thus will add a nonce when used. You can retrieve a nonce for `script-src` or
9494
`style-src` like this:
9595

96-
{{< tabs groupId="csp-methods" >}}
97-
{{% tab name="PHP" %}}
96+
{{< tabs groupid="csp-methods" style="code" >}}
97+
{{% tab title="PHP" %}}
9898
```php
9999
$nonce = $cspHandler->getNonce('script-src');
100100
```
101101
{{% /tab %}}
102-
{{% tab name="Twig" %}}
102+
{{% tab title="Twig" %}}
103103
```twig
104104
<script{{ attrs().setIfExists('nonce', csp_nonce('script-src')) }}>
105105
```
106106
{{% /tab %}}
107-
{{% tab name="PHP Template" %}}
107+
{{% tab title="PHP Template" %}}
108108
```php
109109
<script<?= $this->attr()->setIfExists('nonce', $this->nonce('script-src')) ?>>
110110
```
@@ -127,19 +127,19 @@ inline scripts or inline styles. This also includes inline scripts via HTML attr
127127
this is not possible such inline scripts can still be allowed through [hashes][CSPHash]. A hash can be generated and
128128
added to a directive for a specific inline script or style like this:
129129

130-
{{< tabs groupId="csp-methods" >}}
131-
{{% tab name="PHP" %}}
130+
{{< tabs groupid="csp-methods" style="code" >}}
131+
{{% tab title="PHP" %}}
132132
```php
133133
$cspHandler->addHash('style-src', 'display:none');
134134
```
135135
{{% /tab %}}
136-
{{% tab name="Twig" %}}
136+
{{% tab title="Twig" %}}
137137
```twig
138138
{% do csp_hash('display:none') %}
139139
<div style="display:none">
140140
```
141141
{{% /tab %}}
142-
{{% tab name="PHP Template" %}}
142+
{{% tab title="PHP Template" %}}
143143
```php
144144
<div style="<?= $this->cspInlineStyle('display:none') ?>">
145145
```
@@ -166,8 +166,8 @@ and then their hashes are added via the `CspHandler`. The allowed inline style p
166166

167167
The `'unsafe-hashes'` directive will also be added automatically by the template helpers for CSP Level 3 compliance.
168168

169-
{{< tabs groupId="csp-methods" >}}
170-
{{% tab name="PHP" %}}
169+
{{< tabs groupid="csp-methods" style="code" >}}
170+
{{% tab title="PHP" %}}
171171
You can use the `WysiwygStyleProcessor` directly in your services if you want to. Though typically you will likely only
172172
need it in your templates (see other methods).
173173

@@ -211,13 +211,13 @@ class ExampleService
211211
}
212212
```
213213
{{% /tab %}}
214-
{{% tab name="Twig" %}}
214+
{{% tab title="Twig" %}}
215215
In Twig you can use the filter `csp_inline_styles`. See the following example from Contao's `text.html.twig` template:
216216
```twig
217217
{{ text|csp_inline_styles|insert_tag|encode_email|raw }}
218218
```
219219
{{% /tab %}}
220-
{{% tab name="PHP Template" %}}
220+
{{% tab title="PHP Template" %}}
221221
```php
222222
<?= $this->cspInlineStyles($this->text) ?>
223223
```

0 commit comments

Comments
 (0)