mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-24 22:00:39 +00:00
feat: add page parameter geekdocAlign to control a pages text alignment (#130)
This commit is contained in:
parent
cd0cfe37ae
commit
e629d15607
@ -1,7 +1,8 @@
|
||||
---
|
||||
title: Documentation
|
||||
title: Welcome to the documentation
|
||||
description: Geekdoc is a simple Hugo theme for documentations. It is intentionally designed as a fast and lean theme and may not fit the requirements of complex projects. If a more feature-complete theme is required there are a lot of got alternatives out there.
|
||||
geekdocNav: false
|
||||
geekdocAlign: center
|
||||
---
|
||||
|
||||
<!-- markdownlint-capture -->
|
||||
|
@ -248,6 +248,9 @@ geekdocAnchor = true
|
||||
# page from search data, feeds, etc.
|
||||
# WARNING: Consider hosting a standalone, fully auth-protected static page for secret information instead!
|
||||
geekdocProtected = false
|
||||
|
||||
# Set 'left' (default), 'center' or 'right' to configure the text align of a page.
|
||||
geekdocAlign = "left"
|
||||
```
|
||||
|
||||
{{< /tab >}}
|
||||
@ -305,6 +308,9 @@ geekdocAnchor: true
|
||||
# page from search data, feeds, etc.
|
||||
# WARNING: Consider hosting a standalone, fully auth-protected static page for secret information instead!
|
||||
geekdocProtected: false
|
||||
|
||||
# Set 'left' (default), 'center' or 'right' to configure the text align of a page.
|
||||
geekdocAlign: "left"
|
||||
```
|
||||
|
||||
{{< /tab >}}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{{ define "main" }}
|
||||
{{ partial "page-header" . }}
|
||||
<article class="gdoc-markdown">
|
||||
<article class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}">
|
||||
<h1>{{ partial "title" . }}</h1>
|
||||
{{ partial "content" . }}
|
||||
</article>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{ define "main" }}
|
||||
{{ partial "page-header" . }}
|
||||
|
||||
<article class="gdoc-markdown">
|
||||
<article class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}">
|
||||
<h1>{{ partial "title" . }}</h1>
|
||||
{{ partial "content" . }}
|
||||
</article>
|
||||
|
@ -178,4 +178,42 @@
|
||||
overflow: auto;
|
||||
max-height: var(--code-max-height);
|
||||
}
|
||||
|
||||
&__align {
|
||||
&--left {
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
&--center {
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
justify-content: center;
|
||||
}
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&--right {
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user