HUGO

[SOLVED] Using .md and .html files in masonry on homepage

I’m using theme Creative Portfolio Theme which features this beautiful masonry layout on the home page.

I’ve been able to easily feed .md files into the home page and have them display without issue, but now I’m trying to display .html files (converting to .md loses some of the features so I’d like to keep it as .html). I’ve added the necessary yaml header at the top of the .html files and all the files are right where they should be but they’re still not appearing on the home page.

Is this an issue with the theme, hugo, or the masonry used in the theme?

Any suggestions would be much appreciated!

I am the creator of Creative Portfolio Theme

I think what you need are Hugo’s Short codes. They are designed exactly to overcome such limitations of markdown. You can think of them as embeddable html components inside a markdown.

Take a look at this page to know more about them https://gohugo.io/extras/shortcodes/

1 Like

Thank you for pointing me in the right direction! I’ll look into it and post here when I find something that works. :slightly_smiling:

Once done do send me a pull request for the short codes you create :slightly_smiling: Im sure it will be useful for several others who are using and are going to use the theme :slightly_smiling:

Ok, so I’ve done lots of playing around with the theme and it turns out that the home page does indeed work with both .md and .html files from the beginning.

My issue is that I still had “draft : true” so the posts weren’t showing up :smile: oops! Oh well, at least it was an easy fix.

However, I did make a change on my page so that the home page displays the most recent 8 “posts” (including blog posts and portfolio pieces). I’m not sure if that will be a general-use case or more specified for my needs, but let me know if you’d like me to send a pull request.