Reputation: 31
I'm very new to the web-dev world and I'm going to be working with headless cms soon. So, I'm looking for some guidance in this field.
How does one begin with headless cms and Where do I keep my front-end code of the website?
If there are anymore things that I should know before I get into this field, please let me know.
Thanks !
Upvotes: 1
Views: 1208
Reputation: 3889
The idea of a headless CMS is that all things you consider "content" go into it. This can go from the text, images, categories, ... – it dependes on your project.
A headless CMS usually stores the data in a format that is consumable on different platforms and programming languages. Most of the headless CMSes return JSON because it works everywhere.
To answer the question, where your frontend code should live, the answer is "probably not in your CMS". Where you put the code is up to you (GitHub, your local computer, ...), though. Whenever you put source code into a headless CMS you may be on the wrong path because you're losing the ability to reuse content. E.g., whenever you put HTML in your content you lose the ability to port the same content to a platform not being based on HTML (that's why markdown is so popular).
That is the biggest difference to traditional CMS systems: a headless CMS should help you manage content and not code. It's the developer's responsibility to build great projects on top of framework/language-agnostic content.
How do people work with it? People usually have the code of their sites on GitHub and then to fetch the content when it's needed (this can be done in a build process for static sites or dynamically fetched on every request in a server or single-page environment).
This separation of code and content has the benefit that developers don't have to worry about a system for content management. Developers want to go with [enter fancy framework]? Go for it! Choose your technology and pull in the data from the CMS via HTTP.
Headless CMSes offer you a lot of flexibility in terms of content distribution and technology choices, they do come with the burden though that you have to build the systems consuming the content yourself. :) Hope that helps. :)
Upvotes: 2