HTML5 Text Markup for Blog Tags and Categories

Many blogs use the concept of tags and categories to add metadata to a post. What is the best practice for semantic markup for this information, so that a machine reading a blog post can easily identify tags?

I am currently adding a "tag" to the rel attribute in the link, for example.

 <a rel="tag" class="tag" href="/tags.html#site-configuration">#site-configuration</a> 

I assume that for the keyword Dublin Core html you can use

 <meta name = "DC.Subject" content = "site-configuration"> 

and add this to the page title, or can meta tags get into the body? One or the other preferred or some other option?

Is there a better strategy in terms of providing accurate and standardized definitions for content?

Is HTML5 a smart choice if I want to be so picky about metadata, or should I use doctype XML?

What are the pros and cons of different approaches?

+9
xml html5 metadata
Oct 12
source share
1 answer

First step will use / use simple semantic law. In the case of (X) HTML5, you must create the appropriate outline using the section , article , aside and nav section content elements and use the header and footer to separate the metadata content from the main content; also think about line level semantics like time (publication date), dfn (definitions), abbr (abbreviations / abbreviations), etc. And use the meta - name and rel values ​​that are defined in the specification.

the second step would be to use metadata attribute values ​​that are not defined in the specification but are registered in certain places (therefore they are valid for use), for example, name keywords for meta elements and rel values ​​for a / area / link elements .

The third step is to increase the markup using semantic, machine-readable annotations. There are three general ways to do this :

  • Microformats (using predefined class and rel values)
  • RDFa (using attributes and URIs)
  • Microdata (using attributes and URIs)

RDFa and Microdata are similar (both extensible and rather complex), while microformats are simpler (but not so expressive / extensible). I wrote a short answer on programmers about the differences and a more detailed answer about the differences between Microdata and RDFa .

In the case of RDFa or Microdata, your main task is to find dictionaries / ontologies that can describe / classify your content. Such dictionaries can be created by everyone (you can even create them yourself), but it is often recommended to use well-known / popular ones, for example, so that search engines can use your annotations (a popular example: Schema.org ).

In the case of Microformats, you will need to find a Microformat (on the wiki on microformats.org ) that suits your needs. If there is none for your case, you can offer a new Microformat (but it will take some time until it is accepted if at all).




Is HTML5 a smart choice if I want to be so picky about metadata, or should I use an XML document?

You can also use XHTML5 if you need / need XML support. If you "use" only the HTML code (X) defined in the specification and no additional XML schemas / dictionaries, it does not matter from a semantic point of view if you use HTML (5) or XHTML (5).

+13
Oct 13 '12 at 1:30
source share



All Articles