Skip to content

Creating Content

Anas Ismail Khan edited this page Aug 5, 2016 · 7 revisions

Posts

Any file that is present in "content/posts" is considered a single, independent post. And all content within the file, except for the metadata(if any), is going to be displayed in the post body. Danvers supports posts created using HTML, Markdown and Textile.

Obviously, the file extension is very important here.

  • HTML files must end in .html or .HTML
  • Textile files must end in .textile or .TEXTILE
  • Markdown files must end in .md or .MD or .markdown or .MARKDOWN

All posts need to be named according to this convention:

YYYY-MM-DD.Post Title.MARKUP

So naturally, a post about your pet beagle that you created on 29th February 2016, using markdown, would be named:

2016-02-29.Moi Awesome Beagle.md

All posts would be automatically listed in the blog feed, and any post is individually accessible as a page at example.com/?post=post-title So in my demo, a post titled "First post" is accessible at http://anasismail.com/others/Danvers/?post=First%20post

Post metadata

There'd always be cases when people would want to post twice on the same day and give both posts the same title. I understand that this doesn't make any sense, but there should still be a way to get around this. Right? And what about the author and category archives I promised?

That's exactly where the metadata comes in. The XML frontmatter, enclosed in the Danvers tags; @_#_metadata_#_@ and #_@_metadata_@_# is where you can list your posts categories, the name of its author, and the title to be displayed. Obviously, if there's a title defined in the metadata, it's going to be displayed instead of the title in the filename. The permalinks however remain unchanged.

Take a look at this sample post.

See how all of contents between the opening metadata tag (@_#_metadata_#_@) and the closing tag (#_@_metadata_@_#) are not displayed on the site?

The title defined in the filename is "First post" while the title defined in the metadata is "First Damn Post," and that is what's shown on the blog. However, if you notice, the url still depends on the title in the filename, and this separation is what allows for custom permalinks.

Other than that, it's pretty clear that an <author> tag defines the author name, while all <categories> tags that are part of the <category> tag are all post categories.

A post may or may not have metadata tags, and in the event that it does, a user doesn't necessarily have to define all 3 things. It's perfectly okay to define an author but not define a custom title for example.

Pages

Any file that is present in "content/pages" is considered a single, independent page. And all content within the file, except for the metadata(if any), is going to be displayed in the page "container". Danvers supports pages created using HTML, Markdown and Textile.

Obviously, the file extension is very important here.

  • HTML files must end in .html or .HTML
  • Textile files must end in .textile or .TEXTILE
  • Markdown files must end in .md or .MD or .markdown or .MARKDOWN

All pages need to be named according to this convention:

Page Name.MARKUP

So a page named "About" that is created using textile would be named:

About.textile

The page would be accessible at example.com/?page=About

Danvers is about as case-sensitive as the operating system it is hosted on. It is safe to assume that in most cases page/post names would be case-sensitive

about.html is NOT the same as About.html and certainly not the same as about.HTML.

Clone this wiki locally