Amazon S3 is a well-known service that can host static files on the Web. Pelican is a minor tool in Japan, but it is a Python tool that generates html nicely if you create a file in Markdown or reStructuredText format. The name "Pelican" seems to come from "calepin", which refers to notes in French.
http://docs.getpelican.com/en/
It's quite minor in Japan, where Python isn't popular, but it feels very simple and easy to use, so I want everyone to use it! There aren't many themes yet, so I want someone to make one! (Other power application)
This time, I give an example of hosting on Amazon S3, but it is also easy for Heroku and Github Pages. It can be uploaded to, and I feel that it has the minimum functionality such as tags, highlights of programming code, and RSS.
Will be carried out first. The domain of Amazon S3 seems to be long and delicate, so I think that you need your own domain. I proceeded with the setting by referring to the following blogs.
Assign your own domain to your AWS S3 bucket to host static files-a niche WordPress diary
important point
When operating with a root domain instead of a subdomain, domain registration with Amazon Route 53 is required.
When operating as a web page, the bucket name of S3 and the domain of the blog must match.
I use Python 2.7 series. It's easy to use pip.
$ pip install pelican
If you want to write in Markdown format, also here.
$ pip install markdown
After installation, execute the quick start command.
$ pelican-quickstart
Many questions will be asked, so please answer them in order.
After completing the input, a template for the Pelican project will be created.
$ ls
content/
output/
Makefile
develop_server.sh
pelicanconf.py
publishconf.py
content/
A folder to put Markdown or reST format files. It is a working folder for users to edit blogs.
output/
The final html output destination.
Makefile
It outputs html, checks the contents on localhost, and provides various commands.
pelicanconf.py
Pelican configuration file. If you want to change the settings of your blog, you usually edit this one.
publishconf.py
Commercial settings. Edit the information you need when you actually publish. Settings for comment input by Google Analytics and Disqus.
For the time being, let's create a file in Markdown format under content without touching the above configuration file. After "This is ..." is the text in Markdown format, and above that is the syntax for telling Pelican the title, date, tags, etc. of the blog. "Slug" is the URL of the article represented by a hyphenated string in the title. If you look at the URL of each article in Huffingtonpost, you will get an image.
Title: My super title
Date: 2010-12-03 10:20
Tags: thats, awesome
Category: yeah
Slug: my-super-post
Author: Alexis Metaireau
Summary: Short version for index and feeds
This is the content of my super blog post.
Create a file page.md like the one above in content /. If possible
$ make html
With html output,
$ make serve
Since the local server works with, let's check with localhost: 8000. You should see that the md file created above can be viewed as html. It's easy!
If you can do it so far, it is finally deployed to S3. Install a tool called s3cmd and configure it with configure.
$ pip install s3cmd
$ s3cmd --configure
You will be asked another question, but you can leave it blank except for the access key and secret key.
Next, for those who set the commercial individual setting to publishconf.py
$ make publish
Issue a command. It just changes the config file to read to publishconf.py and makes html.
Finally
$ make s3_upload
The file is now uploaded to S3 and you can browse the blog.
I'm studying too, so I'd like to add some information here and there. Basically, you study while looking at Documents. The fate of Python is that the information is mostly in the English-speaking world ...
__Addition __ I have summarized the settings that are likely to change frequently in another article. Various settings of Python static blog generation tool'Pelican'
Recommended Posts