git clone https://github.com/Lednerb/bilberry-hugo-theme.git
If you don’t use git, you can download and extract this theme manually into the themes folder.
Please ensure that the folder is renamed to “bilberry-hugo-theme”
Copy example content and default config file for a quick start
cp -r bilberry-hugo-theme/exampleSite/* ../
Test and configure your site
hugo server -D
Do NOT change the name of the theme folder.
If you rename the folder the different post types will not work.
To configure your site according to your needs, just open the config.toml file in your project folder and adjust the settings.
All options you can and should customize are commented so it should be no problem for you to get it done.
Bilberry includes a convenient search functionality for your site.
You can test it on the demo site.
Just click on the navigation bar at the top right of the header.
If you do not want to use the search functionality set algolia_search = false in your config.toml file.
If you want to include the algolia search for your site, you have to follow these steps:
Add a New Application. You can choose the COMMUNITY plan.
Switch over to Indices and create a new one.
Switch over to API Keys and copy your Application ID, Search-Only API Key and chosen Index name to your config.toml file.
Ensure that algolia_search = true is set.
Update the search index
You have to repeat this step every time you change a post or publish a new one to update the search index.
Publish your changes via the hugo command.
Head over to http://your-site.com/index.json and copy everything in there
Login to your algolia account, open your index and click at Add records manually
Paste the copied text from the index.json file.
If you want to start a search on your blog simply type s and the search menu will open.
To close it again you can enter esc at any time.
Bilberry comes with a bunch of predefined post types.
Available post types are article, audio, code, gallery, link, page, quote and video.
To use a post type, just create new content via the hugo command.
hugo new quote/edward-snowden-about-privacy.md
article is the default post type if you want to use another type of content as the predefined.
Just discover the entries from the exampleSite folder to get an overview of the great possibilities Bilberry provides ;-)
Pages and External Links
The post type page is the only one that appears in the top navigation (when you click on the navigation button on the top right).
A page can be a static page (about me or impress site) or a link to another page as it is used in the demo to link to the Bilberry GitHub repository.
The post type link always links to an external site and can be used with or without a background image.
Manual Summary Breaks
You can influence the summary outpot on the listing pages (such as the home page or the category or tag pages) in three ways:
You don’t set a manual summary break.
Hugo will care for you and generates a summary as well as a Continue reading link.
You set a manual break via
Just write your content and if you want to break use the code snippet to tell Hugo to break here.
You want to display the full article without a Continue reading link
In this case, set the option noSummary: true in the header area (Front Matter) of your .md file.
If you want to enable the functionality for your users to write comments below your articles, you can register for a free Disqus account.
Just create a new site and copy your site’s short name to the config.toml file at disqusShortname.
You can manage and moderate the comments either on your website or at the disqus management panel.
Bilberry is optimized for desktop and mobile devices (tablets and smartphones).
Permanent Top Navigation
If you want to permanently display the top navigation with the algolia search bar and the page entries, you can set the permanentTopNav option to true in your site’s config file.
Note that on mobile devices the navigation will still be collapsed because otherwise, the navigation menu hides the essential parts of your site.
If you want to add MathJAX markup support, set parameter enable_mathjax option to true in your site’s config file.
Custom Post Types
If you want to add a custom post type to change the icon in the bubble on the left column you can simply create those as you wish.
If you want to create a book post type, for example, you can do the following:
Copy the default themes/bilberry-hugo-theme/layouts/partials/content-type/article.html to your site’s layouts/partials/content-type/ folder.
Rename the file to your custom post type. A proper name in the book scenario would be book.html
Customize the file. You can change the icon in the bubble with another Font Awesome Icon. In the book scenario we would change the fa-pencil class to fa-book:
<i class="fa fa-fw fa-book"></i>
Create your new posts with the post type prefix: hugo new book/a-very-cool-book.md
If you want to use custom Front Matter variables, create a book.md archetype in your archetypes/ directory.
You can find further information in the official HUGO docs.
If you want to change the default post types (e.g., don’t use the pencil icon on the article or default type, but another one) copy the original file to your local layouts/partials/content-type/ directory and edit it there.
Otherwise, your changes would be overwritten when you update to the latest theme version.
Custom colors and fonts
Bilberry uses SCSS for styling and a Webpack-based workflow to dynamically create the combined and compresses production-ready stylesheets.
If you want to change any colors or fonts, you have follow these steps:
Run yarn install to install all necessary dependencies
Modify the scss/_variables.scss file to customize your colors. If you want to change the header’s color just edit the $base-color variable
After finishing your changes, run yarn run production to produce your customized stylesheets
If you ’re going to change the default fonts (e.g., lack of support for Cyrillic languages), you can use some of the Google Fonts.
Select your favorite fonts and copy the @import url('...'); directive to the src/css/fonts.css file.
Now you have to modify the scss/_variables.scss and set the $headline-font and $content-font to the selected ones.
Follow the steps 1-7 to implement your custom font to your site.
Note: You don’t have to upload the node_modules folder to your webspace, this is only created and needed to generate your customized stylesheets.
CSS and JS modules
Modules are imported in the order they appear in the list, and immediately after the default Bilberry CSS and JS files are imported.
A big thank you goes to @Ipstenu for his help in this thread that helped me to create the index.json for the algolia export.
The Bilberry Theme for HUGO is licensed under the MIT license.
Support Me and This Theme
If you enjoy this theme (and especially if you make money with your blog) and want to use it for your site, please consider a small or generous monthly support towards me so I can keep up supporting and maintaining this theme in the future.
You don’t want to use Patreon?
Just write me a short mail and we’ll find a solution: email@example.com