Create a blazing fast website in 5 minutes with Pelican Static Site Generator

Create a blazing fast website in 5 minutes with Pelican Static Site Generator powered by Python

Pelican Static Site Generator 1

Python For Web Development:

Python is a High-level programming language first released in 1991. Python used for Web development, Software development, Big data, VFX Scripting and many more. Python became more popular because of its simplicity and its easy to learn. Syntaxes in python are easy to remember than any other programming language.

Python used for server-side web applications, connecting web apps to the database system. Popular websites such as Youtube, Dropbox, Instagram, Spotify are built using Python. Browser automation, Machine learning, Data analysis, Internet of things (IoT) made easy with Python.

There are many open-source frameworks available for python such as Django, CherryPy, Pyramid, etc… These frameworks have been used by sites such as Youtube, Instagram as mentioned above.

Static Site generators:

Static Site Generators is a website generator that generates the website in HTML, CSS, and JS. You can do miracles with Static Site Generators. With the help of a Static Site Generator, you can create an eCommerce website, Blog, Business Website, Lanching page or whatever you need.

Static Sites are not like dynamic websites. Static sites don’t require any server-side configuration or a database. Static Sites loads 2x faster than dynamic websites. The best thing of static sites are it can be deployed in any web server and it doesn’t require any extra setup.

Static Sites can be deployed in Github pages, Gitlab, and any other cloud hosting for high scale and low cost. You can connect the static sites to Headless CMS or Static Site CMS to manage your website content real-time without coding.

Pelican Static Site Generator:

Pelican Static Site Generator 2

Pelican is a Static Site Generator provided by Python. With Pelican you can create a Static site. Pelican has a huge library of themes and plugins to get started with. Pelican static site generator also provides plenty of plugins to extend your site functionality.

Pelican Static Site generator is Seo friendly, Responsive and it’s easy to create a website with Pelican. You can integrate Pelican static site generator with a Headless Cms or a Static Site CMS. You can write content in reStructuredText or Markdown.

Features of Pelican Static Site Generator:

  • Pelican library has a number of themes and plugins.
  • Easy migration from existing content from WordPress, Blogger, and other services.
  • Easy to Integrate with Google Analytics, Disqus comment system.
  • Supports multiple languages.
  • Easy to generate RSS feed and Atom.
  • Syntax highlighting via Pygments.

Getting Started with Pelican Static Site Generator:

Pelican makes use of Python and you have to install Python 3 from the official website of python. Python 3 is recommended for better output. Pelican can be installed via several methods but we are discussing the simplest method to install Pelican Static Site Generator using PIP.

Before installing Pelican, you have to set up a virtual environment for Pelican via virtualenv. The following commands help you to create a virtual environment for Pelican.

virtualenv ~/virtualenvs/pelican
cd ~/virtualenvs/pelican
source bin/activate

To install Pelican in Python 3 use the following command.

pip install pelican

With the help of this cmd, you’ll be able to create a Pelican Static Site Generator in your Pc. To install packages such as Markdown and Typographical enhancements use the following cmd.

pip install Markdown
pip install typogrify

Now you are ready to create Static Site with Pelican. Make a directory for your project and move to project directory by following commands.

mkdir -p ~/projects/Project_Name
cd ~/projects/Project_Name

To create a project structure for your website use the following. With quickstart command, Pelican creates a project structure.

pelican-quickstart

And the project structure looks like this.

Project_Name/
├── content
│   └── (pages)
├── output
├── tasks.py
├── Makefile
├── pelicanconf.py       # Main settings file
└── publishconf.py       # Settings to use when ready to publish

The website cannot be generated unless you publish content on your website. You can generate and publish articles with the following format.

Title: First Pelican Project
Date: 2019-06-05 2:02
Category: Pelican

This is example formate for creating your first article on Pelican.

After publishing your content you can preview using the following command.

pelican --listen

To generate Static website use the following command. The output files are generated inside the output folder.

pelican content

For more information and deployment here is the link for docs.

Pelican Static Site Generators has plenty of themes and plugins to get started with. Themes and plugins make your work easy. You can even make a beautiful theme from scratch or use an existing one. Access Pelican themes here and plugins here.

Wrapping up:

Pelican Static Site Generator is one of the best static site generator. It is Seo friendly, blazing fast, and responsive. You can create a website and deploy easily with no time. With this tutorial, you can create a blazing fast static site generator in 5 mins.

Leave a Reply