[PYTHON] Blogging with Pelican on Windows

I decided to create a blog using a static site generator and so on. This time I used Pelican made by Python.

environment

Pelican installation

First, use the virtualenv command to create a virtual environment with the name pelican. C:\> virtualenv pelican

Move to pelican C:\> cd pelican

Move to virtual environment C:\pelican> Scripts\activate

Install Pelican (pelican)C:\pelican> pip install pelican

I want to write an article in Markdown format, so (pelican)C:\pelican> pip install Markdown

Now you are ready to create a blog.

Blog creation

Create and move myblog project folder (pelican)C:\pelican> mkdir myblog (pelican)C:\pelican> cd myblog

Creating a blog template. (pelican)C:\pelican\myblog> pelican-quickstart

At this time, I will answer various questions such as blog title and author name.

Write an article

Write articles in Markdown format.

first-post.md


Title:Blog on Pelican
Date: 2016-05-20 22:40
Category: Pelican
Tags: pelican, python
Slug: first-post
Author: Daiki
Summary:Blogging with Pelican

Create a blog with Pelican.

Save this under \ myblog \ content .

Article posting

Originally, you can easily generate a static page with the make html command, but since it is not possible on Windows, use a batch file. (https://gist.github.com/traeblain/4252511) Put pmake.cmd here under myblog

pmake.cmd


set _PELICAN=$pelican
set _PELICANOPTS=$pelicanopts
.
.
cd %_OUTPUTDIR% && python -m SimpleHTTPServer
.
.

To

pmake.cmd


set _PELICAN=pelican
set _PELICANOPTS=
.
.
cd %_OUTPUTDIR% && python -m http.server
.
.

Edit the pelican path and the server start command for python3.4 (as is for 2.x),

Now you can compile with the pmake command instead of make. (pelican)C:\pelican\myblog> pmake html

If there are no particular errors, HTML conversion was successful.

Start localhost server (pelican)C:\pelican\myblog> pmake serve

Now you can check the created article by accessing http: // localhost: 8000 with a browser.

Published on Github

Generate HTML file for publication (pelican)C:\pelican\myblog> pmake publish

Settings such as the public URL can be changed in pelicanconf.py.

Move to output directory (pelican)C:\pelican\myblog> cd output

Publish page on Github (public URL: username.github.io) (pelican)C:\pelican\myblog\output> git init (pelican)C:\pelican\myblog\output> git add --all (pelican)C:\pelican\myblog\output> git commit -m "first post" (pelican) C: \ pelican \ myblog \ output> git push https://github.com/username/username.github.io.git master: master

Reference: (http://docs.getpelican.com/en/3.6.3/tips.html)

Reference site ―― I want to quit Wordpress and move to Pelican, but I don't have the energy to overcome obstacles. -I decided to start a technical blog with the static page generator Pelican -Write a blog with the static site generator Pelican -How to create a blog managed by Pelican + Markdown + GitHub Pages -Create a blog on github --Pelican -Pelican installation / operation check memo

Recommended Posts

Blogging with Pelican on Windows
Run SwitchBot on Windows 10 with Bleak
Getting started with USD on Windows
Getting started with Python 3.8 on Windows
Run servo with Python on ESP32 (Windows)
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
Organize files on Windows with Linux commands-using WSL-
Boot CentOS 8 from Windows 10 with Wake On LAN
Pylint on Windows Atom
Linux (WSL) on Windows
Use pyvenv on Windows
Python starting with Windows 7
Anaconda on Windows Terminal
Install Anaconda on Windows 10
python basic on windows ②
Install python on windows
Install pycuda on Windows10
Blog markdown with pelican
Build TensorFlow on Windows
Try FEniCS on Windows!
Build XGBoost on Windows
Install pygraphviz on Windows 10
Use Ansible on Windows
Install Chainer 1.5.0 on Windows
Use QuTiP on Windows
Use pip on Windows
Run Kali Linux on Windows with GUI (without VirtualBox)
Problems with windows python being called on pipenv on WSL
PIL with Python on Windows 8 (for Google App Engine)
Create an OpenAI Gym environment with bash on Windows 10
How to operate Firefox with selenium on Windows Memo
Install Numpy on virtualenv on Windows
Set-enable Python virtualenv on Windows
Python with VS Code (Windows 10)
OpenJTalk on Windows10 (Speak Japanese with Python from environment construction)
Run Jupyter on Ubuntu on Windows
Run Openpose on Python (Windows)
Run python with PyCharm (Windows)
Let's get started with Python ~ Building an environment on Windows 10 ~
Before trying Veriloggen on Windows
Install cvxpy on windows, Anaconda
venv environment with windows powershell
Python + Kivy development on Windows
Try using OpenCV on Windows
F2py on Miniconda for Windows
Sphinx-autobuild (0.5.2) on Windows7, Python 3.5.1, Sphinx 1.3.5
Use Windows 10 fonts with WSL
Operate ubuntu on VScode (windows10)
Build Python environment on Windows
Install Jupiter Notebook on Windows with pip in proxy environment
Django environment development on Windows 10
Install Chainer 1.6 (GPU) on Windows 7.
Until the start of the django tutorial with pycharm on Windows
Build python environment on windows
Set up Polyglot on Windows
Build Python3 for Windows 10 on ARM with Visual Studio 2019 (x86) on Windows 10 on ARM
I ran python on windows
Notes on installing Anaconda 3 on Windows
[Python] [Chainer] [Windows] Install Chainer on Windows
Use Python on Windows (PyCharm)
Time synchronization (Windows) with Python