[PYTHON] Blog markdown with pelican

Wordpress management is troublesome, I tried to make it simpler by committing / pushing to github. I'm still in the middle, but I want to write up to the point of uploading to github.

reference

environment

Installation

> pip install pelican markdown
Collecting pelican
  Downloading pelican-4.5.0-py2.py3-none-any.whl (673 kB)
     |████████████████████████████████| 673 kB 2.2 MB/s
Collecting markdown
  Downloading Markdown-3.2.2-py3-none-any.whl (88 kB)
     |████████████████████████████████| 88 kB 4.0 MB/s
Collecting feedgenerator>=1.9
  Downloading feedgenerator-1.9.1-py3-none-any.whl (22 kB)
Collecting jinja2>=2.11
  Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
     |████████████████████████████████| 125 kB 6.8 MB/s
Collecting unidecode
  Downloading Unidecode-1.1.1-py2.py3-none-any.whl (238 kB)
     |████████████████████████████████| 238 kB 6.4 MB/s
Collecting pygments
  Downloading Pygments-2.7.0-py3-none-any.whl (950 kB)
     |████████████████████████████████| 950 kB 6.8 MB/s
Collecting docutils>=0.15
  Downloading docutils-0.16-py2.py3-none-any.whl (548 kB)
     |████████████████████████████████| 548 kB 6.4 MB/s
Collecting python-dateutil
  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
     |████████████████████████████████| 227 kB 6.8 MB/s
Collecting blinker
  Downloading blinker-1.4.tar.gz (111 kB)
     |████████████████████████████████| 111 kB ...
Requirement already satisfied: pytz>=0a in c:\users\username\appdata\local\programs\python\python38\lib\site-packages (from pelican) (2020.1)
Collecting six
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting MarkupSafe>=0.23
  Downloading MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl (16 kB)
Building wheels for collected packages: blinker
  Building wheel for blinker (setup.py) ... done
  Created wheel for blinker: filename=blinker-1.4-py3-none-any.whl size=13455 sha256=57daa4945a8c37e456b038a3022c48e58d2d7f7e1d02cb7efc612448ad4b89ef
  Stored in directory: c:\users\username\appdata\local\pip\cache\wheels\b7\a5\68\fe632054a5eadd531c7a49d740c50eb6adfbeca822b4eab8d4
Successfully built blinker
Installing collected packages: six, feedgenerator, MarkupSafe, jinja2, unidecode, pygments, docutils, python-dateutil, blinker, pelican, markdown
Successfully installed MarkupSafe-1.1.1 blinker-1.4 docutils-0.16 feedgenerator-1.9.1 jinja2-2.11.2 markdown-3.2.2 pelican-4.5.0 pygments-2.7.0 python-dateutil-2.8.1 six-1.15.0 unidecode-1.1.1
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the 'c:\users\username\appdata\local\programs\python\python38\python.exe -m pip install --upgrade pip' command.

Various necessary libraries such as jinja2 are also installed.

Project creation

Directory creation

mkdir -p mysite
cd mysite

Project creation

When I execute the command, I get various questions.

> pelican-quickstart
Welcome to pelican-quickstart v4.5.0.

This script will help you create a new Pelican-based website.

Please answer the following questions so this script can generate the files
needed by Pelican.


> Where do you want to create your new web site? [.] .
> What will be the title of this web site? MyBlog
> Who will be the author of this web site? HyunwookPark
> What will be the default language of this web site? [Japanese] ja
> Do you want to specify a URL prefix? e.g., https://example.com   (Y/n) n
> Do you want to enable article pagination? (Y/n) n
> What is your time zone? [Europe/Paris] Asia/Tokyo
> Do you want to generate a tasks.py/Makefile to automate generation and publishing? (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
> Do you want to upload your website using Rackspace Cloud Files? (y/N) N
> Do you want to upload your website using GitHub Pages? (y/N) y
> Is this your personal page (username.github.io)? (y/N) y
Done. Your new project is available at D:\work\mysite

Created directory


mysite
├─content
└─output

** The markdown I made looks like this ↓ **


Title: My First Review Date: 2010-12-03 10:20 Category: Review Tags: test, post Summary: What it looks like

\ # Test title

How is this content output?

```python print('HelloWorld') ```

### table

|item|Contents| |---|---| |python|Program language|

\ ### List

\ * List \ * List

\ 1. List \ 1. List


> pelican content
WARNING: Watched path does not exist: mysite\content\images
Done: Processed 1 article, 0 drafts, 0 pages, 0 hidden pages and 0 draft pages in 0.31 seconds.
mysite
├─content
├─output
│  ├─author
│  ├─category
│  ├─tag
│  └─theme
│      ├─css
│      ├─fonts
│      └─images
│          └─icons
└─__pycache__

Run

> pelican --listen

Serving site at: 127.0.0.1:8000 - Tap CTRL-C to stop

image.png

Change theme

https://github.com/getpelican/pelican-themes

Recommended Posts

Blog markdown with pelican
Markdown output with Django
How to install Pelican blog
Added Theme to Pelican Blog
Blogging with Pelican on Windows
Use Github-Flavored-Markdown on your Pelican blog
Use markdown with jupyter notebook (with shortcut)
I really want to use GitHub Flavored Markdown (GFM) with Pelican!
[Python] Automate Pelican builds with Travis CI
I want to blog with Jupyter Notebook