Python Pelican: How to view draft content on a website

Posted on Sun 17 April 2022 in Python

بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ

Pelican is a static site generator written in the Python programming language.

Pelican has a feature where draft content can be published to the internet.

Draft content should have the following attribute within the .md files (assuming content is written in Markdown):

Status: draft

After generating the content, the draft content should appear in:

../output/drafts/

In order to view the draft content on the internet, the exact filename will be required. In my example, I created a file called: who-are-the-successful-people.html. The draft can be viewed at:

https://www.kentoseth.com/drafts/who-are-the-successful-people.html

The generic way to view drafts would then be:

Site URL + /drafts/ + pagename.html

OR

Site URL/drafts/pagename.html

A Pelican plugin also exists that can enable a "browsable drafts listing for your Pelican website". This would make it possible to view all drafts under Site URL/drafts/. A useful option if you have many WIP (work-in-progress) articles.

The plugin can be found at: Pelican Drafts


If you don't know how to use RSS and want email updates on my new content, consider Joining my Newsletter

The original content of this blog is a Waqf solely for the Pleasure of Allah. You are hereby granted full permission to copy, download, distribute, publish and share this content without modification under condition that full attribution is given to this author by creating a link either above or below the content that links back to the original source of the content. For any questions or ambiguity, you are requested to contact me via email for clarification.