forked from freifunk-franken/docs
add example section
the example section is only rendered when drafts are enabled
This commit is contained in:
parent
32338d19fe
commit
e7fb03072e
57
content/example/_index.md
Normal file
57
content/example/_index.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
title: "Example"
|
||||
date: 2022-11-17T23:09:11+01:00
|
||||
weight: 1024
|
||||
draft: true
|
||||
---
|
||||
|
||||
alles bis zum [<code><!--more--></code>](https://gohugo.io/content-management/summaries/#manual-summary-splitting)
|
||||
gilt als Kurzbeschreibung für die Seite und wird in den Übersichtslisten verwendet.
|
||||
|
||||
<!--more-->
|
||||
|
||||
|
||||
## Ordnerstruktur
|
||||
|
||||
```
|
||||
content/example/_index.md
|
||||
^ ^
|
||||
| section main page
|
||||
section
|
||||
```
|
||||
|
||||
Hier ist eine Bespiel [section].
|
||||
|
||||
Die Hauptseite innerhalb einer [section] muss den Dateiname [`_index.md`][_index.md] haben.
|
||||
|
||||
Der Titel für das Menü wird dabei aus dem `title` [frontmatter][frontmatter] Attribut entnommen.
|
||||
|
||||
## Links
|
||||
|
||||
Auf andere Seiten kann ganz normal mit Markdownsyntax verlinkt werden:
|
||||
|
||||
```md
|
||||
[Beschreibung](Pfad)
|
||||
```
|
||||
|
||||
Wenn der Dateiname eindeutig ist können [shortcodes] für [links] verwendet werden, um unabhänging vom Pfad zu einer Datei zu verlinken:
|
||||
|
||||
```md
|
||||
[Beschreibung]({{%/* relref "dateiname" */%}})
|
||||
```
|
||||
|
||||
## Beispiel
|
||||
|
||||
[Zur Beispielseite]({{% relref "example_page" %}})
|
||||
```md
|
||||
[Zur Beispielseite]({{%/* relref "example_page" */%}})
|
||||
```
|
||||
```html
|
||||
<a href="/example/example_page/">Zur Beispielseite</a>
|
||||
```
|
||||
|
||||
[section]: https://gohugo.io/content-management/sections
|
||||
[_index.md]: https://gohugo.io/templates/lists/#example-list-templates
|
||||
[frontmatter]: https://gohugo.io/content-management/front-matter/
|
||||
[shortcodes]: https://gohugo.io/content-management/shortcodes/
|
||||
[links]: https://gohugo.io/content-management/cross-references/
|
6
content/example/example_page.md
Normal file
6
content/example/example_page.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
title: "Beispielseite"
|
||||
date: 2022-11-17T23:17:22+01:00
|
||||
---
|
||||
|
||||
`content/example/example_page.md`
|
Loading…
Reference in New Issue
Block a user