pratik
pratik

@help If I create a new page on Micro.blog, what template does it use in the theme files? How can I get it to use a different template other than the default one?

|
Embed
Progress spinner
jsonbecker
jsonbecker

@pratik micro.blog doesn't really use pages, everything by default is a post. If you want a custom template, I recommend doing layouts/$custompagename/single.html for your template, and then create content/$custompagename.md for your content in your theme, putting the type: field in the front matter set to custompagename

|
Embed
Progress spinner
pratik
pratik

@jsonbecker Wait, what? I understood some of those words. Also, how will it fit with my existing blog's design if I'm adding a new single.html?

|
Embed
Progress spinner
jsonbecker
jsonbecker

@pratik single.html should just be building the main block of your baseof template.

|
Embed
Progress spinner
pratik
pratik

@jsonbecker So the $custompagename.md will use the design specified in the single.html within the /custompagename subfolder? Basically, I want to create a custom page to show posts only from a couple of categories. Would I need to copy the HTML file from /layouts and then add the custom code?

|
Embed
Progress spinner
jsonbecker
jsonbecker

@pratik you’ll take your layout for either index or your li.html (if you want to copy archive style) and copy it to layouts/custompagename/single.html. Then adjust code to filter for categories. Then add a new page to your theme called content/custompagename.md (content at top not layout). The whole content of that md file is just yaml front matter setting title and the type, where the type matches the custompagename. That says to render the md file with the single template for the matching type.

|
Embed
Progress spinner
pratik
pratik

@jsonbecker Thanks. That makes sense.

|
Embed
Progress spinner
JohnPhilpin
JohnPhilpin

thanks for the heads up on this thread @pratik

|
Embed
Progress spinner