Pelican is a static site generator powered by Python and unlike most other static site generators, it uses reStructuredText instead of Markdown for authoring content. m.css provides a theme for it, together with a set of useful plugins.
Install Pelican either via
pip or using your system package manager.
# You may need sudo here pip3 install pelican
Note that using the m.css theme or Pelican plugins may require additional dependencies than just Pelican — documentation of each lists the additional requirements, if any. Once you have Pelican installed, create a directory for your website and bootstrap it:
mkdir ~/my-cool-site/ cd ~/my-cool-site/ pelican-quickstart
This command will ask you a few questions. You don’t need the URL prefix for now, but you definitely want a Makefile and an auto-reload script to be generated. Leave the rest at its defaults. Once the quickstart script finishes, you can run the auto-reloading like this:
It will print quite some output about processing things and serving the data to
the console. Open your fresh website at http://localhost:8000. The site is now
empty, so let’s create a simple article and put it into
subdirectory with a
.rst extension. For this example that would be
My cool article ############### :date: 2017-09-14 23:04 :category: Cool things :tags: cool, article, mine :summary: This article has a cool summary. This article has not only cool summary, but also has cool contents. Lorem? *Ipsum.* `Hi, google! <https://google.com>`_
If you did everything right, the auto-reload script should pick the file up and process it (check the console output). Then it’s just a matter of refreshing your browser to see it on the page.
That’s it! Congratulations, you successfully made your first steps with Pelican. The default theme might be a bit underwhelming, so let’s fix that. Click on the headers below to get to know more.
Quick guide and tips for writing content using reST. Chances are that you already know your way around from Sphinx or other documentation tools, nevertheless there are some hidden tricks that you might not know about yet.
A feature-packed theme with modern and responsive design that exposes all of m.css functionality with goodies on top such as social meta tags, breadcrumb navigation and more.