diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 31aaa48..512cc33 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,7 +5,7 @@ jobs: test: strategy: matrix: - go: [ "1.19", "1.20" ] + go: [ "1.20", "1.21" ] runs-on: ubuntu-latest steps: diff --git a/ABTaskFile b/ABTaskFile index 82c8be1..c422b2b 100644 --- a/ABTaskFile +++ b/ABTaskFile @@ -23,28 +23,82 @@ commands: go mod tidy - name: test - type: exec - description: Perform unit tests - dir: "{{ TaskDir }}" - arguments: - - name: dir - description: Directory to test - default: . - flags: - - name: update - description: Updates the ginkgo runtime - bool: true - script: | - set -e + type: parent + aliases: [t] + description: Perform various tests + commands: + - name: unit + type: exec + description: Run ginkgo unit tests + aliases: [u] + arguments: + - name: dir + description: Directory to test + default: . + flags: + - name: update + description: Updates the ginkgo runtime + bool: true + script: | + set -e + + . "{{ BashHelperPath }}" - . "{{ BashHelperPath }}" + {{ if .Flags.update }} + ab_say Updating ginkgo binary + go install github.com/onsi/ginkgo/v2/ginkgo + {{ end }} - {{ if .Flags.update }} - ab_say Updating ginkgo binary - go install github.com/onsi/ginkgo/v2/ginkgo - {{ end }} + ginkgo -r --skip Integration {{ .Arguments.dir | escape }} - ginkgo -r --skip Integration {{ .Arguments.dir | escape }} + - name: lint + type: exec + dir: "{{ AppDir }}" + flags: + - name: vet + description: Perform go vet + bool: true + default: true + - name: staticcheck + description: Perform staticcheck + bool: true + default: true + - name: update + description: Updates lint dependencies + bool: true + script: | + set -e + + . "{{ BashHelperPath }}" + + {{ if .Flags.update }} + ab_say Updating linting tools + go install github.com/client9/misspell/cmd/misspell@latest + go install honnef.co/go/tools/cmd/staticcheck@latest + {{ else }} + echo ">>> Run with --update to install required commands" + echo + {{ end }} + + ab_say Formatting source files + go fmt ./... + + ab_say Tidying go mod + go mod tidy + + ab_say Checking spelling + find . -type f -name "*.go" | xargs misspell -error -locale US -i flavour + find docs/content -type f -name "*.md" | xargs misspell -error -locale US + + {{ if .Flags.vet }} + ab_say Performing go vet + go vet ./... + {{ end }} + + {{ if .Flags.staticcheck }} + ab_say Running staticcheck + staticcheck ./... + {{ end }} - name: docs diff --git a/builder/builder.go b/builder/builder.go index bcdb2b0..45172fe 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -38,7 +38,7 @@ type Command interface { String() string } -type templateState struct { +type TemplateState struct { Arguments any Flags any Config any diff --git a/builder/logger.go b/builder/logger.go index 77c1323..f41e7dd 100644 --- a/builder/logger.go +++ b/builder/logger.go @@ -19,6 +19,10 @@ type Logger interface { // Default console logger type defaultLogger struct{} +func NewDefaultLogger() Logger { + return &defaultLogger{} +} + func (l *defaultLogger) Infof(format string, v ...any) { log.Printf(format, v...) } diff --git a/builder/templates.go b/builder/templates.go index 2e42cc4..b71366e 100644 --- a/builder/templates.go +++ b/builder/templates.go @@ -31,7 +31,7 @@ func dereferenceArgsOrFlags(input map[string]any) map[string]any { return res } -func templateFuncs(all bool) template.FuncMap { +func TemplateFuncs(all bool) template.FuncMap { funcs := map[string]any{} if all { funcs = sprig.TxtFuncMap() @@ -88,15 +88,18 @@ func templateFuncs(all bool) template.FuncMap { return funcs } -// ParseStateTemplateWithFuncMap parses body as a go text template with supplied values exposed to the user with additional functions available to the template -func ParseStateTemplateWithFuncMap(body string, args map[string]any, flags map[string]any, cfg any, funcMap template.FuncMap) (string, error) { - state := templateState{ +func NewTemplateState(args map[string]any, flags map[string]any, cfg any, input any) *TemplateState { + return &TemplateState{ Arguments: dereferenceArgsOrFlags(args), Flags: dereferenceArgsOrFlags(flags), Config: cfg, + Input: input, } +} - funcs := templateFuncs(false) +// ParseStateTemplateWithFuncMap parses body as a go text template with supplied values exposed to the user with additional functions available to the template +func ParseStateTemplateWithFuncMap(body string, args map[string]any, flags map[string]any, cfg any, funcMap template.FuncMap) (string, error) { + funcs := TemplateFuncs(false) for n, f := range funcMap { funcs[n] = f } @@ -107,7 +110,7 @@ func ParseStateTemplateWithFuncMap(body string, args map[string]any, flags map[s } var b bytes.Buffer - err = temp.Execute(&b, state) + err = temp.Execute(&b, NewTemplateState(args, flags, cfg, nil)) if err != nil { return "", err } diff --git a/builder/transform_template.go b/builder/transform_template.go index 09ece1a..972e590 100644 --- a/builder/transform_template.go +++ b/builder/transform_template.go @@ -50,7 +50,7 @@ func (tt *templateTransform) Transform(ctx context.Context, r io.Reader, args ma } templ := template.New("builder") - templ.Funcs(templateFuncs(true)) + templ.Funcs(TemplateFuncs(true)) switch { case tt.Source != "": @@ -69,12 +69,7 @@ func (tt *templateTransform) Transform(ctx context.Context, r io.Reader, args ma } out := bytes.NewBuffer([]byte{}) - state := templateState{ - Arguments: dereferenceArgsOrFlags(args), - Flags: dereferenceArgsOrFlags(flags), - Config: cfg, - Input: input, - } + state := NewTemplateState(args, flags, cfg, input) err = templ.Execute(out, state) if err != nil { diff --git a/commands/scaffold/scaffold.go b/commands/scaffold/scaffold.go new file mode 100644 index 0000000..166bf34 --- /dev/null +++ b/commands/scaffold/scaffold.go @@ -0,0 +1,153 @@ +// Copyright (c) 2023, R.I. Pienaar and the Choria Project contributors +// +// SPDX-License-Identifier: Apache-2.0 + +package scaffold + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "os" + "strings" + + "github.com/choria-io/appbuilder/builder" + "github.com/choria-io/appbuilder/scaffold" + "github.com/choria-io/fisk" +) + +type Command struct { + Target string `json:"target"` + SourceDirectory string `json:"source_directory"` + Source map[string]any `json:"source"` + Post []map[string]string `json:"post"` + + builder.GenericSubCommands + builder.GenericCommand +} + +type Scaffold struct { + defnDir string + userDir string + arguments map[string]any + flags map[string]any + cmd *fisk.CmdClause + def *Command + ctx context.Context + log builder.Logger + b *builder.AppBuilder +} + +var ( + ErrorInvalidConfiguration = errors.New("invalid configuration") + ErrRenderFailed = errors.New("render failed") +) + +func Register() error { + return builder.RegisterCommand("scaffold", NewScaffoldCommand) +} + +func MustRegister() { + builder.MustRegisterCommand("scaffold", NewScaffoldCommand) +} + +func NewScaffoldCommand(b *builder.AppBuilder, j json.RawMessage, log builder.Logger) (builder.Command, error) { + s := &Scaffold{ + def: &Command{}, + ctx: b.Context(), + defnDir: b.DefinitionDirectory(), + userDir: b.UserWorkingDirectory(), + b: b, + log: log, + arguments: map[string]any{}, + flags: map[string]any{}, + } + + err := json.Unmarshal(j, s.def) + if err != nil { + return nil, fmt.Errorf("%w: %v", builder.ErrInvalidDefinition, err) + } + + return s, nil +} + +func (r *Scaffold) String() string { return fmt.Sprintf("%s (scaffold)", r.def.Name) } + +func (r *Scaffold) Validate(log builder.Logger) error { + if r.def.Type != "scaffold" { + return fmt.Errorf("not an scaffold command") + } + + var errs []string + + if r.def.Target == "" { + errs = append(errs, "target is required") + } + + if len(r.def.Source) == 0 && r.def.SourceDirectory == "" { + errs = append(errs, "no sources provided") + } + + if r.def.SourceDirectory != "" { + _, err := os.Stat(r.def.SourceDirectory) + if err != nil { + errs = append(errs, fmt.Sprintf("cannot read source directory: %v", err)) + } + } + + if _, err := os.Stat(r.def.Target); !os.IsNotExist(err) { + errs = append(errs, "target directory exist") + } + + if len(errs) > 0 { + return errors.New(strings.Join(errs, ", ")) + } + + return nil +} + +func (r *Scaffold) SubCommands() []json.RawMessage { + return r.def.Commands +} + +func (r *Scaffold) CreateCommand(app builder.KingpinCommand) (*fisk.CmdClause, error) { + r.cmd = builder.CreateGenericCommand(app, &r.def.GenericCommand, r.arguments, r.flags, r.b, r.runCommand) + + return r.cmd, nil +} + +func (r *Scaffold) runCommand(_ *fisk.ParseContext) error { + cfg := scaffold.Config{ + Source: r.def.Source, + Post: r.def.Post, + } + + var err error + + if cfg.SourceDirectory != "" { + cfg.SourceDirectory, err = builder.ParseStateTemplate(r.def.SourceDirectory, r.arguments, r.flags, r.b.Configuration()) + if err != nil { + return err + } + } + + cfg.TargetDirectory, err = builder.ParseStateTemplate(r.def.Target, r.arguments, r.flags, r.b.Configuration()) + if err != nil { + return err + } + + s, err := scaffold.New(cfg, builder.TemplateFuncs(true)) + if err != nil { + return fmt.Errorf("%w: %w", ErrorInvalidConfiguration, err) + } + + s.Logger(builder.NewDefaultLogger()) + + err = s.Render(builder.NewTemplateState(r.arguments, r.flags, r.b.Configuration(), nil)) + if err != nil { + return fmt.Errorf("%w: %w", ErrRenderFailed, err) + } + + return nil +} diff --git a/docs/content/_index.md b/docs/content/_index.md index aa380ba..e3e1d05 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -53,6 +53,6 @@ In the example above one can run commands like `natsctl report servers` or `nats The `natscl service state` command invokes a Choria RPC API in a subset of fleet nodes and pass the result through a JQ query `.replies | .[] | select(.statuscode==0) | .sender + ": " + .data.state` to transform the API output. -It is much nicer to just wrap it in `natsctl report servers` or `natsctl service state` and be able to manage the detail seperately. You can mention `natsctl report servers` in wikis and if it ever changes, you only change the app model. +It is much nicer to just wrap it in `natsctl report servers` or `natsctl service state` and be able to manage the detail separately. You can mention `natsctl report servers` in wikis and if it ever changes, you only change the app model. These sub commands all have help and integration with bash and zsh is provided. diff --git a/docs/content/reference/scaffold.md b/docs/content/reference/scaffold.md new file mode 100644 index 0000000..e0959dd --- /dev/null +++ b/docs/content/reference/scaffold.md @@ -0,0 +1,105 @@ ++++ +title = "Scaffold Command Type" +weight = 35 +toc = true ++++ + +Use the `scaffold` command to create directories of files based on templates. + +{{% notice secondary "Version Hint" code-branch %}} +This was added in version 0.7.0 +{{% /notice %}} + +## Scaffolding files + +First we will just show the most basic example: + +```yaml +name: scaffold +description: Demonstrate scaffold features by creating some go files +type: scaffold +arguments: + - name: target + description: The target to create the files in + required: true + +target: "{{ .Arguments.target }}" +source: + "main.go": | + // Copyright {{ .Arguments.author }} {{ now | date "2006" }} + + package main + import "{{ .Arguments.package }}/cmd" + func main() {cmd.Run()} +``` + +This generates a file `main.go` in the directory set using the `target` argument. The target directory must not exist. + +Complex trees can be created like this: + +```yaml +source: + "cmd": + "cmd.go": | + // content not shown + "main.go": | + // content not shown +``` + +Here we will have a directory `cmd` with `cmd/cmd.go` inside along with top level `main.go`. + +## Storing files externally + +In the example we have the template embedded in the YAML file, its functional but does not really scale well. + +You can create a directory full of template files that mirror the target directory layer do this instead: + +```yaml +name: scaffold +description: Demonstrate scaffold features by creating some go files +type: scaffold +arguments: + - name: target + description: The target to create the files in + required: true +flags: + - name: template + description: The template to use + default: golang + +target: "{{ .Arguments.target }}" +source_directory: /usr/local/templates/{{ .Flags.template }} +``` + +Now we will use `/usr/local/template/golang` by default and whatever is passed in `--template` instead of `golang` +otherwise. + +## Post processing files + +In the first example we showed a poorly formatted go file, the result will be equally badly formatted. + +Here we show how to post process the files using `gofmt`: + +```yaml +name: scaffold +description: Demonstrate scaffold features by creating some go files +type: scaffold +arguments: + - name: target + description: The target to create the files in + required: true + +target: "{{ .Arguments.target }}" +source_directory: /usr/local/templates/default + +post: + - "*.go": "gofmt -w" + - "*.go": "goimports -w '{}'" +``` + +The new `post` structure defines a list of processors based on a file pattern match done using `filepath.Match`. + +As shown the same pattern can be matched multiple times to run multiple commands on the file. + +If the string `{}` is in the file it will be replaced with the full path to the file otherwise the path is set as +last argument. When using this format it's suggested you use quotes like in the example. \ No newline at end of file diff --git a/docs/content/reference/transformations.md b/docs/content/reference/transformations.md index 5e19dd8..e81c345 100644 --- a/docs/content/reference/transformations.md +++ b/docs/content/reference/transformations.md @@ -243,7 +243,7 @@ In this case the message `Wrote 1.8 KiB to /tmp/report.txt` would be printed. Yo | Option | Description | |-----------|------------------------------------------------------------------------------| | `file` | The file to write, the file name is parsed using [Templating](../templating) | -| `message` | A message to emit from the transform instead of the contents recieved by it | +| `message` | A message to emit from the transform instead of the contents received by it | | `replace` | Set to `true` to always overwrite the file | ## Row orientated Reports diff --git a/docs/themes/hugo-theme-relearn/.frontmatter/database/mediaDb.json b/docs/themes/hugo-theme-relearn/.frontmatter/database/mediaDb.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/docs/themes/hugo-theme-relearn/.frontmatter/database/mediaDb.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/docs/themes/hugo-theme-relearn/.gitignore b/docs/themes/hugo-theme-relearn/.gitignore new file mode 100644 index 0000000..4344fe1 --- /dev/null +++ b/docs/themes/hugo-theme-relearn/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +.hugo_build.lock +exampleSite/public* +exampleSite/hugo*.exe +**/*.xcf +**/*.zip diff --git a/docs/themes/hugo-theme-relearn/.grenrc.js b/docs/themes/hugo-theme-relearn/.grenrc.js index 9f74dda..92e251f 100644 --- a/docs/themes/hugo-theme-relearn/.grenrc.js +++ b/docs/themes/hugo-theme-relearn/.grenrc.js @@ -18,6 +18,7 @@ module.exports = { ignoreLabels: [ "blocked", "browser", + "device", "helpwanted", "hugo", "mermaid", @@ -29,11 +30,13 @@ module.exports = { "documentation", "duplicate", "invalid", + "update", "unresolved", "wontfix", ], ignoreTagsWith: [ "Relearn", + "x", ], milestoneMatch: "{{tag_name}}", onlyMilestones: true, diff --git a/docs/themes/hugo-theme-relearn/.imgbotconfig b/docs/themes/hugo-theme-relearn/.imgbotconfig new file mode 100644 index 0000000..d3fb1db --- /dev/null +++ b/docs/themes/hugo-theme-relearn/.imgbotconfig @@ -0,0 +1,7 @@ +{ + "schedule": "daily", + "ignoredFiles": [ + "static/*" + ], + "prTitle": "autobot: optimize images" +} diff --git a/docs/themes/hugo-theme-relearn/README.md b/docs/themes/hugo-theme-relearn/README.md index cd75787..75f5d68 100644 --- a/docs/themes/hugo-theme-relearn/README.md +++ b/docs/themes/hugo-theme-relearn/README.md @@ -2,71 +2,79 @@ A theme for [Hugo](https://gohugo.io/) designed for documentation. -![Overview](https://github.com/McShelby/hugo-theme-relearn/raw/main/images/screenshot.png) +[★ What's new in the latest release ★](https://mcshelby.github.io/hugo-theme-relearn/basics/migration) + +![Image of the Relearn theme in light and dark mode on phone, tablet and desktop](https://github.com/McShelby/hugo-theme-relearn/raw/main/images/hero.png) ## Motivation -The theme is a fork of the great [Learn theme](https://github.com/matcornic/hugo-theme-learn) with the aim of fixing long outstanding bugs and adepting to latest Hugo features. As far as possible this theme tries to be a drop-in replacement for the Learn theme. +The Relearn theme is a fork of the great [Learn theme](https://github.com/matcornic/hugo-theme-learn) with the aim of fixing long outstanding bugs and adepting to latest Hugo features. As far as possible this theme tries to be a drop-in replacement for the Learn theme. ## Features -- Usable offline, no external dependencies -- Usable without a HTTP server from the file system -- Support for Internet Explorer 11 -- Responsive design -- Configurable hidden pages -- Automatic next/prev buttons to navigate through menu entries -- Automatic Search -- Dedicated search page -- Support for GFM (GitHub Flavored Markdown) -- Print whole chapters or even the complete site -- Multilingual mode for English, Arabic, Simplified Chinese, Traditional Chinese, Dutch, Finnish (Suomi), French, German, Hindi, Indonesian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Turkish, Vietnamese -- Support for languages written right to left -- Unrestricted menu configuration relating to amount of items and level of nesting -- Font Awesome icons -- Tagging support -- Image styling like sizing, shadow, border and alignment -- Syntax highlighting -- Customizable look and feel -- Predefined (light, dark) and customizable color variants -- Attachments files -- List child pages -- Math and chemical formulae using the MathJax library -- Mermaid diagrams for flowcharts, sequences, gantts, pie, etc. -- Swagger UI for OpenAPI Specifications -- Badges -- Buttons -- Tip/Note/Info/Warning boxes -- Expand -- Tabs -- File inclusion - -## Installation - -Visit the [installation instructions](https://mcshelby.github.io/hugo-theme-relearn/basics/installation) to learn how to setup the theme in your Hugo installation. - -## Usage - -Visit the [documentation](https://mcshelby.github.io/hugo-theme-relearn/) to learn about all available features and how to use them. +- **Wide set of usage scenarios** + - Responsive design for mobile usage + - Looks nice on paper (if you have to) + - Usable offline, no external dependencies + - [Usable from your local file system via `file://` protocol](https://mcshelby.github.io/hugo-theme-relearn/basics/configuration#serving-your-page-from-the-filesystem) + - Support for the [VSCode Front Matter extension](https://github.com/estruyf/vscode-front-matter) for on-premise CMS capabilities + - Support for Internet Explorer 11 +- **Configurable theming and visuals** + - [Configurable brand images](https://mcshelby.github.io/hugo-theme-relearn/basics/customization#change-the-logo) + - [Automatic switch for light/dark variant dependend on your OS settings](https://mcshelby.github.io/hugo-theme-relearn/basics/customization#adjusting-to-os-settings) + - Predefined light, dark and color variants + - [User selectable variants](https://mcshelby.github.io/hugo-theme-relearn/basics/customization#multiple-variants) + - [Stylesheet generator](https://mcshelby.github.io/hugo-theme-relearn/basics/generator) + - [Configurable syntax highlighting](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/highlight) +- **Unique theme features** + - [Print whole chapters or even the complete site](https://mcshelby.github.io/hugo-theme-relearn/basics/configuration#activate-print-support) + - In page search + - [Site search](https://mcshelby.github.io/hugo-theme-relearn/basics/configuration#activate-search) + - [Dedicated search page](https://mcshelby.github.io/hugo-theme-relearn/basics/configuration#activate-dedicated-search-page) + - [Taxonomy support](https://mcshelby.github.io/hugo-theme-relearn/cont/taxonomy) + - Hidden pages + - Unlimited nested menu dependend on your site structure + - Navigation buttons dependend on your site structure + - [Configurable shortcut links](https://mcshelby.github.io/hugo-theme-relearn/cont/menushortcuts) +- **Multi language support** + - [Full support for languages written right to left](https://mcshelby.github.io/hugo-theme-relearn/cont/i18n) + - [Available languages](https://mcshelby.github.io/hugo-theme-relearn/cont/i18n#basic-configuration): Arabic, Simplified Chinese, Traditional Chinese, Czech, Dutch, English, Finnish, French, German, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Turkish, Vietnamese + - [Search support for mixed language content](https://mcshelby.github.io/hugo-theme-relearn/cont/i18n#search) +- **Additional Markdown features** + - [Support for GFM (GitHub Flavored Markdown](https://mcshelby.github.io/hugo-theme-relearn/cont/markdown) + - [Image effects like sizing, shadow, border and alignment](https://mcshelby.github.io/hugo-theme-relearn/cont/markdown#image-effects) + - [Image lightbox](https://mcshelby.github.io/hugo-theme-relearn/cont/markdown#lightbox) +- **Shortcodes galore** + - [Display files attached to page bundles](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments) + - [Marker badges](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/badge) + - [Configurable buttons](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/button) + - [List child pages](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/children) + - [Expand areas to reveal content](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/expand) + - [Font Awesome icons](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/icon) + - [Inclusion of other files](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/include) + - [Math and chemical formulae using MathJax](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/math) + - [Mermaid diagrams for flowcharts, sequences, gantts, pie, etc.](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/mermaid) + - [Colorful boxes](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/notice) + - [OpenAPI specifications using Swagger UI](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/openapi) + - [Reveal you site's configuration parameter](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/siteparam) + - [Single tabbed panels](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/tab) and [multiple tabbed panels](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/tabs) + +## Installation & Usage + +For a detailed description of the theme's capabilities visit the [official documentation](https://mcshelby.github.io/hugo-theme-relearn/). ## Changelog -See the [What's New](https://mcshelby.github.io/hugo-theme-relearn/basics/migration) page for release highlights or the [history](https://mcshelby.github.io/hugo-theme-relearn/basics/history) for a complete list of changes per release. +See the [What's New](https://mcshelby.github.io/hugo-theme-relearn/basics/migration) page for release highlights or the detailed [change history](https://mcshelby.github.io/hugo-theme-relearn/basics/history) for a complete list of changes. -## Contribution +## Contributions -You are most welcome to contribute bugfixes or even new features to the source code. Please visit the [contribution guidelines](https://github.com/McShelby/hugo-theme-relearn/blob/main/.github/contributing.md) first. +You are most welcome to contribute bugfixes or new features. Check the [contribution guidelines](https://mcshelby.github.io/hugo-theme-relearn/dev/contributing) first before starting. ## License -This theme is licensed under the [MIT License](https://github.com/McShelby/hugo-theme-relearn/blob/main/LICENSE). +The Relearn theme is licensed under the [MIT License](https://github.com/McShelby/hugo-theme-relearn/blob/main/LICENSE). ## Credits -Special thanks to [everyone who has contributed](https://github.com/McShelby/hugo-theme-relearn/graphs/contributors) to this project. - -Many thanks to [Mathieu Cornic](https://github.com/matcornic) for his work on porting the [Learn theme](https://github.com/matcornic/hugo-theme-learn) to Hugo. - -Many thanks to [Andy Miller](https://github.com/rhukster) for initially creating the [Learn theme](https://github.com/getgrav/grav-theme-learn2) for Grav. - -See the [credits](https://mcshelby.github.io/hugo-theme-relearn/more/credits) for a detailed list. +This theme would not be possible without the work of [many others](https://mcshelby.github.io/hugo-theme-relearn/more/credits). diff --git a/docs/themes/hugo-theme-relearn/assets/css/theme-auto.css b/docs/themes/hugo-theme-relearn/assets/css/theme-auto.css new file mode 100644 index 0000000..b32f1cd --- /dev/null +++ b/docs/themes/hugo-theme-relearn/assets/css/theme-auto.css @@ -0,0 +1,34 @@ +{{- $themevariants := slice | append (.Site.Params.themeVariant | default "auto") -}} +{{- $themevariantsauto := slice | append (.Site.Params.themeVariantAuto | default slice) -}} +{{- $i := 0 -}} +{{- if eq (int (len $themevariantsauto)) 0 -}} + {{- range $themevariants -}} + {{- $i = add $i 1 -}} + {{- if ne . "auto" -}} + {{- $themevariantsauto = $themevariantsauto | append . -}} + {{- break -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- if eq (int (len $themevariantsauto)) 0 -}} + {{- $themevariantsauto = $themevariantsauto | append "relearn-light" -}} +{{- end -}} +{{- if eq (int (len $themevariantsauto)) 1 -}} + {{- $poppedthemevariants := last (sub (len $themevariants) $i) $themevariants -}} + {{- range $poppedthemevariants -}} + {{- if ne . "auto" -}} + {{- $themevariantsauto = $themevariantsauto | append . -}} + {{- break -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- if eq (int (len $themevariantsauto)) 1 -}} + {{- $themevariantsauto = $themevariantsauto | append "relearn-dark" -}} +{{- end -}} +{{- $themevariantsauto = ($themevariantsauto | first 2) -}} +{{- with index $themevariantsauto 0 -}} +@import "{{ printf "theme-%s.css" . }}" screen and (prefers-color-scheme: light); +{{ end -}} +{{- with index $themevariantsauto 1 -}} +@import "{{ printf "theme-%s.css" . }}" screen and (prefers-color-scheme: dark); +{{ end -}} diff --git a/docs/themes/hugo-theme-relearn/config.toml b/docs/themes/hugo-theme-relearn/config.toml index 3ec4a73..72e6c29 100644 --- a/docs/themes/hugo-theme-relearn/config.toml +++ b/docs/themes/hugo-theme-relearn/config.toml @@ -23,7 +23,7 @@ permalinkable = false noUgly = true - [outputFormats.SERCHPAGE] + [outputFormats.SEARCHPAGE] name= "SEARCHPAGE" baseName = "search" isHTML = true diff --git a/docs/themes/hugo-theme-relearn/frontmatter.json b/docs/themes/hugo-theme-relearn/frontmatter.json new file mode 100644 index 0000000..9442276 --- /dev/null +++ b/docs/themes/hugo-theme-relearn/frontmatter.json @@ -0,0 +1,85 @@ +{ + "$schema": "https://frontmatter.codes/frontmatter.schema.json", + "frontMatter.content.defaultSorting": "LastModifiedAsc", + "frontMatter.content.hideFm": false, + "frontMatter.content.pageFolders": [ + { + "contentTypes": [ + "default" + ], + "path": "[[workspace]]/exampleSite/content", + "title": "Docs" + } + ], + "frontMatter.content.publicFolder": "static", + "frontMatter.experimental": true, + "frontMatter.extends": [ + "./vscode-frontmatter/snippets.en.json" + ], + "frontMatter.framework.id": "hugo", + "frontMatter.framework.startCommand": ".\\exampleSite\\hugo.exe server -p 1313 --bind 0.0.0.0 --navigateToChanged -s .\\exampleSite", + "frontMatter.git.commitMesage": "docs: changes via Front Matter editor", + "frontMatter.git.enabled": true, + "frontMatter.global.activeMode": "Editor", + "frontMatter.global.modes": [ + { + "id": "Power", + "features": [ + "dashboard.data.view", + "dashboard.snippets.manage", + "dashboard.snippets.view", + "dashboard.taxonomy.view", + "panel.actions", + "panel.contentType", + "panel.globalSettings", + "panel.metadata", + "panel.otherActions", + "panel.recentlyModified", + "panel.seo" + ] + }, + { + "id": "Editor", + "features": [ + "dashboard.snippets.view", + "dashboard.taxonomy.view", + "panel.actions", + "panel.metadata" + ] + } + ], + "frontMatter.preview.host": "http://localhost:1313", + "frontMatter.preview.pathName": "{{pathToken.relPath}}/", + "frontMatter.taxonomy.categories": [], + "frontMatter.taxonomy.contentTypes": [ + { + "fields": [ + { + "name": "title", + "title": "Titel", + "type": "string" + }, + { + "default": " ", + "name": "description", + "title": "Description", + "type": "string" + }, + { + "name": "weight", + "title": "Weight", + "type": "number" + }, + { + "name": "toc", + "title": "Create TOC", + "type": "boolean" + } + ], + "name": "default", + "pageBundle": true, + "previewPath": null + } + ], + "frontMatter.taxonomy.frontMatterType": "TOML" +} diff --git a/docs/themes/hugo-theme-relearn/i18n/ar.toml b/docs/themes/hugo-theme-relearn/i18n/ar.toml index 4cc1cb0..ac2931e 100644 --- a/docs/themes/hugo-theme-relearn/i18n/ar.toml +++ b/docs/themes/hugo-theme-relearn/i18n/ar.toml @@ -7,6 +7,9 @@ other = "البحث" [Search-placeholder] other = "...البحث" +[Clear-search] +other = "مسح البحث" + [No-results-found] other = "لم يتم العثور على نتائج لـ \"{0}\"" @@ -20,7 +23,7 @@ other = "مسح السجل" other = "مرفقات" [title-404] -other = "خطأ" +other = "غير محدد" [message-404] other = ".¯\\_(ツ)_/¯أوبس. يبدو أن هذه الصفحة غير موجودة" @@ -93,3 +96,15 @@ other = "{{.}} القائمة الفرعية" [Subsections] other = "{{.}} الأقسام الفرعية" + +[tags] +other = "الكلمات الدالة" + +[tag] +other = "كلمة رئيسية" + +[categories] +other = "فئات" + +[category] +other = "فئة" diff --git a/docs/themes/hugo-theme-relearn/i18n/cs.toml b/docs/themes/hugo-theme-relearn/i18n/cs.toml new file mode 100644 index 0000000..9045e54 --- /dev/null +++ b/docs/themes/hugo-theme-relearn/i18n/cs.toml @@ -0,0 +1,110 @@ +[Reading-direction] +other = "ltr" + +[Search] +other = "Hledat" + +[Search-placeholder] +other = "Hledat..." + +[Clear-search] +other = "Vymazat vyhledávání" + +[No-results-found] +other = "Žádné výsledky pro \"{0}\"" + +[N-results-found] +other = "{1} výsledků pro \"{0}\"" + +[Clear-History] +other = "Vymazat historii" + +[Attachments-label] +other = "Přílohy" + +[title-404] +other = "Nelokalizované" + +[message-404] +other = "Ups. Zdá se, že tato stránka neexistuje ¯\\_(ツ)_/¯." + +[Go-to-homepage] +other = "Přejít na domovskou stránku" + +[Edit-this-page] +other = "Upravit" + +[Print-this-chapter] +other = "Vytisknout kapitolu" + +[Shortcuts-Title] +other = "Více" + +[Expand-title] +other = "Rozbalit..." + +[Navigation-toggle] +other = "Menu" + +[Toc-toggle] +other = "Obsah" + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" + +[note] +other = "Poznámka" + +[info] +other = "Info" + +[tip] +other = "Tip" + +[warning] +other = "Varování" + +[Copy-to-clipboard] +other = "Kopírovat" + +[Copied-to-clipboard] +other = "Zkopírováno!" + +[Copy-link-to-clipboard] +other = "Kopírovat odkaz" + +[Link-copied-to-clipboard] +other = "Odkaz zkopírován!" + +[Chapter] +other = "Kapitola {{.}}" + +[Language] +other = "Jazyk" + +[Theme] +other = "Motiv" + +[Submenu] +other = "Podmenu {{.}}" + +[Subsections] +other = "Podsekce {{.}}" + +[tags] +other = "Klíčová Slova" + +[tag] +other = "Klíčové Slovo" + +[categories] +other = "Kategorie" + +[category] +other = "Kategorie" diff --git a/docs/themes/hugo-theme-relearn/i18n/de.toml b/docs/themes/hugo-theme-relearn/i18n/de.toml index e1261d0..31cc81b 100644 --- a/docs/themes/hugo-theme-relearn/i18n/de.toml +++ b/docs/themes/hugo-theme-relearn/i18n/de.toml @@ -7,6 +7,9 @@ other = "Suchen" [Search-placeholder] other = "Suchen..." +[Clear-search] +other = "Suche löschen" + [No-results-found] other = "Keine Ergebnisse gefunden für \"{0}\"" @@ -20,7 +23,7 @@ other = "Verlauf löschen" other = "Anhänge" [title-404] -other = "Fehler" +other = "Nicht gefunden" [message-404] other = "Huch. Diese Seite scheint nicht zu existieren ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Untermenu {{.}}" [Subsections] other = "Unterabschnitte von {{.}}" + +[tags] +other = "Stichworte" + +[tag] +other = "Stichwort" + +[categories] +other = "Kategorien" + +[category] +other = "Kategorie" diff --git a/docs/themes/hugo-theme-relearn/i18n/en.toml b/docs/themes/hugo-theme-relearn/i18n/en.toml index a59e3ed..c983a36 100644 --- a/docs/themes/hugo-theme-relearn/i18n/en.toml +++ b/docs/themes/hugo-theme-relearn/i18n/en.toml @@ -7,6 +7,9 @@ other = "Search" [Search-placeholder] other = "Search..." +[Clear-search] +other = "Clear search" + [No-results-found] other = "No results found for \"{0}\"" @@ -20,7 +23,7 @@ other = "Clear History" other = "Attachments" [title-404] -other = "Error" +other = "Not found" [message-404] other = "Woops. Looks like this page doesn't exist ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Submenu {{.}}" [Subsections] other = "Subsections of {{.}}" + +[tags] +other = "Tags" + +[tag] +other = "Tag" + +[categories] +other = "Categories" + +[category] +other = "Category" diff --git a/docs/themes/hugo-theme-relearn/i18n/es.toml b/docs/themes/hugo-theme-relearn/i18n/es.toml index fb5f1d9..85a954d 100644 --- a/docs/themes/hugo-theme-relearn/i18n/es.toml +++ b/docs/themes/hugo-theme-relearn/i18n/es.toml @@ -7,6 +7,9 @@ other = "Buscar" [Search-placeholder] other = "Buscar..." +[Clear-search] +other = "Borrar búsqueda" + [No-results-found] other = "No se han encontrado resultados para \"{0}\"" @@ -20,7 +23,7 @@ other = "Borrar Historial" other = "Adjuntos" [title-404] -other = "Error" +other = "Sin localizar" [message-404] other = "Ups. Parece que la página no existe ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Submenú {{.}}" [Subsections] other = "Subsecciones de {{.}}" + +[tags] +other = "Etiquetas" + +[tag] +other = "Etiqueta" + +[categories] +other = "Categorías" + +[category] +other = "Categoría" diff --git a/docs/themes/hugo-theme-relearn/i18n/fi.toml b/docs/themes/hugo-theme-relearn/i18n/fi.toml index a483e80..9880c96 100644 --- a/docs/themes/hugo-theme-relearn/i18n/fi.toml +++ b/docs/themes/hugo-theme-relearn/i18n/fi.toml @@ -7,6 +7,9 @@ other = "Etsi" [Search-placeholder] other = "Etsi..." +[Clear-search] +other = "Tyhjennä haku" + [No-results-found] other = "Ei tuloksia haulle \"{0}\"" @@ -20,7 +23,7 @@ other = "Tyhjennä historia" other = "Liitteet" [title-404] -other = "Virhe" +other = "Paikantamaton" [message-404] other = "Sivua ei ole ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Alavalikko {{.}}" [Subsections] other = "Osa {{.}}" + +[tags] +other = "Tunnisteet" + +[tag] +other = "Tag" + +[categories] +other = "Luokat" + +[category] +other = "Kategoria" diff --git a/docs/themes/hugo-theme-relearn/i18n/fr.toml b/docs/themes/hugo-theme-relearn/i18n/fr.toml index 4135f14..c3051d5 100644 --- a/docs/themes/hugo-theme-relearn/i18n/fr.toml +++ b/docs/themes/hugo-theme-relearn/i18n/fr.toml @@ -7,6 +7,9 @@ other = "Rechercher" [Search-placeholder] other = "Rechercher..." +[Clear-search] +other = "Recherche claire" + [No-results-found] other = "Aucun résultat trouvé pour \"{0}\"" @@ -20,7 +23,7 @@ other = "Supprimer l'historique" other = "Pièces jointes" [title-404] -other = "Erreur" +other = "Non localisé" [message-404] other = "Oups. On dirait que cette page n'existe pas ¯\\_(ツ)_/¯" @@ -93,3 +96,15 @@ other = "Sous-menu {{.}}" [Subsections] other = "Sous-sections de {{.}}" + +[tags] +other = "Mots-clés" + +[tag] +other = "Mot-clé" + +[categories] +other = "Catégories" + +[category] +other = "Catégorie" diff --git a/docs/themes/hugo-theme-relearn/i18n/hi.toml b/docs/themes/hugo-theme-relearn/i18n/hi.toml index 61f29e6..a145b03 100644 --- a/docs/themes/hugo-theme-relearn/i18n/hi.toml +++ b/docs/themes/hugo-theme-relearn/i18n/hi.toml @@ -7,6 +7,9 @@ other = "खोजे" [Search-placeholder] other = "खोजे..." +[Clear-search] +other = "खोज साफ़ करें" + [No-results-found] other = "\"{0}\" के लिए कोई परिणाम नहीं मिला" @@ -20,7 +23,7 @@ other = "इतिहास मिटाएँ" other = "संलग्नंक (अटैचमेंट)" [title-404] -other = "त्रुटि" +other = "अनवस्थित" [message-404] other = "यह पृष्ठ अभि अनुपलब्ध है!" @@ -93,3 +96,15 @@ other = "सबमेनू {{.}}" [Subsections] other = "{{.}} के उपखंड" + +[tags] +other = "टैग" + +[tag] +other = "उपनाम" + +[categories] +other = "श्रेणियाँ" + +[category] +other = "वर्ग" diff --git a/docs/themes/hugo-theme-relearn/i18n/hu.toml b/docs/themes/hugo-theme-relearn/i18n/hu.toml new file mode 100644 index 0000000..32af463 --- /dev/null +++ b/docs/themes/hugo-theme-relearn/i18n/hu.toml @@ -0,0 +1,110 @@ +[Reading-direction] +other = "ltr" + +[Search] +other = "Keresés" + +[Search-placeholder] +other = "Keresés..." + +[No-results-found] +other = "Nincs találat a(z) \"{0}\" kifejezésre" + +[N-results-found] +other = "{1} találat a(z) \"{0}\" kifejezésre" + +[Clear-History] +other = "Előzmények törlése" + +[Clear-search] +other = "Keresések törlése" + +[Attachments-label] +other = "Csatolmányok" + +[title-404] +other = "Az oldal nem található" + +[message-404] +other = "Hoppá. Úgy tűnik, hogy ez az oldal nem létezik ¯\\_(ツ)_/¯." + +[Go-to-homepage] +other = "Menj a kezdőlapra" + +[Edit-this-page] +other = "Szerkesztés" + +[Print-this-chapter] +other = "Teljes fejezet nyomtatása" + +[Shortcuts-Title] +other = "Egyebek" + +[Expand-title] +other = "Nyiss ki..." + +[Navigation-toggle] +other = "Menü" + +[Toc-toggle] +other = "Tartalomjegyzék" + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" + +[note] +other = "Jegyzet" + +[info] +other = "Infó" + +[tip] +other = "Tipp" + +[warning] +other = "Figyelem" + +[Copy-to-clipboard] +other = "Vágólapra másolás" + +[Copied-to-clipboard] +other = "Vágólapra másolva!" + +[Copy-link-to-clipboard] +other = "Link vágólapra másolása" + +[Link-copied-to-clipboard] +other = "Link vágólapra másolva!" + +[Chapter] +other = "{{.}} fejezet" + +[Language] +other = "Nyelv" + +[Theme] +other = "Téma" + +[Submenu] +other = "{{.}} almenü" + +[Subsections] +other = "{{.}} alszekciói" + +[tags] +other = "Címkék" + +[tag] +other = "Címke" + +[categories] +other = "Kategóriák" + +[category] +other = "Kategória" diff --git a/docs/themes/hugo-theme-relearn/i18n/id.toml b/docs/themes/hugo-theme-relearn/i18n/id.toml index c03b921..f080a79 100644 --- a/docs/themes/hugo-theme-relearn/i18n/id.toml +++ b/docs/themes/hugo-theme-relearn/i18n/id.toml @@ -7,6 +7,9 @@ other = "Telusuri" [Search-placeholder] other = "Telusuri..." +[Clear-search] +other = "Hapus pencarian" + [No-results-found] other = "Tidak ada hasil yang ditemukan untuk \"{0}\"" @@ -20,7 +23,7 @@ other = "Bersihkan Riwayat" other = "Lampiran" [title-404] -other = "Kesalahan" +other = "Tidak terletak" [message-404] other = "Oops. Sepertinya halaman ini tidak ada ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Submenu {{.}}" [Subsections] other = "Subbagian {{.}}" + +[tags] +other = "Tag" + +[tag] +other = "Tag" + +[categories] +other = "Kategori" + +[category] +other = "Kategori" diff --git a/docs/themes/hugo-theme-relearn/i18n/it.toml b/docs/themes/hugo-theme-relearn/i18n/it.toml index e00653e..a9940df 100644 --- a/docs/themes/hugo-theme-relearn/i18n/it.toml +++ b/docs/themes/hugo-theme-relearn/i18n/it.toml @@ -7,6 +7,9 @@ other = "Cerca" [Search-placeholder] other = "Cerca..." +[Clear-search] +other = "Cancella ricerca" + [No-results-found] other = "Nessun risultato trovato per \"{0}\"" @@ -20,7 +23,7 @@ other = "Reimposta storico" other = "Allegati" [title-404] -other = "Errore" +other = "Non localizzato" [message-404] other = "Oh no! Sembra che la pagina da te cercata non esista ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Sottomenu {{.}}" [Subsections] other = "Sottosezioni di {{.}}" + +[tags] +other = "Tag" + +[tag] +other = "Tag" + +[categories] +other = "Categorie" + +[category] +other = "Categoria" diff --git a/docs/themes/hugo-theme-relearn/i18n/ja.toml b/docs/themes/hugo-theme-relearn/i18n/ja.toml index faa3319..73c284c 100644 --- a/docs/themes/hugo-theme-relearn/i18n/ja.toml +++ b/docs/themes/hugo-theme-relearn/i18n/ja.toml @@ -7,6 +7,9 @@ other = "検索" [Search-placeholder] other = "検索..." +[Clear-search] +other = "検索をクリア" + [No-results-found] other = "\"{0}\" の結果が見つかりません" @@ -20,7 +23,7 @@ other = "履歴削除" other = "添付" [title-404] -other = "エラー" +other = "未配置" [message-404] other = "おっと。ページが見当たりません。 ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "サブメニュー {{.}}" [Subsections] other = "{{.}}のサブセクション" + +[tags] +other = "タグ" + +[tag] +other = "タグ" + +[categories] +other = "カテゴリー" + +[category] +other = "カテゴリー" diff --git a/docs/themes/hugo-theme-relearn/i18n/ko.toml b/docs/themes/hugo-theme-relearn/i18n/ko.toml index 5095a7f..59109fd 100644 --- a/docs/themes/hugo-theme-relearn/i18n/ko.toml +++ b/docs/themes/hugo-theme-relearn/i18n/ko.toml @@ -7,6 +7,9 @@ other = "검색" [Search-placeholder] other = "검색어를 입력하세요" +[Clear-search] +other = "검색 지우기" + [No-results-found] other = "\"{0}\"에 대한 결과가 없습니다." @@ -20,7 +23,7 @@ other = "방문 기록 삭제" other = "첨부파일" [title-404] -other = "오류" +other = "위치 없음" [message-404] other = "존재하지 않는 페이지입니다." @@ -96,3 +99,15 @@ other = "하위 메뉴 {{.}}" [Subsections] other = "{{.}}의 하위 섹션" + +[tags] +other = "태그" + +[tag] +other = "태그" + +[categories] +other = "카테고리" + +[category] +other = "카테고리" diff --git a/docs/themes/hugo-theme-relearn/i18n/nl.toml b/docs/themes/hugo-theme-relearn/i18n/nl.toml index 92a6545..64c7f7b 100644 --- a/docs/themes/hugo-theme-relearn/i18n/nl.toml +++ b/docs/themes/hugo-theme-relearn/i18n/nl.toml @@ -7,6 +7,9 @@ other = "Zoeken" [Search-placeholder] other = "Zoeken..." +[Clear-search] +other = "Zoekopdracht wissen" + [No-results-found] other = "Geen resultaten gevonden voor \"{0}\"" @@ -20,7 +23,7 @@ other = "Wis geschiedenis" other = "Bijlagen" [title-404] -other = "Error" +other = "Niet gelokaliseerd" [message-404] other = "Blijkbaar bestaat deze pagina niet ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Submenu {{.}}" [Subsections] other = "Subsecties van {{.}}" + +[tags] +other = "Tags" + +[tag] +other = "Tag" + +[categories] +other = "Categorieën" + +[category] +other = "Categorie" diff --git a/docs/themes/hugo-theme-relearn/i18n/pir.toml b/docs/themes/hugo-theme-relearn/i18n/pir.toml index f59a4a1..d658d81 100644 --- a/docs/themes/hugo-theme-relearn/i18n/pir.toml +++ b/docs/themes/hugo-theme-relearn/i18n/pir.toml @@ -1,5 +1,5 @@ [Reading-direction] -other = "ltr" +other = "rtl" [Search] other = "Searrrch" @@ -7,6 +7,9 @@ other = "Searrrch" [Search-placeholder] other = "Searrrch..." +[Clear-search] +other = "Clearrr searrrch" + [No-results-found] other = "No rrresults found fer \"{0}\"" @@ -14,13 +17,13 @@ other = "No rrresults found fer \"{0}\"" other = "{1} rrresults found fer \"{0}\"" [Clear-History] -other = "Clear Historrry" +other = "Clearrr Historrry" [Attachments-label] other = "Attachments" [title-404] -other = "Errror" +other = "Not found" [message-404] other = "Woops. Looks like this plank doesn't exist ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Submenu {{.}}" [Subsections] other = "Subsct'ns o' {{.}}" + +[tags] +other = "Taks" + +[tag] +other = "Tak" + +[categories] +other = "Categorrries" + +[category] +other = "Categorrry" diff --git a/docs/themes/hugo-theme-relearn/i18n/pl.toml b/docs/themes/hugo-theme-relearn/i18n/pl.toml index 4ae5b0b..5bd0104 100644 --- a/docs/themes/hugo-theme-relearn/i18n/pl.toml +++ b/docs/themes/hugo-theme-relearn/i18n/pl.toml @@ -7,6 +7,9 @@ other = "Szukaj" [Search-placeholder] other = "Szukaj..." +[Clear-search] +other = "Wyczyść wyszukiwanie" + [No-results-found] other = "Nie znaleziono wyników dla \"{0}\"" @@ -20,7 +23,7 @@ other = "Wyczyść historię" other = "Załączniki" [title-404] -other = "Błąd" +other = "Niezlokalizowany" [message-404] other = "Ups. Wygląda na to, że strona nie istnieje ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Podmenu {{.}}" [Subsections] other = "Podsekcje z {{.}}" + +[tags] +other = "Tagi" + +[tag] +other = "Tag" + +[categories] +other = "Kategorie" + +[category] +other = "Kategoria" diff --git a/docs/themes/hugo-theme-relearn/i18n/pt.toml b/docs/themes/hugo-theme-relearn/i18n/pt.toml index debc6db..bb9f1ee 100644 --- a/docs/themes/hugo-theme-relearn/i18n/pt.toml +++ b/docs/themes/hugo-theme-relearn/i18n/pt.toml @@ -7,6 +7,9 @@ other = "Procurar" [Search-placeholder] other = "Procurar..." +[Clear-search] +other = "Limpar pesquisa" + [No-results-found] other = "Nenhum resultado encontrado para \"{0}\"" @@ -20,7 +23,7 @@ other = "Limpar Histórico" other = "Anexos" [title-404] -other = "Erro" +other = "Não localizado" [message-404] other = "Ops. Parece que a página não existe ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Submenu {{.}}" [Subsections] other = "Subsecções de {{.}}" + +[tags] +other = "Etiquetas" + +[tag] +other = "Etiqueta" + +[categories] +other = "Categorias" + +[category] +other = "Categoria" diff --git a/docs/themes/hugo-theme-relearn/i18n/ru.toml b/docs/themes/hugo-theme-relearn/i18n/ru.toml index fa3ab3d..4f5ab9c 100644 --- a/docs/themes/hugo-theme-relearn/i18n/ru.toml +++ b/docs/themes/hugo-theme-relearn/i18n/ru.toml @@ -7,6 +7,9 @@ other = "Поиск" [Search-placeholder] other = "Поиск..." +[Clear-search] +other = "Очистить поиск" + [No-results-found] other = "Ничего не найдено для \"{0}\"" @@ -20,7 +23,7 @@ other = "Очистить историю" other = "Присоединенные файлы" [title-404] -other = "Ошибка" +other = "Не обнаружено" [message-404] other = "Упс. Выглядит будто такой страницы нет ¯\\_(ツ)_/¯." @@ -93,3 +96,15 @@ other = "Подменю {{.}}" [Subsections] other = "Подразделы {{.}}" + +[tags] +other = "Теги" + +[tag] +other = "Tag" + +[categories] +other = "Категории" + +[category] +other = "Категория" diff --git a/docs/themes/hugo-theme-relearn/i18n/tr.toml b/docs/themes/hugo-theme-relearn/i18n/tr.toml index 61b568c..64ad6ca 100644 --- a/docs/themes/hugo-theme-relearn/i18n/tr.toml +++ b/docs/themes/hugo-theme-relearn/i18n/tr.toml @@ -7,6 +7,9 @@ other = "Ara" [Search-placeholder] other = "Ara..." +[Clear-search] +other = "Aramayı temizle" + [No-results-found] other = "\"{0}\" için sonuç bulunamadı" @@ -20,7 +23,7 @@ other = "Geçmişi Temizle" other = "Ekler" [title-404] -other = "Hata" +other = "Konumsuz" [message-404] other = "Uups. Görünüşe göre böyle bir sayfa yok ¯\\_(ツ)_/¯" @@ -93,3 +96,15 @@ other = "Alt menü {{.}}" [Subsections] other = "{{.}} alt bölümleri" + +[tags] +other = "Etiketler" + +[tag] +other = "Etiket" + +[categories] +other = "Kategoriler" + +[category] +other = "Kategori" diff --git a/docs/themes/hugo-theme-relearn/i18n/vi.toml b/docs/themes/hugo-theme-relearn/i18n/vi.toml index 763da7c..3c370ba 100644 --- a/docs/themes/hugo-theme-relearn/i18n/vi.toml +++ b/docs/themes/hugo-theme-relearn/i18n/vi.toml @@ -7,6 +7,9 @@ other = "Tìm kiếm" [Search-placeholder] other = "Tìm kiếm..." +[Clear-search] +other = "Xóa tìm kiếm" + [No-results-found] other = "Không tìm thấy kết quả nào cho \"{0}\"" @@ -20,7 +23,7 @@ other = "Xóa lịch sử.." other = "Tập tin đính kèm" [title-404] -other = "Lỗi" +other = "Không xác định vị trí" [message-404] other = "Tiếc quá! Có vẻ như trang này không tồn tại ¯\\_(ツ)_/¯." @@ -96,3 +99,15 @@ other = "Menu con {{.}}" [Subsections] other = "Tiểu mục của {{.}}" + +[tags] +other = "Thẻ" + +[tag] +other = "Nhãn" + +[categories] +other = "Thể loại" + +[category] +other = "Loại" diff --git a/docs/themes/hugo-theme-relearn/i18n/zh-cn.toml b/docs/themes/hugo-theme-relearn/i18n/zh-cn.toml index 64ba8fb..8edf1fa 100644 --- a/docs/themes/hugo-theme-relearn/i18n/zh-cn.toml +++ b/docs/themes/hugo-theme-relearn/i18n/zh-cn.toml @@ -7,6 +7,9 @@ other = "搜索" [Search-placeholder] other = "搜索..." +[Clear-search] +other = "清除搜索" + [No-results-found] other = "找不到\"{0}\"的结果" @@ -20,7 +23,7 @@ other = "清理历史记录" other = "附件" [title-404] -other = "错误" +other = "未定位" [message-404] other = "哎哟。 看起来这个页面不存在 ¯\\_(ツ)_/¯。" @@ -93,3 +96,15 @@ other = "子菜单{{.}}" [Subsections] other = "{{.}} 的子部分" + +[tags] +other = "标签" + +[tag] +other = "标签" + +[categories] +other = "类别" + +[category] +other = "类别" diff --git a/docs/themes/hugo-theme-relearn/i18n/zh-tw.toml b/docs/themes/hugo-theme-relearn/i18n/zh-tw.toml index 4bf1c9e..018ba1c 100644 --- a/docs/themes/hugo-theme-relearn/i18n/zh-tw.toml +++ b/docs/themes/hugo-theme-relearn/i18n/zh-tw.toml @@ -7,6 +7,9 @@ other = "搜尋" [Search-placeholder] other = "搜尋..." +[Clear-search] +other = "清除搜索" + [No-results-found] other = "找不到\"{0}\"的結果" @@ -20,7 +23,7 @@ other = "清除歷史紀錄" other = "附件" [title-404] -other = "錯誤" +other = "未定位" [message-404] other = "這個網頁已經被刪除、移動或從未存在" @@ -93,3 +96,15 @@ other = "子功能表{{.}}" [Subsections] other = "{{.}} 的子部分" + +[tags] +other = "標籤" + +[tag] +other = "標籤" + +[categories] +other = "類別" + +[category] +other = "類別" diff --git a/docs/themes/hugo-theme-relearn/i18n/zh.toml b/docs/themes/hugo-theme-relearn/i18n/zh.toml index 64ba8fb..8edf1fa 100644 --- a/docs/themes/hugo-theme-relearn/i18n/zh.toml +++ b/docs/themes/hugo-theme-relearn/i18n/zh.toml @@ -7,6 +7,9 @@ other = "搜索" [Search-placeholder] other = "搜索..." +[Clear-search] +other = "清除搜索" + [No-results-found] other = "找不到\"{0}\"的结果" @@ -20,7 +23,7 @@ other = "清理历史记录" other = "附件" [title-404] -other = "错误" +other = "未定位" [message-404] other = "哎哟。 看起来这个页面不存在 ¯\\_(ツ)_/¯。" @@ -93,3 +96,15 @@ other = "子菜单{{.}}" [Subsections] other = "{{.}} 的子部分" + +[tags] +other = "标签" + +[tag] +other = "标签" + +[categories] +other = "类别" + +[category] +other = "类别" diff --git a/docs/themes/hugo-theme-relearn/images/hero.png b/docs/themes/hugo-theme-relearn/images/hero.png new file mode 100644 index 0000000..06ac522 Binary files /dev/null and b/docs/themes/hugo-theme-relearn/images/hero.png differ diff --git a/docs/themes/hugo-theme-relearn/images/screenshot.png b/docs/themes/hugo-theme-relearn/images/screenshot.png index 8f7df24..c9bce1e 100644 Binary files a/docs/themes/hugo-theme-relearn/images/screenshot.png and b/docs/themes/hugo-theme-relearn/images/screenshot.png differ diff --git a/docs/themes/hugo-theme-relearn/images/tn.png b/docs/themes/hugo-theme-relearn/images/tn.png index 316339a..0219d2d 100644 Binary files a/docs/themes/hugo-theme-relearn/images/tn.png and b/docs/themes/hugo-theme-relearn/images/tn.png differ diff --git a/docs/themes/hugo-theme-relearn/layouts/404.html b/docs/themes/hugo-theme-relearn/layouts/404.html index 7215db2..62c4c33 100644 --- a/docs/themes/hugo-theme-relearn/layouts/404.html +++ b/docs/themes/hugo-theme-relearn/layouts/404.html @@ -5,37 +5,138 @@ {{- partial "meta.html" . }} {{- .Scratch.Add "title" "" }} + {{- $title := .Title }} {{- if eq .Site.Data.titles .Title }} - {{- .Scratch.Set "title" (index .Site.Data.titles .Title).title }} - {{- else }} - {{- .Scratch.Set "title" .Title}} + {{- $title = (index .Site.Data.titles .Title).title }} {{- end }} - {{ .Scratch.Get "title" }} {{ default "::" .Site.Params.titleSeparator }} {{ .Site.Title }} - + {{- if and $title .Site.Title (not (eq $title .Site.Title)) }} + {{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }} + {{- end }} + {{ $title }} + {{- partialCached "favicon.html" . }} {{- partialCached "stylesheet.html" (dict "page" . "outputFormat" $outputFormat) $outputFormat }} {{- partial "custom-header.html" . }} - -
+ +
-
-

{{ T "title-404" }}

+
+

4{{ partial "shortcodes/icon.html" (dict "page" . "icon" "far fa-frown" )}}4

+

{{ T "title-404" }}

{{ T "message-404" }}

{{ T "Go-to-homepage" }}

-

Page not found!

+

+ + + + + + + + + +

diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock-math.html b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock-math.html index 566b662..0cadcf9 100644 --- a/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock-math.html +++ b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock-math.html @@ -1,5 +1,5 @@ {{- partial "shortcodes/math.html" (dict - "context" .Page + "page" .Page "content" .Inner "align" (index .Attributes "align") ) }} \ No newline at end of file diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock-mermaid.html b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock-mermaid.html index 196cac0..676a6d8 100644 --- a/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock-mermaid.html +++ b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock-mermaid.html @@ -1,5 +1,5 @@ {{- partial "shortcodes/mermaid.html" (dict - "context" .Page + "page" .Page "content" .Inner "align" (index .Attributes "align") ) }} \ No newline at end of file diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock.html b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock.html new file mode 100644 index 0000000..2760287 --- /dev/null +++ b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-codeblock.html @@ -0,0 +1,7 @@ +{{- partial "shortcodes/highlight.html" (dict + "page" .Page + "attributes" .Attributes + "content" .Inner + "options" .Options + "type" .Type +) }} \ No newline at end of file diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-image.html b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-image.html index 500fc90..db609b5 100644 --- a/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-image.html +++ b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-image.html @@ -1,6 +1,14 @@ +{{- $version := split hugo.Version "." }} +{{- $major := int (index $version 0) }} +{{- $minor := int (index $version 1) }} +{{- $id := "" }} +{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} + {{- $id = "" }} +{{- end }} {{- partial "shortcodes/image.html" (dict - "context" .Page + "page" .Page "url" .Destination "title" .Title "alt" .Text + "id" $id ) }} \ No newline at end of file diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-link.html b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-link.html index 01ab9f9..ec188b8 100644 --- a/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-link.html +++ b/docs/themes/hugo-theme-relearn/layouts/_default/_markup/render-link.html @@ -1,5 +1,5 @@ {{- partial "shortcodes/link.html" (dict - "context" .Page + "page" .Page "url" .Destination "title" .Title "content" .Text diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/index.json b/docs/themes/hugo-theme-relearn/layouts/_default/index.json index b1a57ba..74ff61b 100644 --- a/docs/themes/hugo-theme-relearn/layouts/_default/index.json +++ b/docs/themes/hugo-theme-relearn/layouts/_default/index.json @@ -1,8 +1,21 @@ {{- partialCached "page-meta.hugo" . .RelPermalink }} {{- $pages := slice }} {{- range .Site.Pages }} -{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} -{{- $pages = $pages | append (dict "uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .)) "title" .Title "tags" .Params.tags "description" .Description "content" (.Plain | htmlUnescape)) }} -{{- end }} -{{- end }} + {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} + {{- $title := .Title }} + {{- if eq .Kind "taxonomy" }} + {{- $title = i18n .Data.Plural }} + {{- if not $title }} + {{- $title = .Data.Plural }} + {{- end }} + {{- else if eq .Kind "term" }} + {{- $title = i18n .Data.Singular }} + {{- if not $title }} + {{- $title = .Data.Singular }} + {{- end }} + {{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Title }} + {{- end }} + {{- $pages = $pages | append (dict "uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .)) "title" $title "tags" .Params.tags "description" .Description "content" (.Plain | htmlUnescape)) }} + {{- end }} +{{- end -}} {{- $pages | jsonify (dict "indent" " ") }} diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/index.search.js b/docs/themes/hugo-theme-relearn/layouts/_default/index.search.js index e4703b3..d1c5dfa 100644 --- a/docs/themes/hugo-theme-relearn/layouts/_default/index.search.js +++ b/docs/themes/hugo-theme-relearn/layouts/_default/index.search.js @@ -1,8 +1,21 @@ {{- partialCached "page-meta.hugo" . .RelPermalink }} {{- $pages := slice }} {{- range .Site.Pages }} -{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} -{{- $pages = $pages | append (dict "uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .)) "title" .Title "tags" .Params.tags "description" .Description "content" (.Plain | htmlUnescape)) }} -{{- end }} + {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} + {{- $title := .Title }} + {{- if eq .Kind "taxonomy" }} + {{- $title = i18n .Data.Plural }} + {{- if not $title }} + {{- $title = .Data.Plural }} + {{- end }} + {{- else if eq .Kind "term" }} + {{- $title = i18n .Data.Singular }} + {{- if not $title }} + {{- $title = .Data.Singular }} + {{- end }} + {{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Title }} + {{- end }} + {{- $pages = $pages | append (dict "uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .)) "title" $title "tags" .Params.tags "description" .Description "content" (.Plain | htmlUnescape)) }} + {{- end }} {{- end -}} var relearn_search_index = {{ $pages | jsonify (dict "indent" " ") }} diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/sitemap.xml b/docs/themes/hugo-theme-relearn/layouts/_default/sitemap.xml index baa5200..1f79020 100644 --- a/docs/themes/hugo-theme-relearn/layouts/_default/sitemap.xml +++ b/docs/themes/hugo-theme-relearn/layouts/_default/sitemap.xml @@ -4,20 +4,24 @@ {{- range .Data.Pages }} {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }} - {{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}{{ if not .Lastmod.IsZero }} - {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} - {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} - {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} - {{ end }} - {{ end }} + {{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }} + {{- if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }} + {{- end }} + {{- with .Sitemap.ChangeFreq }} + {{ . }} + {{- end }} + {{- if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }} + {{- end }} + {{- if .IsTranslated }} + {{- range $index, $trans := .AllTranslations }} + {{- if eq $index 0 }} + + {{- end }} + + {{- end }} + {{- end }} {{- end -}} {{- end }} diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/taxonomy.html b/docs/themes/hugo-theme-relearn/layouts/_default/taxonomy.html index 4c70c18..fa4f426 100644 --- a/docs/themes/hugo-theme-relearn/layouts/_default/taxonomy.html +++ b/docs/themes/hugo-theme-relearn/layouts/_default/taxonomy.html @@ -1 +1,43 @@ -{{- partial "_taxonomy.html" . }} \ No newline at end of file +{{- partialCached "page-meta.hugo" . .RelPermalink }} +{{- partial "header.html" . }} +
+
+
+{{- $page := . }} + +{{- $title := i18n .Data.Plural }} +{{- if not $title }} + {{- $title = .Data.Plural }} +{{- end }} +

{{ $title }}

+{{- $lastCapital := "" }} +{{- range .Data.Terms.Alphabetical }} + {{- $capital := substr .Page.Title 0 1 | upper }} + {{- if ne $lastCapital $capital }} + {{- if ne $lastCapital "" }} + + {{- end }} +

{{ $capital }}

+
    + {{- end }} + {{- $c:=""}}{{/* display terms of a taxonomy */}} + {{- $len := 0 }} + {{- range .Pages }} + {{- $c:=""}}{{/* count pages of term */}} + {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }} + {{- $len = add $len 1 }} + {{- end }} + {{- end }} + {{- if $len }} +
  • {{ .Page.Title }} ({{ $len }})
  • + {{- end }} + {{- $lastCapital = $capital }} +{{- end }} +{{- if ne $lastCapital "" }} +
+{{- end }} + +
+
+
+{{- partial "footer.html" . }} \ No newline at end of file diff --git a/docs/themes/hugo-theme-relearn/layouts/_default/term.html b/docs/themes/hugo-theme-relearn/layouts/_default/term.html new file mode 100644 index 0000000..fc1f886 --- /dev/null +++ b/docs/themes/hugo-theme-relearn/layouts/_default/term.html @@ -0,0 +1,26 @@ +{{- partialCached "page-meta.hugo" . .RelPermalink }} +{{- partial "header.html" . }} +
+
+
+{{- $page := . }} + +{{- $title := i18n .Data.Singular }} +{{- if not $title }} + {{- $title = .Data.Singular }} +{{- end }} +{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Title }} +

