2014-05-12 07:48:37 -07:00
|
|
|
Quickstart
|
|
|
|
|
##########
|
|
|
|
|
|
|
|
|
|
Reading through all the documentation is highly recommended, but for the truly
|
|
|
|
|
impatient, following are some quick steps to get started.
|
|
|
|
|
|
|
|
|
|
Installation
|
|
|
|
|
------------
|
|
|
|
|
|
2014-11-02 13:49:31 -08:00
|
|
|
Install Pelican (and optionally Markdown if you intend to use it) on Python
|
2020-08-17 07:14:29 +02:00
|
|
|
3.6+ by running the following command in your preferred terminal, prefixing
|
|
|
|
|
with ``sudo`` if permissions warrant::
|
2014-05-12 07:48:37 -07:00
|
|
|
|
2020-08-17 07:04:00 +02:00
|
|
|
python -m pip install "pelican[markdown]"
|
2014-05-12 07:48:37 -07:00
|
|
|
|
|
|
|
|
Create a project
|
|
|
|
|
----------------
|
|
|
|
|
|
|
|
|
|
First, choose a name for your project, create an appropriately-named directory
|
2014-07-27 07:33:05 -07:00
|
|
|
for your site, and switch to that directory::
|
2014-05-12 07:48:37 -07:00
|
|
|
|
|
|
|
|
mkdir -p ~/projects/yoursite
|
|
|
|
|
cd ~/projects/yoursite
|
|
|
|
|
|
|
|
|
|
Create a skeleton project via the ``pelican-quickstart`` command, which begins
|
|
|
|
|
by asking some questions about your site::
|
|
|
|
|
|
|
|
|
|
pelican-quickstart
|
|
|
|
|
|
|
|
|
|
For questions that have default values denoted in brackets, feel free to use
|
2016-06-04 09:00:17 -04:00
|
|
|
the Return key to accept those default values [#tzlocal_fn]_. When asked for
|
|
|
|
|
your URL prefix, enter your domain name as indicated (e.g.,
|
2020-04-12 09:38:35 -05:00
|
|
|
``https://example.com``).
|
2014-05-12 07:48:37 -07:00
|
|
|
|
|
|
|
|
Create an article
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
|
You cannot run Pelican until you have created some content. Use your preferred
|
|
|
|
|
text editor to create your first article with the following content::
|
|
|
|
|
|
|
|
|
|
Title: My First Review
|
|
|
|
|
Date: 2010-12-03 10:20
|
|
|
|
|
Category: Review
|
|
|
|
|
|
|
|
|
|
Following is a review of my favorite mechanical keyboard.
|
|
|
|
|
|
|
|
|
|
Given that this example article is in Markdown format, save it as
|
|
|
|
|
``~/projects/yoursite/content/keyboard-review.md``.
|
|
|
|
|
|
|
|
|
|
Generate your site
|
|
|
|
|
------------------
|
|
|
|
|
|
2019-09-28 13:51:20 -07:00
|
|
|
From your project root directory, run the ``pelican`` command to generate your site::
|
2014-05-12 07:48:37 -07:00
|
|
|
|
|
|
|
|
pelican content
|
|
|
|
|
|
2019-09-28 13:51:20 -07:00
|
|
|
Your site has now been generated inside the ``output/`` directory. (You may see
|
2018-11-02 20:53:15 -06:00
|
|
|
a warning related to feeds, but that is normal when developing locally and can
|
|
|
|
|
be ignored for now.)
|
2014-05-12 07:48:37 -07:00
|
|
|
|
|
|
|
|
Preview your site
|
|
|
|
|
-----------------
|
|
|
|
|
|
2019-09-28 13:51:20 -07:00
|
|
|
Open a new terminal session, navigate to your project root directory, and
|
2019-06-16 18:51:10 +02:00
|
|
|
run the following command to launch Pelican's web server::
|
2014-05-12 07:48:37 -07:00
|
|
|
|
2017-07-10 16:59:35 +02:00
|
|
|
pelican --listen
|
2014-05-12 07:48:37 -07:00
|
|
|
|
|
|
|
|
Preview your site by navigating to http://localhost:8000/ in your browser.
|
|
|
|
|
|
2018-11-02 20:53:15 -06:00
|
|
|
Continue reading the other documentation sections for more detail, and check
|
|
|
|
|
out the Pelican wiki's Tutorials_ page for links to community-published
|
|
|
|
|
tutorials.
|
2014-05-12 07:48:37 -07:00
|
|
|
|
|
|
|
|
.. _Tutorials: https://github.com/getpelican/pelican/wiki/Tutorials
|
2016-06-04 09:00:17 -04:00
|
|
|
|
|
|
|
|
Footnotes
|
|
|
|
|
---------
|
|
|
|
|
|
|
|
|
|
.. [#tzlocal_fn] You can help localize default fields by installing the
|
2020-04-12 09:38:35 -05:00
|
|
|
optional `tzlocal <https://pypi.org/project/tzlocal/>`_
|
2016-06-04 09:00:17 -04:00
|
|
|
module.
|