Skip to content

Commit d4f03fa

Browse files
feat(v4): prepare release (#571)
1 parent c8add24 commit d4f03fa

File tree

4 files changed

+153
-144
lines changed

4 files changed

+153
-144
lines changed

README.md

Lines changed: 104 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
# Bilberry Hugo Theme
1+
# Bilberry Hugo Theme v4
22

33
[![GitHub version](https://img.shields.io/github/release/Lednerb/bilberry-hugo-theme/all.svg?style=flat-square)](https://github.com/Lednerb/bilberry-hugo-theme/releases)
4-
[![Hugo Version](https://img.shields.io/badge/Hugo-%5E0.93.3-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
4+
[![Hugo Version](https://img.shields.io/badge/Hugo-%5E0.109.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
55
[![Hugo Themes](https://img.shields.io/badge/Hugo_Themes-@Bilberry-ff4088)](https://themes.gohugo.io/themes/bilberry-hugo-theme/)
66

77
[![Build GH-Pages](https://github.com/Lednerb/bilberry-hugo-theme/workflows/Update%20GitHub%20Pages/badge.svg)](https://github.com/Lednerb/bilberry-hugo-theme/deployments/activity_log?environment=github-pages)
88
[![Contributors](https://img.shields.io/badge/contributors-48-orange.svg?style=flat-square)](#contributors)
99
[![License](https://img.shields.io/github/license/Lednerb/bilberry-hugo-theme.svg?style=flat-square)](https://github.com/Lednerb/bilberry-hugo-theme/blob/master/LICENSE.md)
1010

11+
----
12+
13+
This guide is for `v4` version. For `v3`, please use this [guide](v3-README.md).
14+
15+
**IMPORTANT** `v3` will be supported until **August 31, 2024**. Only critical bugs will be fixed during this period, no
16+
new features will be implemented.
17+
18+
----
19+
1120
**Bilberry** is a premium [Hugo](https://gohugo.io) theme with many great features.
1221
This is an adaptation and further optimization of
1322
the [Lingonberry WordPress theme](https://en-ca.wordpress.org/themes/lingonberry/) by Anders Norén.
@@ -36,7 +45,8 @@ Please use the following guidelines if you want to start a discussion:
3645
- [Site Initial Setup](#site-initial-setup)
3746
- [Theme Installation Options](#theme-installation-options)
3847
- [Option 1 (recommended): Adding the Theme as a Hugo Module](#option-1-recommended-adding-the-theme-as-a-hugo-module)
39-
- [Option 2: Cloning/Copying the Theme Files](#option-2-cloningcopying-the-theme-files)
48+
- [Option 2: Adding the Theme as a Git submodule](#option-2-adding-the-theme-as-a-git-submodule)
49+
- [Option 3: Copying the Theme Files](#option-3-copying-the-theme-files)
4050
- [Configuration](#configuration)
4151
- [Webserver](#webserver)
4252
- [Free Hosting](#free-hosting)
@@ -87,6 +97,7 @@ Please use the following guidelines if you want to start a discussion:
8797
- [404 Page](#404-page)
8898
- [Custom Post Types](#custom-post-types)
8999
- [Individual Posts](#individual-posts)
100+
- [Syntax Highlighting](#syntax-highlighting)
90101
- [Colors and Fonts](#colors-and-fonts)
91102
- [CSS and JS modules](#css-and-js-modules)
92103
- [Cookie Disclaimer (GDPR)](#cookie-disclaimer-gdpr)
@@ -99,9 +110,9 @@ Please use the following guidelines if you want to start a discussion:
99110

100111
## Requirements
101112

102-
- **Hugo** (version >= 0.93.3), see this [guide](https://gohugo.io/getting-started/installing/) on how to install Hugo.
113+
- **Hugo** (version >= 0.109.0 **extended**), see this [guide](https://gohugo.io/getting-started/installing/) on how to install Hugo.
103114
- **Git**, see this [guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) on how to install Git.
104-
- **Go** (version >= 1.18), optional, required only when the Bilberry theme is used as a Hugo module; see
115+
- **Go** (version >= 1.19), optional, required only when the Bilberry theme is used as a Hugo module; see
105116
this [guide](https://go.dev/doc/install) on how to install Go.
106117

107118
## Quick Start
@@ -129,17 +140,17 @@ hugo new site my-new-blog
129140
rm my-new-blog/archetypes/default.md
130141
```
131142

132-
- Copy the example site content including the `config.toml` file:
143+
- Copy the example site content, including the `config.toml` file:
133144

134145
```shell
135-
cp -r bilberry-hugo-theme/exampleSite/* my-new-blog
146+
cp -r bilberry-hugo-theme/v4/exampleSite/* my-new-blog
136147
```
137148

138149
### Theme Installation Options
139150

140151
#### Option 1 (recommended): Adding the Theme as a Hugo Module
141152

142-
Use this option if you want to pull in the theme files from the main Bilberry Hugo theme repository.
153+
Use this option if you want to pull in the theme files as a Hugo module from the main Bilberry Hugo theme repository.
143154
This option makes it easy to keep the theme up to date in your site.
144155

145156
- Initialize your website as a Hugo module from the site's root:
@@ -150,7 +161,7 @@ hugo mod init github.com/<your-user>/my-new-blog
150161
```
151162

152163
Following the Hugo module initialization, you may have the following warning: module "
153-
github.com/Lednerb/bilberry-hugo-theme/v3" not found, which should be ignored.
164+
github.com/Lednerb/bilberry-hugo-theme/v4" not found, which should be ignored.
154165

155166
- Pull theme files to add new content to your website:
156167

@@ -161,19 +172,41 @@ hugo mod vendor
161172
If you need more details on how to use Hugo modules, please read
162173
the [Hugo documentation](https://gohugo.io/hugo-modules/use-modules/).
163174

164-
#### Option 2: Cloning/Copying the Theme Files
175+
#### Option 2: Adding the Theme as a Git submodule
176+
177+
Use this option if you want to pull in the theme files as a Git submodule from the main Bilberry Hugo theme repository.
178+
This option also makes it easy to keep the theme up to date in your site.
179+
180+
- In the `my-new-blog/config.toml` file, uncomment the `theme` property for **Options 2 and 3**, and
181+
comment out the `theme` property for **Option 1**:
182+
183+
```toml
184+
# Option 1 (recommended): adding the theme as a hugo module
185+
# theme = "github.com/Lednerb/bilberry-hugo-theme/v4"
186+
187+
# Options 2 and 3: cloning/copying the theme files
188+
theme = "bilberry-hugo-theme/v4"
189+
```
190+
191+
- Add the Bilberry Hugo theme as a Git submodule from the site's root:
192+
193+
```shell
194+
$ git submodule add https://github.com/Lednerb/bilberry-hugo-theme.git themes/bilberry-hugo-theme
195+
```
196+
197+
#### Option 3: Copying the Theme Files
165198

166199
Use this option if you want to directly customize and maintain your own copy of the theme.
167200

168-
- In the `my-new-blog/config.toml` file, uncomment the `theme` property for **Option 2**, and
201+
- In the `my-new-blog/config.toml` file, uncomment the `theme` property for **Options 2 and 3**, and
169202
comment out the `theme` property for **Option 1**:
170203

171204
```toml
172205
# Option 1 (recommended): adding the theme as a hugo module
173-
# theme = "github.com/Lednerb/bilberry-hugo-theme/v3"
206+
# theme = "github.com/Lednerb/bilberry-hugo-theme/v4"
174207

175-
# Option 2: cloning/copying the theme files
176-
theme = "bilberry-hugo-theme"
208+
# Options 2 and 3: cloning/copying the theme files
209+
theme = "bilberry-hugo-theme/v4"
177210
```
178211

179212
- Copy cloned (or unzipped) theme files in previous step to the `my-new-blog/themes` directory:
@@ -187,7 +220,7 @@ Renaming this folder will break your site.
187220

188221
### Configuration
189222

190-
To customize website according to your needs, edit the `config.toml` file in the site's root
223+
To customize your website according to your needs, edit the `config.toml` file in the site's root
191224
directory by adjusting the settings. All parameters that need to be configured are commented out or
192225
disabled.
193226

@@ -285,9 +318,9 @@ To enable and configure search functionality for your site, follow these steps:
285318
4. Switch over to `API Keys` and copy your `Application ID`, `Search-Only API Key` and chosen `Index name` to
286319
your `config.toml` file.
287320
5. Make sure that the `algolia_search` parameter is set to `true`.
288-
6. Follow instructions in the section [Update Algolia Index](#update-algolia-index) and proceed to the next step.
321+
6. Follow the instructions in the section [Update Algolia Index](#update-algolia-index) and proceed to the next step.
289322
7. To complete the initial setup, go to the tab `Configuration` of your newly created indices, select the `Facets` in
290-
the section `FILTERING AND FACETING` and add the `language` attribute with the `filter only` modifier in
323+
the section `FILTERING AND FACETING`, and add the `language` attribute with the `filter only` modifier in
291324
the `Attributes for faceting` option. If, after adding the `language` attribute, the `Unknown attribute` error is
292325
shown, ignore it.
293326

@@ -300,22 +333,22 @@ Execute the `hugo` command in the site's root directory to generate the `index.j
300333
##### Manual Upload
301334

302335
1. Head over to the `public/index.json` file and copy its content.
303-
2. Login to your Algolia account, open your index and click at `Add records manually`.
336+
2. Log in to your Algolia account, open your index, and click on `Add records manually`.
304337
3. Paste the copied text from the `index.json` file.
305338
4. Verify in the `Browse` tab of your index that the index records were uploaded correctly.
306339
5. In case you have a multi-language setup, make sure that you repeat the steps above for all `public/{LANG}/index.json`
307340
files.
308341

309342
##### Automated Upload
310343

311-
1. Switch to the `algolia` directory and install required dependencies by executing the following command:
344+
1. Switch to the `algolia` directory and install the required dependencies by executing the following command:
312345

313346
```shell script
314347
cd algolia
315348
npm install
316349
```
317350

318-
2. Run the `data-upload.js` from from the `algolia` directory as follows:
351+
2. Run the `data-upload.js` from the `algolia` directory as follows:
319352

320353
```shell script
321354
npm run data-upload -- -f ../public/index.json -a <algolia-app-id> -k <algolia-admin-api-key> -n <algolia-index-name>
@@ -325,7 +358,7 @@ Execute the `hugo` command in the site's root directory to generate the `index.j
325358
delete indices, and it should be kept secret.
326359
4. Add the `-c` or `--clear-index` option if you want to clear the corresponding Algolia index before starting a new
327360
upload.
328-
5. Login to your Algolia account and verify in the `Browse` tab of your index that the index records were uploaded
361+
5. Log in to your Algolia account and verify in the `Browse` tab of your index that the index records were uploaded
329362
correctly.
330363
6. In case you have a multi-language setup, make sure that you repeat the steps above for all `public/{LANG}/index.json`
331364
files.
@@ -338,7 +371,7 @@ Actions.
338371

339372
### Keyboard Shortcuts
340373

341-
Type `s` to open the navigation bar and set focus to the search input field.
374+
Type `s` to open the navigation bar and set the focus to the search input field.
342375
To remove focus, press the `Esc` key.
343376

344377
### Reposted Article/Duplicated Content
@@ -354,7 +387,7 @@ original_url: "https://example.org/path/to/content"
354387
### Estimated Reading Time
355388

356389
To show an article's estimated reading time, set the `showReadingTime` parameter to `true` in the `config.toml` file.
357-
You can override the estimated reading time by setting article's `readingTime` front matter variable to a value you
390+
You can override the estimated reading time by setting the article's `readingTime` front matter variable to a value you
358391
want. If you set this variable to `0`, the reading time will not be shown.
359392

360393
```
@@ -466,8 +499,10 @@ gallery: [
466499

467500
### Image Modal Zoom
468501

469-
When you include an image that is larger than the content area, the image becomes interactive and a larger version can
470-
be opened in a lightbox.
502+
When you include an image larger than the content area, the image becomes interactive, and a larger version can be
503+
opened in a lightbox. Modal zoom will work only for images that are added using the standard markdown
504+
annotation, e.g., `![Image alt text](/my_image.png)` or `![Image alt text](/my_image.png "Image figure caption")` for
505+
images with a figure caption. Please note that this feature will not work for images added using raw HTML.
471506

472507
### Featured Image
473508

@@ -523,7 +558,7 @@ mp4video: "<video-file-url>" # location of video file (only mp4)
523558
mp4videoImage: "<image-video-file-url>" # location of poster image
524559
```
525560

526-
For example, if an `MP4` video and its image are stored in the `static` folder, you can set corresponding front matter
561+
For example, if an `MP4` video and its image are stored in the `static` folder, you can set the corresponding front matter
527562
variables as follows:
528563

529564
```markdown
@@ -752,7 +787,7 @@ the `/archive/` value and completely remove the `target` variable.
752787

753788
### Responsive Design
754789

755-
Bilberry theme is optimized to look good on all devices, namely desktops, tablets, and smartphones.
790+
Bilberry theme is optimized to look good on all devices, namely desktops, tablets and smartphones.
756791

757792
### MathJAX Markup
758793

@@ -770,15 +805,12 @@ your browser.
770805

771806
### Trimmed JavaScript Size
772807

773-
By default, this theme's JavaScript bundle contains the [highlight.js](https://highlightjs.org/) and [Moment.js](https://momentjs.com/) libraries, which are pretty large, though they add real value.
808+
By default, this theme's JavaScript bundle contains the [Moment.js](https://momentjs.com/) library, which is large
809+
enough, though they add real value.
774810

775-
Therefore, to reduce the size of the downloaded JavaScript bundle, you can choose whether these features should remain enabled (which is currently the default) via two configuration parameters
776-
777-
```toml
778-
[params]
779-
enableHighlightJs = true # false would save ~127KiB gzipped
780-
enableMomentJs = true # false would save ~262KiB gzipped
781-
```
811+
Therefore, to reduce the size of the downloaded JavaScript bundle, you can choose whether using the Moment.js library
812+
remains enabled (currently the default) via the `enableMomentJs` configuration parameter. Setting it to `false` would
813+
reduce the bundle size by ~262 kB gzipped.
782814

783815
### Raw HTML
784816

@@ -871,23 +903,49 @@ You can customize your posts as follows:
871903
copy the original content type file to your site's `layouts/partials/content-type/` directory and edit it there.
872904
Otherwise, your changes will be overwritten when you update the theme to the latest version.
873905

906+
### Syntax Highlighting
907+
908+
Syntax highlighting for code blocks in your posts is implemented using Hugo's
909+
built-in [Chrome](https://github.com/alecthomas/chroma) code highlighter. Highlighting for code blocks in your posts can
910+
be customized at the site level or per code block.
911+
912+
To change the default configuration at the site level, adjust the properties in the `[markup.highlight]` section of
913+
the `config.toml` file. For example, you can change the default `monokai` style to the one from
914+
the [Chroma Style Gallery](https://xyproto.github.io/splash/docs/all.html).
915+
916+
Per the code block, the following parameters can be
917+
personalized: `linenos`, `hl_lines`, `linenostart`, `anchorlinenos`, `lineanchors`, and `hl_inline`, for example:
918+
919+
\```java {linenos=inline, hl_lines="7-12 21-26"}
920+
921+
// ... code
922+
923+
\```
924+
925+
Read Hugo's [documentation](https://gohugo.io/content-management/syntax-highlighting/) for more details.
926+
874927
### Colors and Fonts
875928

876-
Bilberry uses SCSS for styling and NPM with [Laravel Mix](https://laravel-mix.com/) for dependency management.
929+
Styling is implemented using SCSS along with [npm](https://www.npmjs.com/), which is only used for dependency management. Colors and fonts can be customized via variables defined in
930+
the [`assets/sass/theme.scss`](v4/assets/sass/theme.scss) file.
931+
932+
For example, if you want to customize the `$base-color` variable, you should define the `baseColor` parameter in your
933+
site's `config.toml` file.
877934
878-
To change any colors or fonts, you have to follow these steps:
935+
```sass
936+
$base-color: {{ .Param "baseColor" | default "#1d1f38" }};
937+
```
879938
880-
1. In your site's `themes/bilberry-hugo-theme` directory, execute `npm install`.
881-
2. Modify the `assets/sass/_variables.scss` file to customize your colors.
882-
If you want to change the header's color, only edit the `$base-color` variable.
883-
3. Use `npm run dev` for development and preview purposes and `npm run production` when you're done with the changes.
939+
```toml
940+
[params]
941+
baseColor = "#ff8080"
942+
```
884943
885944
### CSS and JS modules
886945
887-
This theme supports hot-swappable CSS and JavaScript extensions.
888-
Modules can be specified using the `(css|js)_modules` list parameter.
889-
Modules can be specified either relative to the `static` directory (e.g., `exampleSite/static/css/custom.css`) or as a
890-
URL.
946+
This theme supports hot-swappable CSS and JavaScript extensions, which can be specified using the `css_modules`
947+
and `js_modules` list parameters in your site's `config.toml` file. Modules can be specified either relative to the `static`
948+
directory (e.g., `exampleSite/static/css/custom.css`) or as a URL.
891949

892950
Modules are imported in the order they appear in the list, and immediately after the default Bilberry CSS and JS files
893951
are imported.
@@ -929,7 +987,7 @@ js_modules = ["..", "//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cooki
929987
930988
## Translations
931989
932-
Bilberry theme has built-in support for multi-language sites, and currently supports translations for more than 20
990+
Bilberry theme has built-in support for multi-language sites and currently supports translations for more than 20
933991
languages.
934992
935993
Feel free to submit a request for a new language translation or improve existing ones!

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/Lednerb/bilberry-hugo-theme/v3
1+
module github.com/Lednerb/bilberry-hugo-theme/v4
22

3-
go 1.18
3+
go 1.19

0 commit comments

Comments
 (0)