{{ $title }}

+
    + {{- range sort .Pages "Title" }} + {{- $c:=""}}{{/* display pages of a term */}} + {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }} +
  • {{ .Title }}
  • + {{- end }} + {{- end }} +
+ +
+
+
+{{- partial "footer.html" . }} \ No newline at end of file diff --git a/docs/themes/hugo-theme-relearn/layouts/alias.html b/docs/themes/hugo-theme-relearn/layouts/alias.html index e63cc4b..2b3db29 100644 --- a/docs/themes/hugo-theme-relearn/layouts/alias.html +++ b/docs/themes/hugo-theme-relearn/layouts/alias.html @@ -1,7 +1,11 @@ - {{- $url := replace (replace .Permalink site.BaseURL "/") "//" "/" }} + {{- $url := .Permalink }} + {{- if site.BaseURL }} + {{- $url = replace .Permalink site.BaseURL "/" }} + {{- end }} + {{- $url = replace $url "//" "/" }} {{- with site.Home.GetPage $url }} {{- $c := "" }}{{/* if defaultContentLanguageInSubdir=false we are ending here for home page of the default language */}} {{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }} diff --git a/docs/themes/hugo-theme-relearn/layouts/partials/_taxonomy.html b/docs/themes/hugo-theme-relearn/layouts/partials/_taxonomy.html deleted file mode 100644 index 9514005..0000000 --- a/docs/themes/hugo-theme-relearn/layouts/partials/_taxonomy.html +++ /dev/null @@ -1,35 +0,0 @@ -{{- partialCached "page-meta.hugo" . .RelPermalink }} -{{- partial "header.html" . }} -
-{{- $page := . }} - -{{- $title := "" }} -{{- if eq .Kind "term" }} - {{- $title = printf "%s %s " (.Data.Singular | humanize) (default "::" .Site.Params.titleSeparator) }} -{{- end }} -{{- $title = printf "%s%s" $title .Title }} -

