Pelican is a static site generation blogging tool created by Python.
I think the best thing about Pelican is that it's implemented in 100% pure Python, but it's great that it's carefully crafted so that you can create content without stress. The name is also good. By the way, it is an anagram of "calepin" which means "notebook" in French.
Here, we will introduce the procedure from installing Pelican to quick start along the official website.
Python 2.7.x is recommended for Pelican to work. It seems to work with Python 3.2 or higher, but let's be quiet and use the 2.7 series. In addition, the contents described here are all records when built on Mac OX 10.8.
Like many other Python tools, Pelican is recommended for use in virtual environments built with virtualenv. How to set up a development environment using virtualenv is explained in various places, so here we will assume that virtualenv (and virtualenvwrapper) can be used.
virtualenv Build a virtual environment pelican.
--_ If you want to specify the Python version, specify it with the --python = option _
$ mkvirtualenv pelican
Create a pelican directory for the pelican virtual environment under the user's home directory.
$ mkdir ~/pelican
Set the directory created above as the project directory for the virtualenv virtual environment.
$ cd ~/pelican
$ setvirtualenvproject
If you have a virtualenv environment, pip is already installed, so use pip to install it.
$ pip install pelican
If you want to blog with Markdown, you also need to have Markdown installed.
$ pip install Markdown
When installing Pelican, if the installation of the dependent module pytz fails, it seems that you need to install pytz separately below.
$ pip install --pre pytz
pytz requirement installation unsuccessful
This completes the Pelican installation.
Once you have successfully installed Pelican, you can use the pelican-quickstart
command to create a skeleton for your site.
$ pelican-quickstart
After this, you will be asked a few questions, and the answers will determine a simple setup for your site. However, all the settings decided here can be freely changed later, so you can decide it quickly.
> What will be the title of this web site? A Blog Written in Pelican
> Who will be the author of this web site? 5t111111
> What will be the default language of this web site? [en] ja
> Do you want to specify a URL prefix? e.g., http://example.com (Y/n) Y
> What is your URL prefix? (see above example; no trailing slash) http://pelicanblog.jp
> Do you want to enable article pagination? (Y/n) Y
> How many articles per page do you want? [10] 10
> Do you want to generate a Makefile to easily manage your website? (Y/n) Y
> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) Y
> Do you want to upload your website using FTP? (y/N) N
> Do you want to upload your website using SSH? (y/N) N
> Do you want to upload your website using Dropbox? (y/N) N
> Do you want to upload your website using S3? (y/N) N
After answering all the questions, a website skeleton will be generated.
First, let's create the first article. I'm writing an article in Markdown, so I'll give an example in Markdown here as well.
The article creates a draft file under the content directory. As an example, let's create a file called my-first-post.md. Edit content / my-first-post.md with your favorite editor.
Title:First Pelican blog
Date: 2013-09-17 22:58
Category: Pelican
Tags: pelican, python
Slug: my-first-post
Author: 5t111111
Summary:A summary of this article.
Hello Pelican
================================
Pelican
--------------------------------
###Penguins
This is the first article using Pelican.
After creating the file, let's use Makefile to generate an HTML file.
$ make html
HTML is generated under output. Next, let's start a simpleHTTP server to check the article.
$ make serve
After the server starts, try connecting to http: // localhost: 8000
in your web browser.
If all goes well, you should see the blog you created.
That's the first step in building a blog on Pelican.
Recommended Posts