One of my favorite things about developing sites with Hugo is that, with each new site I create, I learn something new. Sometimes, more than one thing.
Hugo’s Secret Parameters Okay, maybe these aren’t really secret parameters, but the documentation is often difficult to find if I don’t know what the parameters are called, or the documentation is only in the corresponding theme file itself. Frequently, the parameters are not documented at all.
I have embraced Hugo’s Page Bundles ever since I first learned about them. With a Page Bundle1, I can organize the files for a given post or page in a folder named for the post or page, making it much easier to manage the post’s or page’s resources, and to allow more flexibility with folder and file names. Page Bundles are a great way to organize content, especially for sites that include a lot of posts, pages, and associated files.
Unless the theme or the user has configured it otherwise, by default, Hugo will use the section with the most posts to determine the list of posts to display on the home page.
Setting the Source You can use the following parameter in the “params” section of a Hugo site config.toml to specifiy the source of the list of posts on the home page:
[params] mainSections = ['articles'] Simply replace “articles” with the section to use for the home page posts list.
The Problem In WordPress 5.8, Gutenberg blocks were introduced to the Widgets Page. If you’ve found this post, chances are you’ve noticed that setting the alignment of a widget Gutenberg Image Block to “align right” in order to float it to the right of the Gutenberg Latest Posts Block doesn’t work as you’d expect.
The Gutenberg Latest Posts Block includes a lot of nice features, one of which allows the inclusion of a post’s featured image in the list.
In an earlier post, I described a method of including an automatically updated age in a WordPress post using a shortcode.
In this post, I’ll show you another shortcode based on PHP’s DateTime extension and the diff method that will generate a string composed of the number of years, months, and days from a specified date.
The Code To include an automatically updating string composed of the years, months, and days from a specified date in WordPress using PHP, start by adding the following code to your child theme’s functions.
Lost Lake/Mt. Hood photo by Schick at Morguefile.com.