From eacc2251f94322d010343d6705d996351cd64a0d Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Fri, 15 Jul 2022 13:48:54 -0400 Subject: [PATCH 1/2] Set docsy version in config as `version` --- userguide/config.toml | 2 +- .../en/docs/Updating/Convert-site-to-module.md | 14 +++++++------- .../en/docs/Updating/Updating-hugo-module.md | 4 ++-- .../docsy-as-module/start-from-scratch.md | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/userguide/config.toml b/userguide/config.toml index 3836183c45..2bfe49cc3b 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -85,7 +85,7 @@ archived_version = false # The version number for the version of the docs represented in this doc set. # Used in the "version-banner" partial to display a version number for the # current doc set. -version = "0.0" +version = "0.4.0" # A link to latest version of the docs. Used in the "version-banner" partial to # point people to the main doc site. diff --git a/userguide/content/en/docs/Updating/Convert-site-to-module.md b/userguide/content/en/docs/Updating/Convert-site-to-module.md index 53b9ceea75..bf2c1ff1ef 100644 --- a/userguide/content/en/docs/Updating/Convert-site-to-module.md +++ b/userguide/content/en/docs/Updating/Convert-site-to-module.md @@ -15,7 +15,7 @@ Run the following from the command line: {{< tab header="Unix shell" lang="Bash" >}} cd /path/to/my-existing-site hugo mod init github.com/me-at-github/my-existing-site -hugo mod get github.com/google/docsy@v0.4.0 +hugo mod get github.com/google/docsy@v{{% param "version" %}} sed -i '/theme = \["docsy"\]/d' config.toml cat >> config.toml <}} cd my-existing-site hugo mod init github.com/me-at-github/my-existing-site -hugo mod get github.com/google/docsy@v0.4.0 +hugo mod get github.com/google/docsy@v{{% param "version" %}} findstr /v /c:"theme = [\"docsy\"]" config.toml > config.toml.temp move /Y config.toml.temp config.toml (echo [module]^ @@ -70,7 +70,7 @@ This creates two new files, `go.mod` for the module definitions and `go.sum` whi Next declare the Docsy theme module as a dependency for your site. ```bash -hugo mod get github.com/google/docsy@v0.4.0 +hugo mod get github.com/google/docsy@v{{% param "version" %}} ``` This command adds the `docsy` theme module to your definition file `go.mod`. @@ -181,10 +181,10 @@ To make sure that your configuration settings are correct, run the command `hugo ```bash hugo mod graph hugo: collected modules in 1092 ms -github.com/me/my-existing-site github.com/google/docsy@v0.4.0 -github.com/me/my-existing-site github.com/google/docsy/dependencies@v0.4.0 -github.com/google/docsy/dependencies@v0.4.0 github.com/twbs/bootstrap@v4.6.1+incompatible -github.com/google/docsy/dependencies@v0.4.0 github.com/FortAwesome/Font-Awesome@v0.0.0-20210804190922-7d3d774145ac +github.com/me/my-existing-site github.com/google/docsy@v{{% param "version" %}} +github.com/me/my-existing-site github.com/google/docsy/dependencies@v{{% param "version" %}} +github.com/google/docsy/dependencies@v{{% param "version" %}} github.com/twbs/bootstrap@v4.6.1+incompatible +github.com/google/docsy/dependencies@v{{% param "version" %}} github.com/FortAwesome/Font-Awesome@v0.0.0-20210804190922-7d3d774145ac ``` Make sure that three lines with dependencies `docsy`, `bootstrap` and `Font-Awesome` are listed. If not, please double check your config settings. diff --git a/userguide/content/en/docs/Updating/Updating-hugo-module.md b/userguide/content/en/docs/Updating/Updating-hugo-module.md index bbe864a29c..50650460d0 100644 --- a/userguide/content/en/docs/Updating/Updating-hugo-module.md +++ b/userguide/content/en/docs/Updating/Updating-hugo-module.md @@ -24,10 +24,10 @@ Hugo automatically pulls in the latest theme version. That's it, your update is {{% alert title="Tip" %}} -If you want to set your module to a certain version inside the docsy theme repo, simply specific the name of the tag representing this version (here: _v0.4.0_) when updating your theme: +If you want to set your module to a certain version inside the docsy theme repo, simply specific the name of the tag representing this version (here: _v{{% param "version" %}}_) when updating your theme: ```bash -hugo mod get -u github.com/google/docsy@v0.4.0 +hugo mod get -u github.com/google/docsy@v{{% param "version" %}} ``` Instead of a version tag, you can also specify a commit hash inside the repo (here: _6c8a3afe_) when updating your theme: diff --git a/userguide/content/en/docs/get-started/docsy-as-module/start-from-scratch.md b/userguide/content/en/docs/get-started/docsy-as-module/start-from-scratch.md index c89985f875..2a29ee2084 100644 --- a/userguide/content/en/docs/get-started/docsy-as-module/start-from-scratch.md +++ b/userguide/content/en/docs/get-started/docsy-as-module/start-from-scratch.md @@ -21,7 +21,7 @@ At your command prompt, run the following: hugo new site my-new-site cd my-new-site hugo mod init github.com/me/my-new-site -hugo mod get github.com/google/docsy@v0.4.0 +hugo mod get github.com/google/docsy@v{{% param "version" %}} cat >> config.toml < Date: Fri, 29 Jul 2022 15:07:39 -0400 Subject: [PATCH 2/2] Prose tweaks --- .../en/docs/Updating/Updating-hugo-module.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/userguide/content/en/docs/Updating/Updating-hugo-module.md b/userguide/content/en/docs/Updating/Updating-hugo-module.md index 50650460d0..25a8975558 100644 --- a/userguide/content/en/docs/Updating/Updating-hugo-module.md +++ b/userguide/content/en/docs/Updating/Updating-hugo-module.md @@ -1,9 +1,7 @@ --- -title: "Update the Docsy Hugo Module" -linkTitle: "Update the Docsy Hugo Module" +title: Update your Docsy Hugo Module weight: 1 -description: > - Update the Docsy theme to the latest version using Hugo Modules. +description: Update your Docsy theme to the latest version using Hugo Modules. --- When using the Docsy theme as a Hugo Module, updating your theme is really easy. @@ -20,20 +18,23 @@ Then invoke hugo's module `get` subcommand with the update flag: hugo mod get -u github.com/google/docsy ``` -Hugo automatically pulls in the latest theme version. That's it, your update is done! - +Hugo automatically pulls in the latest theme version. That's it, your update is +done! {{% alert title="Tip" %}} -If you want to set your module to a certain version inside the docsy theme repo, simply specific the name of the tag representing this version (here: _v{{% param "version" %}}_) when updating your theme: + +If you want to set your module to a certain version inside the Docsy theme repo, +simply specify the name of the tag representing this version when updating your +theme, for example: ```bash hugo mod get -u github.com/google/docsy@v{{% param "version" %}} ``` -Instead of a version tag, you can also specify a commit hash inside the repo (here: _6c8a3afe_) when updating your theme: - +Instead of a version tag, you can also specify a commit hash, for example: ```bash hugo mod get -u github.com/google/docsy@6c8a3afe ``` + {{% /alert %}}