diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index 0184754..7e0f44a 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -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 --- diff --git a/exampleSite/content/usage/configuration.md b/exampleSite/content/usage/configuration.md index 36350e6..186b89d 100644 --- a/exampleSite/content/usage/configuration.md +++ b/exampleSite/content/usage/configuration.md @@ -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 >}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index a9c05e6..95c7d7b 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,6 +1,6 @@ {{ define "main" }} {{ partial "page-header" . }} -
+

{{ partial "title" . }}

{{ partial "content" . }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 33d452c..c27218b 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,7 +1,7 @@ {{ define "main" }} {{ partial "page-header" . }} -
+

{{ partial "title" . }}

{{ partial "content" . }}
diff --git a/src/sass/_markdown.scss b/src/sass/_markdown.scss index 55c9ce1..10da821 100644 --- a/src/sass/_markdown.scss +++ b/src/sass/_markdown.scss @@ -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; + } + } }