A CMS Wot Kevin Wrote

or the trials of recording structured content in a home-made CMS.

I'm sure there are a number of content management systems available that support the HTML5 article-section structure better than mine ever will. But that's no reason not to try for myself.

I already record fields for my articles that include:

  • Title
  • Summary
  • Micro Title
  • Article Content
  • Publish Date
  • Published Status

I write the Article Content in Markdown. The Micro Title populates a Tweet box - along with a perma-shortlink and my Twitter handle - when someone uses the embedded button.

The site is all marked-up with Microformats2 and specific components are highlighted with ARIA Roles.

So, I'm making the assumption that I'm off to a reasonably good start.

But what about these?

Yes, what about sections? How do I delineate a portion of my article that is topically different from other parts. How do I use the correct semantic HTML in my CMS?

Well, I could add the tags into the Markdown field. Markdown can process existing HTML tags correctly, so I could add <section> at the beginning of each section and add </section> at the end. That should work. And the same goes for the <header> tags in each section, and the <footer>, and dates and, and...

Yeah, that's not gonna work.

Separating content from markup

One of the most important elements of any website, that has more than one page, is the separation of the content (the words and images) from the code, style elements and other bits and pieces of a website.

For a CMS, this means that I need to 'see' my content in one way, while the CMS 'sees' it another way. And I need to see it in sections.

My plan is to provide input fields for adding sections to an article. Initially, sections will include:

  • Header
  • Heading
  • Section Content
  • Footer

These should cover the majority of my own use cases. I've planned how the interface would work and can already see how to record the various bits of content.

Now I just have to build it.