How to create a single post template for multiple posts on a webpage?

I’m using an API to fetch the data and I want to create a single post template for each post on the website, is there a way I can do it without using cms? BTW the post content and all the data is fetched from the API.

The API I’m using: link

I am a newbie and I know the basics of HTML, CSS, JavaScript, and a little bit of PHP.

I’m looking for a solution similar to the template inheritance feature in the flask

is there any way to achieve this task with just coding (using JS/PHP) and not using cms? if not then I’ll use WordPress

You can use Handlebars to create templates,
or, if you know a “front end” library (React/Vue/Angular/Svelte/Elm…), you can leverage components composition.
For example take a look at NextJs, a React framework.

Or you can use a static site generator like Hugo or Eleventy.

Plenty of choices :sparkles:

1 Like