Last modified: August 22, 2025
HubSpot blogs consist of blog listing pages and the individual blog posts. In addition to listing the individual blog posts, the blog listing template is also used for rendering the author and tag listing pages. You can either create a single template to render all listing and blog post pages, or you can create two separate templates.
Below, learn about blog template markup, template components, and customization options.
Create a shared template for the listing and post pages
To create one template that renders the listing and post pages, add thetemplateType: blog
annotation to the top of your template file. When using one template to render both, you’ll use an if statement that evaluates whether the user is looking at a listing page or an individual post. If you are using the drag and drop design manager layouts, this if
statement is built into the UI of blog content module buttons.
By using the if is_listing_view
statement, you can write your post and listing code separately.
Create separate listing and post templates
Alternatively, you can choose to have separate templates for blog post and listing pages which can help make your code cleaner and easier to read as a developer, while making the templates easier to select for content creators. Rather than using thetemplateType: blog
annotation at the top of the one template, include the following annotations at the top of your two templates:
- Blog post template:
templateType: blog_post
- Blog listing template:
templateType: blog_listing

is_listing_view
check is not required. Instead, you’ll manually select separate templates within the account’s blog settings.
Listing page templates
ThetemplateType: blog_listing
annotation makes the template available for selection under blog settings specifically for the listing view. With this template type, content creators can also edit the listing page within the page editor. By also including drag and drop areas in the template, modules can be added and removed in the page editor like they can for other CMS pages. Check out the CMS boilerplate blog templates to see examples of including drag and drop areas.
The listing of posts is generated by a for loop that iterates through your blog posts. contents
is a predefined sequence of content that contains all the posts contained in that blog.
It’s recommended to make all text strings on your blog listing template controlled by fields. This makes it easier to create multilingual blogs and gives content creators more control.
Create a blog listing module
To display a series of blog post previews, it’s recommended to use HubSpot’s default post_listing module, or build a for loop that iterates through blog posts. Below is an example implementation of the defaultpost_listing
module for a blog post template. Based on the included parameters, it would display the most recent posts from the default blog (up to 5) underneath a title of “Recent Posts”.

List tags on a blog post
To display a blog post’s tags on the post, you can use a for loop in the blog post template to render the tags when present. As an example, the code below does the following when added to a blog post template:- If the currently displaying post has blog tags, create a
<div>
to render additional content. - For each blog tag assigned to the current post, create a link to that tag’s listing page, where readers can view other posts with that tag. The link will use the tag’s name for display.
- After each tag, add a comma when there are additional tags to display.
tag_list
, in the HubL variables reference documentation.
Blog author, tag, and simple listing pages
In addition to the blog post and blog listing pages, HubSpot blogs also have pages for blog authors, blog post tags, and simple listing pages. These additional pages use the same template as the blog listing page to render their content.Because the listing page template is also shared by the blog author, tag, and simple listing page, updates published to the template will also apply to those pages.
if
statements to conditionally render content for each type of page.
If blog_author
Within the standard HubSpot blog listing markup, there is anif blog_author
statement. This statement evaluates as true when viewing an author’s page, which lists the posts published by the author. The boilerplate template includes the author’s name, bio, and social media accounts.
If tag
You can use anif tag
statement to only render code on a blog tag listing page, which visitors can see when clicking a blog tag on your site. The example below is a snippet that uses the page title variable to automatically print the tag name at the top of a tag listing page.
If not simple_list_page
There are two types of blog listing pages that can be rendered to display blog post listings: the regular listing page, and a simple listing page:- The regular listing iterates through the number of posts specified by the post listing blog setting and paginates accordingly.
- A simple listing is a listing of all your posts and does not support pagination. The simple listing is not affected by the post limit blog setting and generally just contains links to the most recent 200 blog posts. The address of your simple listing page is the URL for your blog with
/all
added to the end of the path.
if not simple_list_page
statement to determine what to render in a simple versus regular listing. A simplified version of this statement is shown below.
Note that the
if
statement uses reverse logic, which means that the else
defines the simple listing view. Optionally, you could use an unless statement instead.Listing pagination
Blog listing pages have auto-generated pagination. Your listing template can include logic to allow visitors to easily pages through your blog posts. HubSpot provides a default pagination module that you can use to accomplish this. You can find this module in the@hubspot
directory of the design manager. This module includes the following HubL and HTML:
Boilerplate markup
Below, view the boilerplate markup for the blog post and blog listing page templates. You can also view this markup in the CMS boilerplate on GitHub, as listed in each section.Post template markup
All blog posts in a blog are generated by a single blog template.Content
is a predefined object of data that contains information about the requested blog post. Boilerplate posts are rendered with the following markup: