From 923f794d29f8b5de1b3ba02ecdd27e76b950c810 Mon Sep 17 00:00:00 2001 From: Xin Date: Sun, 30 Jul 2023 12:53:06 +0100 Subject: [PATCH] feat: add pager for article navigation in section chore: minor updates - reorg language settings - add icons for cards and steps chore: update about page chore: add style to kbd --- assets/css/typography.css | 33 ++++++++++++++++++++++++++++++- content/about/index.md | 2 ++ content/docs/components/_index.md | 3 ++- data/icons.yaml | 8 +++----- hugo.toml | 10 +++++----- layouts/_default/single.html | 10 +++++++++- layouts/docs/list.html | 2 ++ layouts/docs/single.html | 2 ++ layouts/partials/pager.html | 20 +++++++++++++++++++ 9 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 layouts/partials/pager.html diff --git a/assets/css/typography.css b/assets/css/typography.css index 7de4e7d..58e57a9 100644 --- a/assets/css/typography.css +++ b/assets/css/typography.css @@ -60,7 +60,9 @@ @apply my-2; } } - + kbd { + @apply border-black border-opacity-[0.04] bg-opacity-[0.03] bg-black break-words rounded-md border py-0.5 px-[.25em] text-[.9em] dark:border-white/10 dark:bg-white/10; + } } .subheading-anchor { @@ -86,3 +88,32 @@ } } } + +article.typesetting-article { + font-size: 17px; + font-feature-settings: + 'rlig' 1, + 'calt' 1; + h1 { + @apply mt-6 mb-4 text-center; + font-size: 2.5rem; + } + h2 { + @apply border-none; + } + a { + @apply no-underline hover:underline; + } + p { + @apply leading-8; + } + code { + @apply border-none dark:bg-neutral-700; + } + pre code { + @apply dark:bg-transparent; + } + .subheading-anchor + a { + @apply no-underline hover:no-underline after:hidden; + } +} diff --git a/content/about/index.md b/content/about/index.md index c492428..cfc49b5 100644 --- a/content/about/index.md +++ b/content/about/index.md @@ -1,3 +1,5 @@ --- title: About --- + +This is the about page. diff --git a/content/docs/components/_index.md b/content/docs/components/_index.md index ea35b44..147291e 100644 --- a/content/docs/components/_index.md +++ b/content/docs/components/_index.md @@ -7,5 +7,6 @@ Hextra provides a variety of built-in components based on [Hugo Shortcodes](http {{< cards >}} {{< card link="callouts" title="Callouts" icon="warning" >}} - {{< card link="cards" title="Cards" >}} + {{< card link="cards" title="Cards" icon="cards" >}} + {{< card link="steps" title="Steps" icon="one" >}} {{< /cards >}} diff --git a/data/icons.yaml b/data/icons.yaml index b6dc10b..0d1d9c9 100644 --- a/data/icons.yaml +++ b/data/icons.yaml @@ -26,13 +26,11 @@ hugo-full: > -theme-light: > - - - +theme-light: theme-dark: chevron-right: - warning: +one: +cards: diff --git a/hugo.toml b/hugo.toml index 472d2a8..bbd4104 100644 --- a/hugo.toml +++ b/hugo.toml @@ -7,14 +7,14 @@ disableKinds = ["taxonomy", "term"] defaultContentLanguage = 'en' [languages] - [languages.ja] - languageName = '日本語' - weight = 1 - title = 'Hextra テーマ' [languages.en] languageName = 'English' - weight = 2 + weight = 1 title = 'Hextra Theme' + [languages.ja] + languageName = '日本語' + weight = 2 + title = 'Hextra テーマ' [module] [module.hugoVersion] diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8fb13f4..21cc36d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,5 +1,13 @@ {{ define "main" }}
-

Unimplemented

+
+
+
+

{{ .Title }}

+ {{ .Content }} +
+
+
+
{{ end }} diff --git a/layouts/docs/list.html b/layouts/docs/list.html index b78b4d5..c896fda 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -9,6 +9,8 @@

{{ .Title }}

{{ .Content }} +
+ {{ partial "pager.html" . }} diff --git a/layouts/docs/single.html b/layouts/docs/single.html index b78b4d5..c896fda 100644 --- a/layouts/docs/single.html +++ b/layouts/docs/single.html @@ -9,6 +9,8 @@

{{ .Title }}

{{ .Content }} +
+ {{ partial "pager.html" . }} diff --git a/layouts/partials/pager.html b/layouts/partials/pager.html new file mode 100644 index 0000000..3771dc3 --- /dev/null +++ b/layouts/partials/pager.html @@ -0,0 +1,20 @@ +{{/* Article navigation on the footer of the article */}} + +{{- $prev := .NextInSection -}} +{{- $next := .PrevInSection -}} +{{- if or $prev $next -}} + +{{- end -}}