Create a blazing fast website in 5 minutes with Pelican Static Site Generator powered by Python
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.
Static Site generators:
Pelican Static Site Generator:
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.
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.
To generate Static website use the following command. The output files are generated inside the output folder.
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.
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.