Skip to content

Commit 5ea53d2

Browse files
committed
website/: Add link to github project, "edit page" URLs
Signed-off-by: Thilo Fromm <[email protected]>
1 parent fd05dac commit 5ea53d2

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

website/config.toml

+14
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,19 @@ languageCode = "en-us"
33
title = "UAPI group generic documents and meeting minutes"
44
theme = "hugo-book"
55

6+
[[menu.after]]
7+
name = "-"
8+
weight = 10
9+
[[menu.after]]
10+
name = "Collaborate on Github"
11+
url = "https://github.com/uapi-group/kernel"
12+
weight = 10
13+
614
[markup.goldmark.renderer]
715
unsafe = true # Allow HTML in md files
16+
17+
[params]
18+
BookRepo = 'https://github.com/uapi-group/kernel'
19+
BookCommitPath = 'commit'
20+
BookEditPath = 'edit/main'
21+
BookIndexPage = 'README.md'
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<div class="flex flex-wrap justify-between">
2+
{{ if .Site.IsMultiLingual }}
3+
{{ partial "docs/languages" . }}
4+
{{ end }}
5+
6+
{{ if and .GitInfo .Site.Params.BookRepo }}
7+
<div>
8+
{{- $date := partial "docs/date" (dict "Date" .GitInfo.AuthorDate.Local "Format" .Site.Params.BookDateFormat) -}}
9+
{{- $commitPath := default "commit" .Site.Params.BookCommitPath -}}
10+
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ $commitPath }}/{{ .GitInfo.Hash }}" title='{{ i18n "Last modified by" }} {{ .GitInfo.AuthorName }} | {{ $date }}' target="_blank" rel="noopener">
11+
<img src="{{ "svg/calendar.svg" | relURL }}" class="book-icon" alt="Calendar" />
12+
<span>{{ $date }}</span>
13+
</a>
14+
</div>
15+
{{ end }}
16+
17+
{{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }}
18+
<div>
19+
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ replace ( replace .File.Path "docs/" "" ) "_index.md" .Site.Params.BookIndexPage}}" target="_blank" rel="noopener">
20+
<img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="Edit" />
21+
<span>{{ i18n "Edit this page" }}</span>
22+
</a>
23+
</div>
24+
{{ end }}
25+
</div>

0 commit comments

Comments
 (0)