From 81adc6dbd26adc5bfdce6baa7307f6f8310d114d Mon Sep 17 00:00:00 2001 From: igor-baiborodine Date: Sun, 16 Jun 2024 17:41:01 -0400 Subject: [PATCH 1/4] fix: hugo config module import --- v4/exampleSite/hugo.toml | 12 +++++++----- v4/scripts/setup-example-site.sh | 2 +- v4/tests/exampleSite/hugo.toml | 5 ++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/v4/exampleSite/hugo.toml b/v4/exampleSite/hugo.toml index 831059ea..ce1b719f 100644 --- a/v4/exampleSite/hugo.toml +++ b/v4/exampleSite/hugo.toml @@ -1,11 +1,13 @@ title = "My cool new Blog" baseURL = "https://example.com/" -# Option 1 (recommended): adding the theme as a Hugo module -theme = "github.com/Lednerb/bilberry-hugo-theme/v4" +[module] + [[module.imports]] + # Option 1 (recommended): adding the theme as a Hugo module + path = "github.com/Lednerb/bilberry-hugo-theme/v4" -# Options 2 and 3: cloning/copying the theme files -# theme = "bilberry-hugo-theme/v4" + # Options 2 and 3: cloning/copying the theme files + # path = "bilberry-hugo-theme/v4" # Generate the robots.txt file for SEO enableRobotsTXT = true @@ -27,7 +29,7 @@ disqusShortname = "" css_modules = [] js_modules = [] - # Description and meta data for the search engines + # Description and metadata for the search engines author = "Lednerb" description = "Bilberry Premium Theme for Hugo." keywords = "blog,personal,responsive,search,font awesome,pages,posts,multilingual,syntax highlighting,premium,shortcuts" diff --git a/v4/scripts/setup-example-site.sh b/v4/scripts/setup-example-site.sh index 52ace769..c2ee4886 100755 --- a/v4/scripts/setup-example-site.sh +++ b/v4/scripts/setup-example-site.sh @@ -23,7 +23,7 @@ echo ">>> Updating 'hugo.toml'..." sed -i "s/title = .*$/title = \"Dev Bilberry Test\"/" exampleSite/hugo.toml sed -i "s/subtitle = .*$/subtitle = \"Running locally!\"/" exampleSite/hugo.toml -sed -i "s/theme = .*$/theme = \"..\/..\/..\/..\/..\/v4\"/" exampleSite/hugo.toml +sed -i "s/path = .*$/path = \"..\/..\/..\/..\/..\/v4\"/" exampleSite/hugo.toml echo ">>> ... completed." exit 0 diff --git a/v4/tests/exampleSite/hugo.toml b/v4/tests/exampleSite/hugo.toml index e2853e73..d92f41d3 100644 --- a/v4/tests/exampleSite/hugo.toml +++ b/v4/tests/exampleSite/hugo.toml @@ -1,6 +1,9 @@ title = "My cool new Blog" baseURL = "https://example.com/" -theme = "bilberry-hugo-theme/v4" + +[module] + [[module.imports]] + path = "bilberry-hugo-theme/v4" # Generate the robots.txt file for SEO enableRobotsTXT = true From 8c4f058113db06ac176fa16cd785fe45f652f123 Mon Sep 17 00:00:00 2001 From: igor-baiborodine Date: Sun, 16 Jun 2024 17:49:28 -0400 Subject: [PATCH 2/4] update docs --- v4/README.md | 32 ++++++++++++++++++-------------- v4/v4-migration-guide.md | 13 ++++++++----- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/v4/README.md b/v4/README.md index f42d7b90..6597ad00 100644 --- a/v4/README.md +++ b/v4/README.md @@ -155,8 +155,8 @@ cp -r bilberry-hugo-theme/v4/exampleSite/* my-new-blog #### Option 1 (recommended): Adding the Theme as a Hugo Module -Use this option if you want to pull in the theme files as a Hugo module from the main Bilberry Hugo theme repository. -This option makes it easy to keep the theme up to date in your site. +Use this option if you want to pull in the theme files as a Hugo module from the main Bilberry Hugo +theme repository. This option makes it easy to keep the theme up to date in your site. - Initialize your website as a Hugo module from the site's root: @@ -182,15 +182,17 @@ the [Hugo documentation](https://gohugo.io/hugo-modules/use-modules/). Use this option if you want to pull in the theme files as a Git submodule from the main Bilberry Hugo theme repository. This option also makes it easy to keep the theme up to date in your site. -- In the `my-new-blog/hugo.toml` file, uncomment the `theme` property for **Options 2 and 3**, and - comment out the `theme` property for **Option 1**: +- In the `my-new-blog/hugo.toml` file, uncomment the `path` property for **Options 2 and 3**, and + comment out the `path` property for **Option 1**: ```toml -# Option 1 (recommended): adding the theme as a hugo module -# theme = "github.com/Lednerb/bilberry-hugo-theme/v4" +[module] + [[module.imports]] + # Option 1 (recommended): adding the theme as a Hugo module + # path = "github.com/Lednerb/bilberry-hugo-theme/v4" -# Options 2 and 3: cloning/copying the theme files -theme = "bilberry-hugo-theme/v4" + # Options 2 and 3: cloning/copying the theme files + path = "bilberry-hugo-theme/v4" ``` - Add the Bilberry Hugo theme as a Git submodule from the site's root: @@ -203,15 +205,17 @@ $ git submodule add https://github.com/Lednerb/bilberry-hugo-theme.git themes/bi Use this option if you want to customize and maintain your own copy of the theme directly. -- In the `my-new-blog/hugo.toml` file, uncomment the `theme` property for **Options 2 and 3**, and - comment out the `theme` property for **Option 1**: +- In the `my-new-blog/hugo.toml` file, uncomment the `path` property for **Options 2 and 3**, and + comment out the `path` property for **Option 1**: ```toml -# Option 1 (recommended): adding the theme as a hugo module -# theme = "github.com/Lednerb/bilberry-hugo-theme/v4" +[module] + [[module.imports]] + # Option 1 (recommended): adding the theme as a Hugo module + # path = "github.com/Lednerb/bilberry-hugo-theme/v4" -# Options 2 and 3: cloning/copying the theme files -theme = "bilberry-hugo-theme/v4" + # Options 2 and 3: cloning/copying the theme files + path = "bilberry-hugo-theme/v4" ``` - Copy cloned (or unzipped) theme files in the previous step to the `my-new-blog/themes` directory: diff --git a/v4/v4-migration-guide.md b/v4/v4-migration-guide.md index 9808ee88..9c58dd99 100644 --- a/v4/v4-migration-guide.md +++ b/v4/v4-migration-guide.md @@ -8,14 +8,17 @@ Rename the site's configuration file from `config.toml` to `hugo.toml`. ### Theme Installation Options -Depending on your chosen theme installation option, update the theme property in the `hugo.toml` file as follows: +Depending on your chosen theme installation option, replace the `theme` property with +the `module.imports.path` property in the `hugo.toml` file as follows: ```toml -# Option 1 (recommended): adding the theme as a Hugo module -theme = "github.com/Lednerb/bilberry-hugo-theme/v4" +[module] + [[module.imports]] + # Option 1 (recommended): adding the theme as a Hugo module + # path = "github.com/Lednerb/bilberry-hugo-theme/v4" -# Options 2 and 3: cloning/copying the theme files -theme = "bilberry-hugo-theme/v4" + # Options 2 and 3: cloning/copying the theme files + path = "bilberry-hugo-theme/v4" ``` ### Top Navigation Bar From f1b7a22c4b9e08c44cb57a017f5a0e7c8cfa2084 Mon Sep 17 00:00:00 2001 From: igor-baiborodine Date: Sun, 16 Jun 2024 21:53:54 -0400 Subject: [PATCH 3/4] misc adjustments --- .github/workflows/update-demo-page.yml | 12 +++++++----- v4/README.md | 17 +++++++---------- v4/go.mod | 2 +- v4/v4-migration-guide.md | 6 +++--- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/update-demo-page.yml b/.github/workflows/update-demo-page.yml index fcbc5767..f03bbcd0 100644 --- a/.github/workflows/update-demo-page.yml +++ b/.github/workflows/update-demo-page.yml @@ -41,18 +41,20 @@ jobs: extended: true - name: Create new demo site - run: hugo new site /tmp/demo-site - - - name: Copy exampleSite content to new site - run: cp -r ./v4/exampleSite/* /tmp/demo-site + run: | + hugo new site /tmp/demo-site + rm /tmp/demo-site/archetypes/default.md - name: Init Hugo module working-directory: /tmp/demo-site run: | hugo mod init github.com/Lednerb/bilberry-hugo-theme/exampleSite - hugo mod get + hugo mod get -u cat go.mod + - name: Copy exampleSite content to new site + run: cp -r ./v4/exampleSite/* /tmp/demo-site + - name: Adjust hugo.toml working-directory: /tmp/demo-site run: | diff --git a/v4/README.md b/v4/README.md index 6597ad00..f4005551 100644 --- a/v4/README.md +++ b/v4/README.md @@ -117,7 +117,7 @@ Please use the following guidelines if you want to start a discussion: - **Hugo** (version >= 0.125.7 **extended**), see this [guide](https://gohugo.io/getting-started/installing/) on how to install Hugo. - **Git**, see this [guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) on how to install Git. -- **Go** (version >= 1.19), optional, required only when the Bilberry theme is used as a Hugo module; see +- **Go** (version >= 1.21), optional, required only when the Bilberry theme is used as a Hugo module; see this [guide](https://go.dev/doc/install) on how to install Go. ## Quick Start @@ -145,12 +145,6 @@ hugo new site my-new-blog rm my-new-blog/archetypes/default.md ``` -- Copy the example site content, including the `hugo.toml` file: - -```shell -cp -r bilberry-hugo-theme/v4/exampleSite/* my-new-blog -``` - ### Theme Installation Options #### Option 1 (recommended): Adding the Theme as a Hugo Module @@ -165,13 +159,16 @@ cd my-new-blog hugo mod init github.com//my-new-blog ``` -Following the Hugo module initialization, you may have the following warning: module " -github.com/Lednerb/bilberry-hugo-theme/v4" not found, which should be ignored. +- Copy the example site content, including the `hugo.toml` file: + +```shell +cp -r bilberry-hugo-theme/v4/exampleSite/* my-new-blog +``` - Pull theme files to add new content to your website: ```shell -hugo mod vendor +hugo mod get -u ``` If you need more details on how to use Hugo modules, please read diff --git a/v4/go.mod b/v4/go.mod index a696bb10..cf7576a6 100644 --- a/v4/go.mod +++ b/v4/go.mod @@ -1,3 +1,3 @@ module github.com/Lednerb/bilberry-hugo-theme/v4 -go 1.19 +go 1.21 diff --git a/v4/v4-migration-guide.md b/v4/v4-migration-guide.md index 9c58dd99..e3b25992 100644 --- a/v4/v4-migration-guide.md +++ b/v4/v4-migration-guide.md @@ -15,10 +15,10 @@ the `module.imports.path` property in the `hugo.toml` file as follows: [module] [[module.imports]] # Option 1 (recommended): adding the theme as a Hugo module - # path = "github.com/Lednerb/bilberry-hugo-theme/v4" + path = "github.com/Lednerb/bilberry-hugo-theme/v4" # Options 2 and 3: cloning/copying the theme files - path = "bilberry-hugo-theme/v4" + # path = "bilberry-hugo-theme/v4" ``` ### Top Navigation Bar @@ -41,7 +41,7 @@ In `v3`, color and font customizations were handled directly in the `assets/sass the `_variables.scss` file no longer exists and such customization is done in the `config.toml` by defining corresponding parameters from the `assets/sass/theme.scss` file, for example, `baseColor`, `headlineFont` etc. Therefore, any changes you made in `_variables.scss` file should be ported to your site's configuration file `hugo.toml`. Read -the [Colors and Fonts](README.md#colors-and-fonts) section in the `v4` **README** guide for more details. +the [Layouts, Colors and Fonts](README.md#layout-colors-and-fonts) section in the `v4` **README** guide for more details. ### Image Modal Zoom From f2eab16852b46659ecdb1895d765aa87ba972da8 Mon Sep 17 00:00:00 2001 From: igor-baiborodine Date: Sun, 16 Jun 2024 21:57:48 -0400 Subject: [PATCH 4/4] misc adjustments --- v4/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v4/README.md b/v4/README.md index f4005551..81846c96 100644 --- a/v4/README.md +++ b/v4/README.md @@ -165,7 +165,7 @@ hugo mod init github.com//my-new-blog cp -r bilberry-hugo-theme/v4/exampleSite/* my-new-blog ``` -- Pull theme files to add new content to your website: +- Pull theme files by updating theme's module: ```shell hugo mod get -u