diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-07 20:46:41 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-07 20:46:41 +0100 |
commit | b8d5090452ee482a4191622201f1548e651753f7 (patch) | |
tree | fa5a98792c0058898a173576d9a8e2d445778096 | |
parent | 301bafabe0665093ef729cf28af18d4f9ce5bea1 (diff) | |
parent | 6efb279bfacbd7304cef994be8181c6f804e7dd4 (diff) |
Merge commit '6efb279bfacbd7304cef994be8181c6f804e7dd4'
29 files changed, 407 insertions, 541 deletions
diff --git a/docs/.cspell.json b/docs/.cspell.json index b8ea0610f..de66ff601 100644 --- a/docs/.cspell.json +++ b/docs/.cspell.json @@ -105,6 +105,7 @@ "doas", "eopkg", "gitee", + "gohugoio", "goldmark", "KaTeX", "kubuntu", diff --git a/docs/.github/workflows/codeql-analysis.yml b/docs/.github/workflows/codeql-analysis.yml index 48555823e..86441b845 100644 --- a/docs/.github/workflows/codeql-analysis.yml +++ b/docs/.github/workflows/codeql-analysis.yml @@ -18,9 +18,9 @@ jobs: uses: actions/checkout@v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: "javascript" - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/docs/.github/workflows/super-linter.yml b/docs/.github/workflows/super-linter.yml index b2a5cb6f1..d8e408ee2 100644 --- a/docs/.github/workflows/super-linter.yml +++ b/docs/.github/workflows/super-linter.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v4 - name: Lint Code Base - uses: super-linter/super-linter/slim@v5 + uses: super-linter/super-linter/slim@v6 env: DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/README.md b/docs/README.md index bf5d9402c..93eaaf02e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,56 +1,20 @@ -[![Netlify Status](https://api.netlify.com/api/v1/badges/e0dbbfc7-34f1-4393-a679-c16e80162705/deploy-status)](https://app.netlify.com/sites/gohugoio/deploys) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://gohugo.io/contribute/documentation/) - -# Hugo Docs - -Documentation site for [Hugo](https://github.com/gohugoio/hugo), the very fast and flexible static site generator built with love in Go. - -## Contributing - -We welcome contributions to Hugo of any kind including documentation, suggestions, bug reports, pull requests etc. Also check out our [contribution guide](https://gohugo.io/contribute/documentation/). We would love to hear from you. - -Note that this repository contains solely the documentation for Hugo. For contributions that aren't documentation-related please refer to the [hugo](https://github.com/gohugoio/hugo) repository. - -*Pull requests shall **only** contain changes to the actual documentation. However, changes on the codebase of Hugo **and** the documentation shall be a single, atomic pull request in the [hugo](https://github.com/gohugoio/hugo) repository.* +<a href="https://gohugo.io/"><img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/static/images/hugo-logo-wide.svg?sanitize=true" alt="Hugo" width="565"></a> -Spelling fixes are most welcomed, and if you want to contribute longer sections to the documentation, it would be great if you had the following criteria in mind when writing: +A fast and flexible static site generator built with love by [bep], [spf13], and [friends] in [Go]. -* Short is good. People go to the library to read novels. If there is more than one way to _do a thing_ in Hugo, describe the current _best practice_ (avoid "… but you can also do …" and "… in older versions of Hugo you had to …". -* For example, try to find short snippets that teaches people about the concept. If the example is also useful as-is (copy and paste), then great. Don't list long and similar examples just so people can use them on their sites. -* Hugo has users from all over the world, so easy to understand and [simple English](https://simple.wikipedia.org/wiki/Basic_English) is good. +--- -## Edit the theme - -If you want to do docs-related theme changes, the simplest way is to have both `hugoDocs` and `gohugoioTheme` cloned as sibling directories, and then run: - -```sh -HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**" -``` - -## Branches - -* The `master` branch is where the site is automatically built from, and is the place to put changes relevant to the current Hugo version. -* The `next` branch is where we store changes that are related to the next Hugo release. This can be previewed here: https://next--gohugoio.netlify.com/ - -## Build - -To view the documentation site locally, you need to clone this repository: +[![Netlify Status](https://api.netlify.com/api/v1/badges/e0dbbfc7-34f1-4393-a679-c16e80162705/deploy-status)](https://app.netlify.com/sites/gohugoio/deploys) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://gohugo.io/contribute/documentation/) -```sh -git clone https://github.com/gohugoio/hugoDocs.git -``` +This is the repository for the [Hugo](https://github.com/gohugoio/hugo) documentation site. -Also note that the documentation version for a given version of Hugo can also be found in the `/docs` sub-folder of the [Hugo source repository](https://github.com/gohugoio/hugo). +Please see the [contributing] section for guidelines, examples, and process. -Then to view the docs in your browser, run Hugo and open up the link: -```sh -▶ hugo server -Started building sites ... -. -. -Serving pages from memory -Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) -Press Ctrl+C to stop -``` +[bep]: https://github.com/bep +[spf13]: https://github.com/spf13 +[friends]: https://github.com/gohugoio/hugo/graphs/contributors +[go]: https://go.dev/ +[contributing]: https://gohugo.io/contribute/documentation diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/baseof.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/baseof.html index 63b5b10f5..beb2d8619 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/baseof.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/baseof.html @@ -1,4 +1,4 @@ -<!DOCTYPE html> +<!doctype html> <html class="no-js" lang="{{ with $.Site.LanguageCode }} @@ -98,7 +98,8 @@ {{ partial "gtag.html" . }} {{ end }} - {{ if .Param "math" }} + {{ $hasMath := .Param "math" }} + {{ if $hasMath }} {{ partialCached "math.html" . }} {{ end }} @@ -107,7 +108,7 @@ <body class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }} {{ . }} - {{ end }}"> + {{ end }} {{ if $hasMath }}{{ print " dn" }}{{ end }}"> {{ partial "hooks/after-body-start.html" . }} {{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }} {{ block "header" . }}{{ end }} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/components/author-github-data-card.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/components/author-github-data-card.html index 622df7953..4caa21f3e 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/components/author-github-data-card.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/components/author-github-data-card.html @@ -1,32 +1,42 @@ {{ $author := .context.Params.author }} {{ if $author }} <aside class="mw5 center bg-white br3 pa3 pa4-ns mv3 ba b--black-10 nested-links"> - {{ $urlPre := "https://api.github.com" }} - {{ $user_json := getJSON $urlPre "/users/" $author }} - <div class="tc"> - - {{ if $user_json.avatar_url }} - <a href="{{ $user_json.html_url }}" class="link hover-bg-light-gray pa1 br-100"> - <img src="{{ $user_json.avatar_url }}&size={{ .size }}" alt="" class="br-100 ba b--light-gray"> - </a> + {{ $data := "" }} + {{ $url := urls.JoinPath "https://api.github.com/users" $author }} + {{ with resources.GetRemote $url }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + {{ $data = . | transform.Unmarshal }} {{ end }} + {{ else }} + {{ errorf "Unable to get remote resource %q" $url }} + {{ end }} + + <div class="tc"> + {{ with $data }} - {{ if $user_json.name }} - <h3 class="f4"> - <a href="{{ $user_json.html_url }}" class="link dim"> - {{ $user_json.name }} + {{ with .avatar_url }} + <a href="{{ . }}" class="link hover-bg-light-gray pa1 br-100"> + <img src="{{ . }}&size={{ $.size }}" alt="" class="br-100 ba b--light-gray"> </a> - </h3> - <hr class="mw3 bb bw1 b--black-10"> - {{ end }} + {{ end }} + {{ with .name }} + <h3 class="f4"> + <a href="{{ $data.html_url }}" class="link dim"> + {{ . | htmlEscape }} + </a> + </h3> + <hr class="mw3 bb bw1 b--black-10"> + {{ end }} + {{ with .bio }} + <p class="lh-copy measure center f6 black-70"> + {{ . | htmlEscape }} + </p> + {{ end }} - {{ if $user_json.bio }} - <p class="lh-copy measure center f6 black-70"> - {{ $user_json.bio }} - </p> {{ end }} - </div> </aside> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/components/author-github-data.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/components/author-github-data.html index 25baea80a..fbad3a0a7 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/components/author-github-data.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/components/author-github-data.html @@ -1,21 +1,36 @@ {{ $author := .context.Params.author }} {{ if $author }} <aside class="mw5 br3 mv3 nested-links"> - {{ $urlPre := "https://api.github.com" }} - {{ $user_json := getJSON $urlPre "/users/" $author }} - {{ if $user_json.name }} + + {{ $data := "" }} + {{ $url := urls.JoinPath "https://api.github.com/users" $author }} + {{ with resources.GetRemote $url }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + {{ $data = . | transform.Unmarshal }} + {{ end }} + {{ else }} + {{ errorf "Unable to get remote resource %q" $url }} + {{ end }} + + {{ with $data }} + {{ with .name }} <h3 class="f4 dib"> - {{ $user_json.name | htmlEscape }} + {{ . | htmlEscape }} </h3> - {{ end }} - {{ if $user_json.bio }} + {{ with .bio }} <p class="lh-copy measure center mt0 f6 black-60"> - {{ $user_json.bio | htmlEscape }} + {{ . | htmlEscape }} </p> {{ end }} - <a href="{{ $user_json.html_url }}" class="link dim v-mid dib"> - {{ partial "svg/github-squared.svg" (dict "fill" "gray" "width" "16" "height" "18") }} - </a> + {{ with .html_url }} + <a href="{{ . }}" class="link dim v-mid dib"> + {{ partial "svg/github-squared.svg" (dict "fill" "gray" "width" "16" "height" "18") }} + </a> + {{ end }} + {{ end }} + </aside> {{ end }} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/maintenance-pages-table.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/maintenance-pages-table.html index a2429a335..f1fb6d059 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/maintenance-pages-table.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/maintenance-pages-table.html @@ -14,11 +14,11 @@ <a href="{{ .Permalink }}">{{ .Title }}</a> </td> <td class="pv2 ph3"> - <a href="{{.Site.Params.ghrepo}}blob/master/content/{{.Lang }}/{{.File.Path}}"> + <a href="{{ .Site.Params.ghrepo }}blob/master/content/{{ .Language.Lang }}/{{ .File.Path }}"> {{ with .GitInfo }}{{ .Subject }}{{ else }}Source{{ end }} </a> </td> </tr> {{ end }} </tbody> -</table>
\ No newline at end of file +</table> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/math.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/math.html index defcaa055..b1eb5c8db 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/math.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/math.html @@ -2,8 +2,15 @@ <script> MathJax = { tex: { - displayMath: [['\\[', '\\]'], ['$$', '$$']], // block - inlineMath: [['\\(', '\\)']] // inline + inlineMath: [['$', '$'], ['\\(', '\\)']], // inline + displayMath: [['$$', '$$'], ['\\[', '\\]']] // block + }, + startup: { + pageReady: () => { + return MathJax.startup.defaultPageReady().then(() => { + document.body.classList.remove("dn"); + }); + } } }; </script> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/page-edit.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/page-edit.html index edf84669e..f41e5b791 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/page-edit.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/page-edit.html @@ -1,3 +1,3 @@ -<a href="{{.Site.Params.ghrepo}}edit/master/content/{{ .Lang }}/{{.File.Path}}" class=" +<a href="{{.Site.Params.ghrepo }}edit/master/content/{{ .Language.Lang }}/{{ .File.Path }}" class=" f6 ph3 pv1 br2 dib tc ttu mv3 bg-primary-color white hover-bg-green link ">Improve this page</a> diff --git a/docs/_vendor/modules.txt b/docs/_vendor/modules.txt index c21962edd..a63ac09b9 100644 --- a/docs/_vendor/modules.txt +++ b/docs/_vendor/modules.txt @@ -1 +1 @@ -# github.com/gohugoio/gohugoioTheme v0.0.0-20240126181647-31e47d550511 +# github.com/gohugoio/gohugoioTheme v0.0.0-20240201183016-8e648a3b5342 diff --git a/docs/content/en/content-management/front-matter.md b/docs/content/en/content-management/front-matter.md index 7593fb759..7dee78db2 100644 --- a/docs/content/en/content-management/front-matter.md +++ b/docs/content/en/content-management/front-matter.md @@ -131,9 +131,6 @@ videos weight : used for [ordering your content in lists][ordering]. Lower weight gets higher precedence. So content with lower weight will come first. If set, weights should be non-zero, as 0 is interpreted as an *unset* weight. -taxonomies -: Field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. *Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables.* - {{% note %}} If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site configuration file](/content-management/urls/#permalinks), Hugo will use the file name of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors. {{% /note %}} @@ -190,7 +187,7 @@ Any of the above can be omitted. {{% note %}} When making a site that supports multiple languages, defining a `[[cascade]]` is recommended to be done in [Site Config](../../getting-started/configuration/#cascade) to prevent duplication. -If you instea define a `[[cascade]]` in front matter for multiple languages, an `content/XX/foo/_index.md` file needs to be made on a per-language basis, with `XX` the glob pattern matching the Page's language. In this case, the **lang** keyword is ignored. +If you instead define a `[[cascade]]` in front matter for multiple languages, an `content/XX/foo/_index.md` file needs to be made on a per-language basis, with `XX` the glob pattern matching the Page's language. In this case, the **lang** keyword is ignored. {{% /note %}} ### Example diff --git a/docs/content/en/content-management/mathematics.md b/docs/content/en/content-management/mathematics.md index d2c71e630..b4dca75b1 100644 --- a/docs/content/en/content-management/mathematics.md +++ b/docs/content/en/content-management/mathematics.md @@ -1,9 +1,9 @@ --- title: Mathematics in markdown linkTitle: Mathematics -description: Include mathematical equations and expressions in your markdown using LaTeX or TeX typsetting syntax. +description: Include mathematical equations and expressions in your markdown using LaTeX or TeX typesetting syntax. categories: [content management] -keywords: [chemical,chemistry,latex,math,mathjax,tex,typsetting] +keywords: [chemical,chemistry,latex,math,mathjax,tex,typesetting] menu: docs: parent: content-management @@ -45,7 +45,7 @@ The approach described below avoids reliance on platform-specific features like ## Setup -Follow these instructions to include mathematical equations and expressions in your markdown using LaTeX or TeX typsetting syntax. +Follow these instructions to include mathematical equations and expressions in your markdown using LaTeX or TeX typesetting syntax. ###### Step 1 @@ -122,7 +122,7 @@ The example above loads the partial template if you have set the `math` paramete ###### Step 4 -Include mathematical equations and expressions in your markdown using LaTeX or TeX typsetting syntax. +Include mathematical equations and expressions in your markdown using LaTeX or TeX typesetting syntax. {{< code file=content/math-examples.md copy=true >}} This is an inline \(a^*=x-b^*\) equation. diff --git a/docs/content/en/contribute/development.md b/docs/content/en/contribute/development.md index b4de88256..c2eaa93ad 100644 --- a/docs/content/en/contribute/development.md +++ b/docs/content/en/contribute/development.md @@ -11,420 +11,138 @@ weight: 20 toc: true --- -## Introduction - -Hugo is an open-source project and lives by the work of its [contributors]. There are plenty of [open issues][issues], and we need your help to make Hugo even more awesome. You don't need to be a Go guru to contribute to the project's development. - -## Assumptions - -This contribution guide takes a step-by-step approach in hopes of helping newcomers. Therefore, we only assume the following: - -* You are new to Git or open-source projects in general -* You are a fan of Hugo and enthusiastic about contributing to the project - -{{% note %}} -If you're struggling at any point in this contribution guide, reach out to the Hugo community in [Hugo's Discussion forum](https://discourse.gohugo.io). -{{% /note %}} - -## Install Go - -The installation of Go should take only a few minutes. You have more than one option to get Go up and running on your machine. - -If you are having trouble following the installation guides for Go, check out [Go Bootcamp, which contains setups for every platform][gobootcamp] or reach out to the Hugo community in the [Hugo Discussion Forums][forums]. - -### Install Go from source - -[Download the latest stable version of Go][godl] and follow the official [Go installation guide][goinstall]. - -Once you're finished installing Go, let's confirm everything is working correctly. Open a terminal---or command line under Windows--and type the following: - -```txt -go version -``` - -You should see something similar to the following written to the console. Note that the version here reflects the most recent version of Go as of the last update for this page: - -```txt -go version go1.12 darwin/amd64 -``` - -Next, make sure that you set up your `GOPATH` [as described in the installation guide][setupgopath]. - -You can print the `GOPATH` with `echo $GOPATH`. You should see a non-empty string containing a valid path to your Go workspace; for example: - -```txt -/Users/<yourusername>/Code/go -``` - -### Install Go with Homebrew - -If you are a macOS user and have [Homebrew](https://brew.sh/) installed on your machine, installing Go is as simple as the following command: - -{{< code file=install-go.sh >}} -brew install go -{{< /code >}} - -### Install Go via GVM - -More experienced users can use the [Go Version Manager][gvm] (GVM). GVM allows you to switch between different Go versions *on the same machine*. If you're a beginner, you probably don't need this feature. However, GVM makes it easy to upgrade to a new released Go version with just a few commands. - -GVM comes in especially handy if you follow the development of Hugo over a longer period of time. Future versions of Hugo will usually be compiled with the latest version of Go. Sooner or later, you will have to upgrade if you want to keep up. - -## Create a GitHub account - -If you're going to contribute code, you'll need to have an account on GitHub. Go to [www.github.com/join](https://github.com/join) and set up a personal account. - -## Install Git on your system - -You will need to have Git installed on your computer to contribute to Hugo development. Teaching Git is outside the scope of the Hugo docs, but if you're looking for an excellent reference to learn the basics of Git, we recommend the [Git book][gitbook] if you are not sure where to begin. We will include short explanations of the Git commands in this document. - -Git is a [version control system](https://en.wikipedia.org/wiki/Version_control) to track the changes of source code. Hugo depends on smaller third-party packages that are used to extend the functionality. We use them because we don't want to reinvent the wheel. - -Go ships with a sub-command called `get` that will download these packages for us when we set up our working environment. The source code of the packages is tracked with Git. `get` will interact with the Git servers of the package hosters in order to fetch all dependencies. - -Move back to the terminal and check if Git is already installed. Type in `git version` and press enter. You can skip the rest of this section if the command returned a version number. Otherwise [download](https://git-scm.com/downloads) the latest version of Git and follow this [installation guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). -Finally, check again with `git version` if Git was installed successfully. -### Git graphical front ends +## Introduction -There are several [GUI clients](https://git-scm.com/downloads/guis) that help you to operate Git. Not all are available for all operating systems and maybe differ in their usage. Because of this we will document how to use the comma |