Élysson MR

My Personal Blog

Mon 14 December 2015

What is Pelican?

Posted by Élysson MR in Pelican   

Pelican is a static site generator, written in Python, that requires no database or server-side logic. Contents are written using reStructuredText, Markdown (requires additional libriries) or AsciiDoc formats.

Advantages of using pelican:

  • Generate static site running just one command to easy host anywhere (its output is just static files).
  • You can choose one of theme in theme collection, personalize it or create your own theme using Jinja templates.
  • Generated site can be published in many languages.
  • Generates atom/RSS feeds.
  • Developer blog? Use a code syntax highlight on your publications.
  • Migrations tools to import contents from WordPress, Dotclear, RSS Feed and some other services.
  • Many plugins to enchance site experience.

And many other things...

Installation

Pelican can be installed using pip. Just run:

pip install pelican markdown

Some plugins requires additional packages read their documentation to find out what should be installed too.

Starting a Pelican Site

First, create a directory for the project, remmember to choose a apropriate name:

mkdir -p ~/projects/pelican-powered-site
cd ~/projects/pelican-powered-site

To create project's skeleton run pelican's quickstart command:

pelican-quickstart

Some questions are going to ask to pre-configure the site.

Creating a Article

Before run pelican we need to ad some content to our site. Using one text editor wite this down:

Title: My First Review
Date: 2010-12-03 10:20
Category: Review

Following is a review of my favorite mechanical keyboard.

The example article is written in Markdown syntax. Save the file in:

~/projects/pelican-powered-site/content/keyboard-review.md

Generating and running the site

From the site's directory run this command to generate our site:

pelican content

After the command end all site files has been generated inside "output" folder. To preview it execute:

cd ~/projects/pelican-powered-site/output
python -m pelican.server

That's all Folks!! Now we got a static site generated with one simple article.

For more information read pelican's documentation and check its community tutorials. This article content is based in pelican's quickstart article.



 
    
 
 

Comments