The sensation of using the python jamstack static site generator
Did you know that Python has several static site generators that can be used for several of your projects, from websites, blogs, to your product and application documentation projects.
You can also use markdown to manage content, You should also try using rst reStructuredText file to manage the content to be unique.
Get Start with Python
If you want to use python static site generator, of course you need to download and install python on your device.
Download and Install Python Here
And we need to install PIP Vitrual Env to for your python project.
Once you have downloaded python, and installed PIP and VENV, you are ready to try and install python jamstack SSG on your device.
Well, let's review some recommendations for the Python Jamstack static site generator for your project.
Pelican
If you need a very complete site, and easy to customize, then using Pelican is the right choice for you, Pelican is very easy to use, apart from that, full speed and SEO support helps you get on the Google page.
How to install pelican - You can read documentation here
Windows Installation
We need to customize your project easily, so using markdown is the best choice, so let's install pelican markdown by run py -m pip install "pelican[markdown]"
Create a new virtual environment for Pelican, Run this command
virtualenv ~/virtualenvs/pelican
cd ~/virtualenvs/pelican
source bin/activate
for quick step activate vitrual env you can run venv\Scripts\activate
Now you can create new pelican project run pelican-quickstart
For setup your site you can open pelicanconf.py file.
Update and create new blog post article, you can access on content folder and create new markdown .md file , you can see the example content.
If you want to create a static page,you need to add configuration on your pelicanconf.py. and add this PAGE_PATHS = ['pages']
You can create a new folder name it with pages , next you can create new md markdown file inside the content/pages folder.
Now you can try your pelican project with run pelican content for build production ouput.
For run on dev mode you can run pelican --autoreload --listen and access localhost:8000
Once you have completed your project, you can build to production mode run pelican content - next you can upload or push your production build output folder project to your host.
We have develop pelican themes, so you can learn how to work with pelican python jamstack static site generator, Free Download Pelican Themes
MkDocs
If you want to built a documentation website project, so you can try mkdocs.
What is MkDocs ?? MkDocs is a fast, simple and downright gorgeous static site generator that's geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML configuration file.
Example site we build with MkDocs you can see here - MkDocs Project
Open terminal and run pip install mkdocs
Now create MkDocs Project , run mkdocs new my-website
Access your project with run cd/my-website , Next you can run mkdocs build && mkdocs serve open localhost:8000
What Next ?? Of course you need to setup your site, open the mkdocs.yml and update with your site title, description and others
Write content for static page or documentation page you can simply create new markdown or .md file inside docs folder
After update you need to build to production mode run mkdocs build next you can run dev mode with this command mkdocs serve and open localhost:8000 on your web browser.
For publish your mkdocs project, you can simply upload or push the output folder. - Don't forget to build production mkdocs build
Sphinx
Let we work with .rst files - try Sphinx an MkDocs Alternative.
What is Sphinx ?? Sphinx makes it easy to create intelligent and beautiful documentation.
If you know , many python docs project is build with furo - sphinx, what is furo ?? A clean customisable Sphinx documentation theme.
We have develop sphix website with custom furo themes you can see on Example Sphinx Website
How to install Sphinx ??
Activate your vitrual enviromant venv\Scripts\activate
Install Sphinx with run pip install -U sphinx or py -m pip install sphinx
Next create new sphinx project run sphinx-quickstart
Now access your sphinx project cd/my-sphinxweb
Let we make html for your project with run make html
For make your site project clean and beauty you can install furo on your sphinx project - run pip install furo
Now activate your furo themes and setup your site , access on conf.py and update with your title,description for SEO, and scroll on html_theme you can replace default themes to be html_theme = "furo"
Next for create new static page or post you can open the source folder, and you can create new .rst file or see the example content in source folder.
Once you have finished your project, you can run build production mode run sphinx-build -M html source/ build/
Upload and push your sphinx production mode output in to your host.
Nikola
If you want foucs on blog , so you can try nikola.
- Create virtual env run
py -m venv nikola-env - Press Ctrl+Z on keyboard
- Open your nikola-env run
cd nikola-env - Install Setup Tools with run
Scripts\python -m pip install -U pip setuptools wheel - Install Nikola Extra run
Scripts\python -m pip install -U "Nikola[extras]" - Activate your nikola script run
Scripts\nikola - Next run script venv activate
Scripts\activate - Activate Nikola Installation with run
nikola - Create New Nikola Project run
nikola init --demo mywebsite - Access your project run
cd /mywebsite - For first we need to build production run
nikola build - Now test your nikola project run
nikola auto --browserand openlocalhost:8000 - Next you can setup your site, open
conf.pyfile and add your site title, description for SEO and others.
How to create new static page and blog post Nikola ??
- Open your project folder
- For update and create static page you can access on
pagesfolder. - For update and create new blog post you can access on
postsfolder - By default nikola is ready with image gallery, you can simply just upload your image on
galleriesfolder
How to upload Nikola project to Hosting ??
- Make sure you have setup your site and add your url site , title and description for SEO in to
conf.pyfile - Next you can build production mode with run
nikola build - Upload or Push your Nikola build production folder
outputin to your hosting
We have finished writing this article, regarding The best Python Jamstack SSG for your projects , We hope this article is useful for you developing your python SSG jamstack site.
And if you need website documentation development services with python tech MkDocs or Sphinx, our team is ready to help you.
Order Documentation Website Developer Services
Need a complete website anbd blog with pelican or nikola ?? you can hire our team dev