Preview: keep your blog posts relevant and future-proof with smart tokens

keep your blog posts relevant and future-proof with smart tokens

Showcase of a cool feature we just introduced that allows you to insert tokens into certain areas of your post

Today I had the pleasure of pushing to our repository a small, cool feature that allows you to use smart tokens in certain places when creating a post.

Before going any further I will first try to explain the source of my inspiration for this new feature.


Lists are hot right now

Bloggers use them, Google seems to favor them

There is a shift in the way bloggers write content. We always try to adapt in order to please the search engines and this new trend seems to favor lists. A lot! It's natural if you think of it. People ask the search engines questions and it responds with "steps" to solve it.

These steps are taken from the articles normally by identifying headings (h1, h2, h3 etc) or lists (ul, ol). Whoever makes a better list wins (now you know why Qards has a table of contents placed on every page).

Lists are also counters

One of the ways to make your content unique is by inserting a counter that represents the items in your list, hence the myriad of articles that are titled like xxx tools to help you write where xxx stands for a counter.

This is also where I took inspiration from. Qards operates with widgets and everything has a name, type, configuration and order of placement. We know each section and we can count...stuff. This means that you can structure your content in such a way that would allow you to extract a counter out of it.


What tokens are available and how to use them

The list of supported tokens is currently small because I don't want to add useless things until I get feedback from the community. Qards supports the placing of such tokens in the following sections:

  • title
  • excerpt
  • section-headers (title, subtitle)

Available tokens

  • {cardsNum} - this represents the number of cards are in your post where a card is a section that contains multiple widgets (headers. paragraphs, images etc). By controlling the number of cards and how you section your content you can have a title (or any other supported section) that updates itself whenever you change your content.
  • {created_at:dateFormat} - this is the date when the post was created. The dateFormat section supports a string that allows you to control what parts of that date you want. for example: YYYY will print out just the year. Have a look at the format() method for moment which is the library we use.
  • {currentDate:dateFormat} - you probably guessed it, it uses the current date. This one is very useful when you wish to keep your articles relevant. Something like "Best tools of 2018" will become "Best tools of 2019" when the year changes, without your intervention. This might be quite handy especially when we're talking about a big list of articles under your management.

How to use these tokens

Dead simple...just paste them where you see fit
Article tokens

You have the list of places where tokens are inserted and you know the tokens. Just paste them where you see fit and our platform will do the rest. Since Qards is a static site don't expect to have a real-time date because your assets are compiled and uploaded to production but, with formats that target bigger time frames, you should be fine and ready to conquer ranks.

Romeo Mihalcea

Programmer for over 15 years. I'm a full stack developer and a UX freak. Author of Qards.