1
0
Fork 0
forked from github/pelican
pelican-theme/docs/faq.rst
tBunnyMan e626f771c4 Add Themes and FAQ documentation on the new FEED_ATOM
Added all the FEED_ATOM variables to _handle_deprecation
Put FEED_ATOM around `if` in notmyidea
2012-07-16 13:47:39 -07:00

114 lines
4.8 KiB
ReStructuredText

Frequently Asked Questions (FAQ)
################################
Here is a summary of the frequently asked questions for Pelican.
Is it mandatory to have a configuration file?
=============================================
No, it's not. Configuration files are just an easy way to configure Pelican.
For basic operations, it's possible to specify options while invoking Pelican
via the command line. See ``pelican --help`` for more information.
I'm creating my own theme. How do I use Pygments for syntax highlighting?
=========================================================================
Pygments adds some classes to the generated content. These classes are used by
themes to style code syntax highlighting via CSS. Specifically, you can
customize the appearance of your syntax highlighting via the ``.codehilite pre``
class in your theme's CSS file. To see how various styles can be used to render
Django code, for example, you can use the demo `on the project website
<http://pygments.org/demo/15101/>`_.
How do I create my own theme?
==============================
Please refer to :ref:`theming-pelican`.
How can I help?
================
There are several ways to help out. First, you can use Pelican and report any
suggestions or problems you might have on `the bugtracker
<https://github.com/ametaireau/pelican/issues>`_.
If you want to contribute, please fork `the git repository
<https://github.com/ametaireau/pelican/>`_, make your changes, and issue
a pull request. I'll review your changes as soon as possible.
You can also contribute by creating themes and improving the documentation.
I want to use Markdown, but I got an error.
===========================================
Markdown is not a hard dependency for Pelican, so you will need to explicitly
install it. You can do so by typing::
$ (sudo) pip install markdown
In case you don't have pip installed, consider installing it via::
$ (sudo) easy_install pip
How do I assign custom templates on a per page basis?
=====================================================
It's as simple as adding an extra line of metadata to any pages or articles you
want to have it's own template.
:template: template_name
Then just make sure to have the template installed in to your theme as
``template_name.html``.
What if I want to disable feed generation?
==========================================
To disable all feed generation set ``FEED_ATOM`` and ``FEED_RSS`` to ``None`` in
your settings. Please note ``None`` and ``''`` are not the same thing. The
word None should not be surrounded by quotes.
I'm getting a warning about Feeds generated without SITEURL being set properly
==============================================================================
`RSS and atom3 feeds require all URLs and links in them to be absolute <http://validator.w3.org/feed/docs/rss2.html#comments>`_.
In order to properly generate all URLs properly in pelican you will need to set
``SITEURL`` to the full path of your blog. By default, when using the ``make html``
to test build your site ``SITEURL`` is disabled so you should receive this
warning.
If configured properly no other make commands should have this message.
Feeds still are generated when this error comes up, but may not validate.
My feeds are broken since I upgraded to 3.0
===========================================
Starting in 3.0 we changed the more confusing FEED options to say FEED_ATOM
like the RRS feed options. Here is an exact list of the changes::
FEED -> FEED_ATOM
TAG_FEED -> TAG_FEED_ATOM
CATEGORY_FEED -> CATEGORY_FEED_ATOM
Older 2.x themes that referenced these may not link properly. Please update
your themes for 3 on. Here is some example code you can use for the header
.. code-block:: html+jinja
{% if FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
{% endif %}
{% if FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
{% endif %}
{% if CATEGORY_FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
{% endif %}
{% if TAG_FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
{% endif %}
{% if TAG_FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
{% endif %}