{{ $title }}

-
    - {{- range .Data.Terms.Alphabetical }} - {{- $len := 0 }} - {{- range .Pages }} - {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }} - {{- $len = add $len 1 }} - {{- end }} - {{- end }} - {{- if $len }} -
  • {{ .Page.Title }} ({{ $len }})
  • - {{- end }} - {{- else }} - {{- range sort .Pages "Title" }} - {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }} -
  • {{ .Title }}
  • - {{- end }} - {{- end }} - {{- end }} -
- -
-
-
-{{- partial "footer.html" . }} \ No newline at end of file diff --git a/docs/themes/hugo-theme-relearn/layouts/partials/archetype.hugo b/docs/themes/hugo-theme-relearn/layouts/partials/archetype.hugo index 854b204..45bcc7c 100644 --- a/docs/themes/hugo-theme-relearn/layouts/partials/archetype.hugo +++ b/docs/themes/hugo-theme-relearn/layouts/partials/archetype.hugo @@ -6,7 +6,8 @@ {{- $outputFormat = partial "output-format.hugo" $page }} {{- end }} {{- $archetype := "default" }} -{{- if $page.Params.archetype }} +{{- if not $page.File }} +{{- else if $page.Params.archetype }} {{- $archetype = $page.Params.archetype }} {{- else if $page.Params.chapter }} {{- $archetype = "deprecated-chapter" }} diff --git a/docs/themes/hugo-theme-relearn/layouts/partials/archetypes/chapter/article.html b/docs/themes/hugo-theme-relearn/layouts/partials/archetypes/chapter/article.html index 3db3a7d..d391efa 100644 --- a/docs/themes/hugo-theme-relearn/layouts/partials/archetypes/chapter/article.html +++ b/docs/themes/hugo-theme-relearn/layouts/partials/archetypes/chapter/article.html @@ -2,8 +2,11 @@ {{- $content := .content }} {{- with $page }}
+
+ {{- partial "content-header.html" . }} +
{{ partial "heading-pre.html" . }}
{{ T "Chapter" .Params.Weight }}
-

{{ .Title }}

{{ partial "heading-post.html" . }} +

{{ .Title }}

{{ partial "heading-post.html" . }} {{ $content | safeHTML }}