From 704987dc1c4d758da2b8f0a704f771d21aa2ac08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 21 Jan 2021 12:58:13 +0100 Subject: [PATCH 01/14] js: Update shims setup I finally got to testing this myself, and didn't get the existing setup to work, so I'll assume "I'm correct for now" (the famous last words). I will continue to search for a simpler setup. --- content/en/hugo-pipes/js.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/en/hugo-pipes/js.md b/content/en/hugo-pipes/js.md index a34454a93..a549b09c1 100644 --- a/content/en/hugo-pipes/js.md +++ b/content/en/hugo-pipes/js.md @@ -152,10 +152,11 @@ It's a common practice to load external libraries using a content delivery netwo First, add React and ReactDOM [CDN script tags](https://reactjs.org/docs/add-react-to-a-website.html#tip-minify-javascript-for-production) in your HTML template files. Then create `assets/js/shims/react.js` and `assets/js/shims/react-dom.js` with the following contents: ```js // In assets/js/shims/react.js -module.exports = window.React; +export let React = window.React; // In assets/js/shims/react-dom.js -module.exports = window.ReactDOM; +export let ReactDom = window.ReactDom; + ``` Finally, add the following to your project's `package.json`: From 13aeb2c73b6f8b3e14e059dcdc855a504bb311d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 21 Jan 2021 18:25:32 +0100 Subject: [PATCH 02/14] Update js.md --- content/en/hugo-pipes/js.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/hugo-pipes/js.md b/content/en/hugo-pipes/js.md index a549b09c1..64691025b 100644 --- a/content/en/hugo-pipes/js.md +++ b/content/en/hugo-pipes/js.md @@ -155,7 +155,7 @@ First, add React and ReactDOM [CDN script tags](https://reactjs.org/docs/add-rea export let React = window.React; // In assets/js/shims/react-dom.js -export let ReactDom = window.ReactDom; +export let ReactDOM = window.ReactDOM; ``` From 77def8a8c3bc7e2f90b01dc6270910d74ebc9755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 21 Jan 2021 19:07:36 +0100 Subject: [PATCH 03/14] Revert "Update js.md" This reverts commit 13aeb2c73b6f8b3e14e059dcdc855a504bb311d4. --- content/en/hugo-pipes/js.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/hugo-pipes/js.md b/content/en/hugo-pipes/js.md index 64691025b..a549b09c1 100644 --- a/content/en/hugo-pipes/js.md +++ b/content/en/hugo-pipes/js.md @@ -155,7 +155,7 @@ First, add React and ReactDOM [CDN script tags](https://reactjs.org/docs/add-rea export let React = window.React; // In assets/js/shims/react-dom.js -export let ReactDOM = window.ReactDOM; +export let ReactDom = window.ReactDom; ``` From 399c74acd69aa7d17e72c03942a84a66d4857f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 21 Jan 2021 19:07:38 +0100 Subject: [PATCH 04/14] Revert "js: Update shims setup" This reverts commit 704987dc1c4d758da2b8f0a704f771d21aa2ac08. --- content/en/hugo-pipes/js.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/content/en/hugo-pipes/js.md b/content/en/hugo-pipes/js.md index a549b09c1..a34454a93 100644 --- a/content/en/hugo-pipes/js.md +++ b/content/en/hugo-pipes/js.md @@ -152,11 +152,10 @@ It's a common practice to load external libraries using a content delivery netwo First, add React and ReactDOM [CDN script tags](https://reactjs.org/docs/add-react-to-a-website.html#tip-minify-javascript-for-production) in your HTML template files. Then create `assets/js/shims/react.js` and `assets/js/shims/react-dom.js` with the following contents: ```js // In assets/js/shims/react.js -export let React = window.React; +module.exports = window.React; // In assets/js/shims/react-dom.js -export let ReactDom = window.ReactDom; - +module.exports = window.ReactDOM; ``` Finally, add the following to your project's `package.json`: From b0290212153e46f4b5a694451f151daed3931b32 Mon Sep 17 00:00:00 2001 From: Ram Iyer Date: Tue, 26 Jan 2021 11:51:07 +0530 Subject: [PATCH 05/14] Fix a minor typo (#1314) --- content/en/hugo-pipes/js.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/hugo-pipes/js.md b/content/en/hugo-pipes/js.md index a34454a93..e5c830913 100644 --- a/content/en/hugo-pipes/js.md +++ b/content/en/hugo-pipes/js.md @@ -88,7 +88,7 @@ And it will resolve to the top-most `index.{js,ts,tsx,jsx}` inside `assets/my/mo import { hello3 } from 'my/module/hello3'; ``` -Wil resolve to `hello3.{js,ts,tsx,jsx}` inside `assets/my/module`. +Will resolve to `hello3.{js,ts,tsx,jsx}` inside `assets/my/module`. Any imports starting with `.` is resolved relative to the current file: From 6a163f53a8637a83598db42c36ed670e8cb7b16e Mon Sep 17 00:00:00 2001 From: fridde Date: Wed, 27 Jan 2021 14:26:57 +0100 Subject: [PATCH 06/14] Removed noise. (#1317) In accordance to the doc-trine *"no one wants to know how things were in your time, grandpa"*. --- content/en/variables/site.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/variables/site.md b/content/en/variables/site.md index 6b3f1d843..d3df29609 100644 --- a/content/en/variables/site.md +++ b/content/en/variables/site.md @@ -96,7 +96,7 @@ All the methods below, e.g. `.Site.RegularPages` can also be reached via the glo : top-level directories of the site. .Site.Taxonomies -: the [taxonomies](/taxonomies/usage/) for the entire site. Replaces the now-obsolete `.Site.Indexes` since v0.11. Also see section [Taxonomies elsewhere](#taxonomies-elsewhere). +: the [taxonomies](/taxonomies/usage/) for the entire site. Also see section [Taxonomies elsewhere](#taxonomies-elsewhere). .Site.Title : a string representing the title of the site. From 7a67c38c4b19e5f684f75b7fc363362707c25e39 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Wed, 27 Jan 2021 17:12:27 +0100 Subject: [PATCH 07/14] Correct sitemap version (#1318) As correctly stated at the beginning of the docs, sitemap protocol uses version 0.9 currently. Dont confuse with xml version 1.0 --- content/en/templates/sitemap-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/templates/sitemap-template.md b/content/en/templates/sitemap-template.md index acc90a1c8..dee28fc3b 100644 --- a/content/en/templates/sitemap-template.md +++ b/content/en/templates/sitemap-template.md @@ -43,7 +43,7 @@ For multilingual sites, we also create a Sitemap index. You can provide a custom ## Hugo’s sitemap.xml -This template respects the version 1.0 of the [Sitemap Protocol](https://www.sitemaps.org/protocol.html). +This template respects the version 0.9 of the [Sitemap Protocol](https://www.sitemaps.org/protocol.html). ```xml {{ printf "" | safeHTML }} From d8847a1443e0e0baf36f401bb50681fd0e1d17c0 Mon Sep 17 00:00:00 2001 From: Sean Wilson Date: Mon, 1 Feb 2021 03:37:23 +0000 Subject: [PATCH 08/14] docs: Fix HTML code in .RenderString description being stripped out (#1320) --- content/en/functions/RenderString.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/functions/RenderString.md b/content/en/functions/RenderString.md index 19ef11e59..b083e1c34 100644 --- a/content/en/functions/RenderString.md +++ b/content/en/functions/RenderString.md @@ -20,7 +20,7 @@ signature: [".RenderString MARKUP"] The method takes an optional map argument with these options: display ("inline") -: `inline` or `block`. If `inline` (default), surrounding ´

` on short snippets will be trimmed. +: `inline` or `block`. If `inline` (default), surrounding `

` on short snippets will be trimmed. markup (defaults to the Page's markup) : See identifiers in [List of content formats](/content-management/formats/#list-of-content-formats). From 260106669e1aa69dca31ed5de2e1704fed57ce6c Mon Sep 17 00:00:00 2001 From: Simon Perdrisat Date: Sat, 6 Feb 2021 12:32:39 +0100 Subject: [PATCH 09/14] Fix #1120 Use Github Action --- .../hosting-on-github.md | 219 ++++-------------- 1 file changed, 41 insertions(+), 178 deletions(-) diff --git a/content/en/hosting-and-deployment/hosting-on-github.md b/content/en/hosting-and-deployment/hosting-on-github.md index 55cfcccd6..5af900a67 100644 --- a/content/en/hosting-and-deployment/hosting-on-github.md +++ b/content/en/hosting-and-deployment/hosting-on-github.md @@ -1,7 +1,7 @@ --- title: Host on GitHub linktitle: Host on GitHub -description: Deploy Hugo as a GitHub Pages project or personal/organizational site and automate the whole process with a simple shell script. +description: Deploy Hugo as a GitHub Pages project or personal/organizational site and automate the whole process with Github Action Workflow date: 2014-03-21 publishdate: 2014-03-21 lastmod: 2018-09-22 @@ -19,7 +19,7 @@ toc: true aliases: [/tutorials/github-pages-blog/] --- -GitHub provides free and fast static hosting over SSL for personal, organization, or project pages directly from a GitHub repository via its [GitHub Pages service][]. +GitHub provides free and fast static hosting over SSL for personal, organization, or project pages directly from a GitHub repository via its [GitHub Pages service][] and automate development workflows and build with [GitHub Actions]. ## Assumptions @@ -36,10 +36,6 @@ There are 2 types of GitHub Pages: Please refer to the [GitHub Pages documentation][ghorgs] to decide which type of site you would like to create as it will determine which of the below methods to use. -To create a User/Organization Pages site, follow the single method in the *GitHub User and Organization Pages* section below. - -To create a Project Pages site, choose a method from the *Project Pages* section below. - ## GitHub User or Organization Pages As mentioned in the [GitHub Pages documentation][ghorgs], you can host a user/organization page in addition to project pages. Here are the key differences in GitHub Pages websites for Users and Organizations: @@ -49,190 +45,56 @@ As mentioned in the [GitHub Pages documentation][ghorgs], you can host a user/or This is a much simpler setup as your Hugo files and generated content are published into two different repositories. -### Step-by-step Instructions -1. Create a `` (e.g. `blog`) repository on GitHub. This repository will contain Hugo's content and other source files. -2. Create a `.github.io` GitHub repository. This is the repository that will contain the fully rendered version of your Hugo website. -3. `git clone && cd ` -4. Paste your existing Hugo project into the new local `` repository. Make sure your website works locally (`hugo server` or `hugo server -t `) and open your browser to . -5. Once you are happy with the results: - * Press Ctrl+C to kill the server - * Before proceeding run `rm -rf public` to completely remove the `public` directory -6. `git submodule add -b main https://github.com//.github.io.git public`. This creates a git [submodule][]. Now when you run the `hugo` command to build your site to `public`, the created `public` directory will have a different remote origin (i.e. hosted GitHub repository). -7. Make sure the `baseURL` in your config file is updated with: `.github.io` +## Build Hugo With Github Action -### Put it Into a Script +GitHub execute your software development workflows. Everytime you push your code on the Github repository, Github Action will build the site automatically. -You're almost done. In order to automate next steps create a `deploy.sh` script. You can also make it executable with `chmod +x deploy.sh`. +Create a file in `.github/workflows/gh-pages.yml` containing the following content (based on https://github.com/marketplace/actions/hugo-setup): -The following are the contents of the `deploy.sh` script: + ` +name: github pages -``` -#!/bin/sh +on: + push: + branches: + - main # Set a branch to deploy -# If a command fails then the deploy stops -set -e +jobs: + deploy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: true # Fetch Hugo themes (true OR recursive) + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod -printf "\033[0;32mDeploying updates to GitHub...\033[0m\n" + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.79.1' + # extended: true -# Build the project. -hugo # if using a theme, replace with `hugo -t ` + - name: Build + run: hugo --minify -# Go To Public folder -cd public + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public + ` -# Add changes to git. -git add . +Set hugo-version: `'latest'` to use the latest version of Hugo. -# Commit changes. -msg="rebuilding site $(date)" -if [ -n "$*" ]; then - msg="$*" -fi -git commit -m "$msg" +` +- name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' +` -# Push source and build repos. -git push origin main -``` - - -You can then run `./deploy.sh "Your optional commit message"` to send changes to `.github.io`. Note that you likely will want to commit changes to your `` repository as well. - -That's it! Your personal page should be up and running at `https://.github.io` within a couple minutes. - -## GitHub Project Pages - -{{% note %}} -Make sure your `baseURL` key-value in your [site configuration](/getting-started/configuration/) reflects the full URL of your GitHub pages repository if you're using the default GH Pages URL (e.g., `.github.io//`) and not a custom domain. -{{% /note %}} - -### Deployment of Project Pages from `/docs` folder on `main` branch - -[As described in the GitHub Pages documentation][ghpfromdocs], you can deploy from a folder called `docs/` on your main branch. To effectively use this feature with Hugo, you need to change the Hugo publish directory in your [site's][config] `config.toml` and `config.yaml`, respectively: - -``` -publishDir = "docs" -``` -``` -publishDir: docs -``` - -After running `hugo`, push your main branch to the remote repository and choose the `docs/` folder as the website source of your repo. Do the following from within your GitHub project: - -1. Go to **Settings** → **GitHub Pages** -2. From **Source**, select "main branch /docs folder". If the option isn't enabled, you likely do not have a `docs/` folder in the root of your project. - -{{% note %}} -The `docs/` option is the simplest approach but requires you set a publish directory in your site configuration. You cannot currently configure GitHub pages to publish from another directory on main, and not everyone prefers the output site live concomitantly with source files in version control. -{{% /note %}} - -### Deployment of Project Pages From Your `gh-pages` branch - -You can also tell GitHub pages to treat your `main` branch as the published site or point to a separate `gh-pages` branch. The latter approach is a bit more complex but has some advantages: - -* It keeps your source and generated website in different branches and therefore maintains version control history for both. -* Unlike the preceding `docs/` option, it uses the default `public` folder. - -#### Preparations for `gh-pages` Branch - -These steps only need to be done once. Replace `upstream` with the name of your remote; e.g., `origin`: - -##### Add the `public` Folder - -First, add the `public` folder to your `.gitignore` file at the project root so that the directory is ignored on the main branch: - -``` -echo "public" >> .gitignore -``` - -##### Initialize Your `gh-pages` Branch - -You can now initialize your `gh-pages` branch as an empty [orphan branch][]: - -``` -git checkout --orphan gh-pages -git reset --hard -git commit --allow-empty -m "Initializing gh-pages branch" -git push upstream gh-pages -git checkout main -``` - -#### Build and Deployment - -Now check out the `gh-pages` branch into your `public` folder using git's [worktree feature][]. Essentially, the worktree allows you to have multiple branches of the same local repository to be checked out in different directories: - -``` -rm -rf public -git worktree add -B gh-pages public upstream/gh-pages -``` - -Regenerate the site using the `hugo` command and commit the generated files on the `gh-pages` branch: - -{{< code file="commit-gh-pages-files.sh">}} -hugo -cd public && git add --all && git commit -m "Publishing to gh-pages" && cd .. -{{< /code >}} - -If the changes in your local `gh-pages` branch look alright, push them to the remote repo: - -``` -git push upstream gh-pages -``` - -##### Set `gh-pages` as Your Publish Branch - -In order to use your `gh-pages` branch as your publishing branch, you'll need to configure the repository within the GitHub UI. This will likely happen automatically once GitHub realizes you've created this branch. You can also set the branch manually from within your GitHub project: - -1. Go to **Settings** → **GitHub Pages** -2. From **Source**, select "gh-pages branch" and then **Save**. If the option isn't enabled, you likely have not created the branch yet OR you have not pushed the branch from your local machine to the hosted repository on GitHub. - -After a short while, you'll see the updated contents on your GitHub Pages site. - -#### Put it Into a Script - -To automate these steps, you can create a script with the following contents: - -{{< code file="publish_to_ghpages.sh" >}} -#!/bin/sh - -if [ "`git status -s`" ] -then - echo "The working directory is dirty. Please commit any pending changes." - exit 1; -fi - -echo "Deleting old publication" -rm -rf public -mkdir public -git worktree prune -rm -rf .git/worktrees/public/ - -echo "Checking out gh-pages branch into public" -git worktree add -B gh-pages public upstream/gh-pages - -echo "Removing existing files" -rm -rf public/* - -echo "Generating site" -hugo - -echo "Updating gh-pages branch" -cd public && git add --all && git commit -m "Publishing to gh-pages (publish.sh)" - -#echo "Pushing to github" -#git push --all -{{< /code >}} - -This will abort if there are pending changes in the working directory and also makes sure that all previously existing output files are removed. Adjust the script to taste, e.g. to include the final push to the remote repository if you don't need to take a look at the gh-pages branch before pushing. - -### Deployment of Project Pages from Your `main` Branch - -To use `main` as your publishing branch, you'll need your rendered website to live at the root of the GitHub repository. Steps should be similar to that of the `gh-pages` branch, with the exception that you will create your GitHub repository with the `public` directory as the root. Note that this does not provide the same benefits of the `gh-pages` branch in keeping your source and output in separate, but version controlled, branches within the same repo. - -You will also need to set `main` as your publishable branch from within the GitHub UI: - -1. Go to **Settings** → **GitHub Pages** -2. From **Source**, select "main branch" and then **Save**. +For more advance settings https://github.com/marketplace/actions/hugo-setup ## Use a Custom Domain @@ -251,3 +113,4 @@ Refer to the [official documentation for custom domains][domains] for further in [Quick Start]: /getting-started/quick-start/ [submodule]: https://github.com/blog/2104-working-with-submodules [worktree feature]: https://git-scm.com/docs/git-worktree +[GitHub Actions]: https://docs.github.com/en/actions From 7a95e9db571c02ac967fef9c70cf374dcc6ae421 Mon Sep 17 00:00:00 2001 From: Kahlil Wehmeyer <7523160+kwehmeyer@users.noreply.github.com> Date: Sun, 7 Feb 2021 23:02:14 -0500 Subject: [PATCH 10/14] Fix a formatting error for Github Actions (#1323) Fixed a formatting error for the yaml file and also changed all the versions to either `@latest` or just `latest`. --- .../hosting-on-github.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/content/en/hosting-and-deployment/hosting-on-github.md b/content/en/hosting-and-deployment/hosting-on-github.md index 5af900a67..5c1f71ef8 100644 --- a/content/en/hosting-and-deployment/hosting-on-github.md +++ b/content/en/hosting-and-deployment/hosting-on-github.md @@ -50,9 +50,10 @@ This is a much simpler setup as your Hugo files and generated content are publis GitHub execute your software development workflows. Everytime you push your code on the Github repository, Github Action will build the site automatically. -Create a file in `.github/workflows/gh-pages.yml` containing the following content (based on https://github.com/marketplace/actions/hugo-setup): +Create a file in `.github/workflows/gh-pages.yml` containing the following content (based on https://github.com/marketplace/actions/hugo-setup ): - ` + ``` + name: github pages on: @@ -70,29 +71,25 @@ jobs: fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 + uses: peaceiris/actions-hugo@latest with: - hugo-version: '0.79.1' + hugo-version: 'latest' # extended: true - name: Build run: hugo --minify - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@latest with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public - ` -Set hugo-version: `'latest'` to use the latest version of Hugo. - -` - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 + uses: peaceiris/actions-hugo@latest with: hugo-version: 'latest' -` +``` For more advance settings https://github.com/marketplace/actions/hugo-setup From f3be651f9c92e95fabd653a2468382ebf4379f9f Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Mon, 8 Feb 2021 13:12:44 +0900 Subject: [PATCH 11/14] Minor typo/markdown fixes (#1328) For https://gohugo.io/hosting-and-deployment/hosting-on-github/ --- .../en/hosting-and-deployment/hosting-on-github.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/content/en/hosting-and-deployment/hosting-on-github.md b/content/en/hosting-and-deployment/hosting-on-github.md index 5c1f71ef8..a7cb34a75 100644 --- a/content/en/hosting-and-deployment/hosting-on-github.md +++ b/content/en/hosting-and-deployment/hosting-on-github.md @@ -4,7 +4,6 @@ linktitle: Host on GitHub description: Deploy Hugo as a GitHub Pages project or personal/organizational site and automate the whole process with Github Action Workflow date: 2014-03-21 publishdate: 2014-03-21 -lastmod: 2018-09-22 categories: [hosting and deployment] keywords: [github,git,deployment,hosting] authors: [Spencer Lyon, Gunnar Morling] @@ -14,7 +13,6 @@ menu: weight: 30 weight: 30 sections_weight: 30 -draft: false toc: true aliases: [/tutorials/github-pages-blog/] --- @@ -29,7 +27,7 @@ GitHub provides free and fast static hosting over SSL for personal, organization ## Types of GitHub Pages -There are 2 types of GitHub Pages: +There are two types of GitHub Pages: - User/Organization Pages (`https://.github.io/`) - Project Pages (`https://.github.io//`) @@ -45,15 +43,13 @@ As mentioned in the [GitHub Pages documentation][ghorgs], you can host a user/or This is a much simpler setup as your Hugo files and generated content are published into two different repositories. - -## Build Hugo With Github Action +## Build Hugo With GitHub Action GitHub execute your software development workflows. Everytime you push your code on the Github repository, Github Action will build the site automatically. Create a file in `.github/workflows/gh-pages.yml` containing the following content (based on https://github.com/marketplace/actions/hugo-setup ): - ``` - +```yml name: github pages on: @@ -95,7 +91,7 @@ For more advance settings https://github.com/marketplace/actions/hugo-setup ## Use a Custom Domain -If you'd like to use a custom domain for your GitHub Pages site, create a file `static/CNAME`. Your custom domain name should be the only contents inside `CNAME`. Since it's inside `static`, the published site will contain the CNAME file at the root of the published site, which is a requirements of GitHub Pages. +If you'd like to use a custom domain for your GitHub Pages site, create a file `static/CNAME`. Your custom domain name should be the only contents inside `CNAME`. Since it's inside `static`, the published site will contain the CNAME file at the root of the published site, which is a requirement of GitHub Pages. Refer to the [official documentation for custom domains][domains] for further information. From 6178940528570052aba5fde16a5b9a8c3f73f12f Mon Sep 17 00:00:00 2001 From: Regis Philibert Date: Thu, 11 Feb 2021 19:27:22 -0500 Subject: [PATCH 12/14] Add site function Fixes #1324 --- content/en/functions/site.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 content/en/functions/site.md diff --git a/content/en/functions/site.md b/content/en/functions/site.md new file mode 100644 index 000000000..a6fab6dca --- /dev/null +++ b/content/en/functions/site.md @@ -0,0 +1,26 @@ +--- +title: site +linktitle: site +description: The `site` function provides global access the same data as `.Site` page method +godocref: +date: 2021-02-11 +publishdate: 2021-02-11 +lastmod: 2021-02-11 +keywords: [] +categories: [functions] +menu: + docs: + parent: "functions" +toc: +signature: ["site"] +workson: [] +hugoversion: +relatedfuncs: ["hugo"] +deprecated: false +draft: false +aliases: [] +--- + +`site` is a global function which returns the same data as the `.Site` page method. See: [Site Variables]({{< relref "/variables/site" >}}). + + From f912ea1cc6b53b7b84da1e305c1ee40d24da3a08 Mon Sep 17 00:00:00 2001 From: Simon Perdrisat Date: Fri, 12 Feb 2021 01:30:08 +0100 Subject: [PATCH 13/14] Fix the github workflow (#1332) --- content/en/hosting-and-deployment/hosting-on-github.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/content/en/hosting-and-deployment/hosting-on-github.md b/content/en/hosting-and-deployment/hosting-on-github.md index a7cb34a75..9cabdd938 100644 --- a/content/en/hosting-and-deployment/hosting-on-github.md +++ b/content/en/hosting-and-deployment/hosting-on-github.md @@ -67,7 +67,7 @@ jobs: fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - name: Setup Hugo - uses: peaceiris/actions-hugo@latest + uses: peaceiris/actions-hugo@v2 with: hugo-version: 'latest' # extended: true @@ -76,15 +76,10 @@ jobs: run: hugo --minify - name: Deploy - uses: peaceiris/actions-gh-pages@latest + uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public - -- name: Setup Hugo - uses: peaceiris/actions-hugo@latest - with: - hugo-version: 'latest' ``` For more advance settings https://github.com/marketplace/actions/hugo-setup From d343ebf718393ea704da132de508db712f7bcb44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 15 Feb 2021 13:17:09 +0100 Subject: [PATCH 14/14] Document ignoreImports --- content/en/hugo-modules/configuration.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/en/hugo-modules/configuration.md b/content/en/hugo-modules/configuration.md index 5405e4e51..4e30af852 100644 --- a/content/en/hugo-modules/configuration.md +++ b/content/en/hugo-modules/configuration.md @@ -80,6 +80,7 @@ extended [[module.imports]] path = "github.com/gohugoio/hugoTestModules1_linux/modh1_2_1v" ignoreConfig = false + ignoreImports = false disable = false [[module.imports]] path = "my-shortcodes" @@ -91,6 +92,9 @@ path ignoreConfig : If enabled, any module configuration file, e.g. `config.toml`, will not be loaded. Note that this will also stop the loading of any transitive module dependencies. +ignoreImports {{< new-in "0.80.0" >}} +: If enabled, module imports will not be followed. + disable : Set to `true` to disable the module while keeping any version info in the `go.*` files.