ablog/docs/manual/ablog-configuration-options.rst

276 lines
7.3 KiB
ReStructuredText
Raw Normal View History

2014-05-11 16:33:42 -07:00
.. _config:
ABlog Configuration Options
===========================
.. post:: May 10, 2014
:tags: config
:author: Ahmet
:category: Manual
:location: Pittsburgh
2014-09-14 21:19:41 -07:00
This post describes ABlog configuration options that go in
2014-05-11 16:33:42 -07:00
:ref:`Sphinx build configuration file <sphinx:build-config>`.
General options
2014-05-11 16:33:42 -07:00
---------------
.. confval:: blog_path
A path relative to the configuration directory for blog archive pages.
Default is ``'blog'``.
.. confval:: blog_title
The “title” for the blog, used in acthive pages. Default is ``'Blog'``.
.. confval:: blog_baseurl
Base URL for the website, required for generating feeds.
.. confval:: blog_archive_titles
Choose to archive only post titles in collection pages, default is
``False``.
2014-09-14 21:19:41 -07:00
Authors, languages, & locations
-------------------------------
2014-05-11 16:33:42 -07:00
.. confval:: blog_authors
A dictionary of author names mapping to author full display names and
links. Dictionary keys are what should be used in ``post`` directive
to refer to the author. Default is ``{}``. Example::
blog_authors = {
'Ahmet': ('Ahmet Bakan', 'http://ahmetbakan.com'),
'Durden': ('Tyler Durden',
'http://en.wikipedia.org/wiki/Tyler_Durden'),
}
2014-09-14 21:19:41 -07:00
.. confval:: blog_languages
A dictionary of language code names mapping to full display names and
links of these languages. Similar to :confval:`blog_authors`, dictionary
keys should be used in ``post`` directive to refer to the locations.
2014-09-17 16:21:30 +02:00
Default is ``{}``. Example::
2014-09-14 21:19:41 -07:00
2014-09-17 16:21:30 +02:00
blog_languages = {
2014-09-14 21:19:41 -07:00
'en': ('English', None),
}
2014-05-11 16:33:42 -07:00
.. confval:: blog_locations
A dictionary of location names mapping to full display names and
2014-05-11 21:41:01 -07:00
links of these locations. Similar to :confval:`blog_authors`, dictionary
2014-05-11 16:33:42 -07:00
keys should be used in ``post`` directive to refer to the locations.
Default is ``{}``.
.. confval:: blog_default_author
Name of the default author defined in :confval:`blog_authors`.
Default is ``None``.
2014-09-14 21:19:41 -07:00
.. confval:: blog_default_language
Code name of the default language defined in :confval:`blog_languages`.
Default is ``None``.
2014-05-11 16:33:42 -07:00
.. confval:: blog_default_location
Name of the default location defined in :confval:`blog_locations`.
Default is ``None``.
2014-09-14 21:19:41 -07:00
.. update:: Sep 15, 2014
Added :confval:`blog_languages` and :confval:`blog_default_language`
2015-04-08 22:53:58 -07:00
configuration variables.
2014-09-14 21:19:41 -07:00
Post related
2014-05-11 16:33:42 -07:00
------------
.. confval:: post_date_format
Date display format (default is ``'%b %d, %Y'``) for published posts that
goes as input to :meth:`datetime.date.strftime`.
.. confval:: post_auto_excerpt
Number of paragraphs (default is ``1``) that will be displayed as an excerpt
from the post. Setting this ``0`` will result in displaying no post excerpt
in archive pages. This option can be set on a per post basis using
:rst:dir:`post` directive option ``excerpt``.
See :ref:`post-excerpts-and-images` for a more detailed discussion.
.. confval:: post_auto_image
Index of the image that will be displayed in the excerpt of the post.
Default is ``0``, meaning no image. Setting this to ``1`` will include
the first image, when available, to the excerpt. This option can be set
on a per post basis using :rst:dir:`post` directive option ``image``.
2014-05-11 16:33:42 -07:00
.. confval:: post_redirect_refresh
Number of seconds (default is ``5``) that a redirect page waits before
refreshing the page to redirect to the post.
.. confval:: post_always_section
When ``True``, post title and excerpt is always taken from the section that
contains the :rst:dir:`post` directive, instead of the document. This is the
behavior when :rst:dir:`post` is used multiple times in a document. Default
is ``False``.
2014-08-22 20:31:46 -04:00
Blog feeds
----------
Turn feeds by setting :confval:`blog_baseurl` configuration variable.
.. confval:: blog_feed_archives
2014-12-16 22:11:34 -05:00
Choose to create feeds per author, location, tag, category, and year,
default is ``False``.
2014-08-22 20:31:46 -04:00
.. confval:: blog_feed_fulltext
Choose to display full text in blog feeds, default is ``False``.
.. confval:: blog_feed_subtitle
Blog feed subtitle, default is ``None``.
.. confval:: blog_feed_titles
Choose to feed only post titles, default is ``False``.
.. confval:: blog_feed_length
Specify number of recent posts to include in feeds, default is ``None``
for all posts.
2014-08-22 20:31:46 -04:00
.. update:: Aug 24, 2014
Added :confval:`blog_feed_archives`, :confval:`blog_feed_fulltext`,
:confval:`blog_feed_subtitle`, and :confval:`post_always_section`
options.
2014-08-22 20:31:46 -04:00
.. update:: Nov 27, 2014
2014-08-22 20:31:46 -04:00
Added :confval:`blog_feed_titles`, :confval:`blog_feed_length`, and
:confval:`blog_archive_titles` options.
2014-08-22 20:31:46 -04:00
.. _fa:
Font awesome
2014-05-11 16:33:42 -07:00
------------
ABlog templates will use of `Font Awesome`_ icons if one of the following
2014-05-11 16:33:42 -07:00
is ``True``:
.. _Font Awesome: http://fontawesome.io/
.. confval:: fontawesome_link_cdn
Link to `Font Awesome`_ at `Bootstrap CDN`_ and use icons in sidebars
and post footers. Default: ``False``
.. _Bootstrap CDN: http://www.bootstrapcdn.com/#fontawesome_tab
.. confval:: fontawesome_included
Sphinx_ theme already links to `Font Awesome`_. Default: ``False``
Alternatively, you can provide the path to `Font Awesome`_ :file:`.css`
with the following configuration option:
.. confval:: fontawesome_css_file
Path to `Font Awesome`_ :file:`.css` (default is ``None``) that will
be linked to in HTML output by ABlog.
.. _disqus-integration:
2014-05-11 16:33:42 -07:00
Disqus integration
------------------
2014-05-11 16:33:42 -07:00
Of course one cannot think of a blog that doesn't allow for visitors to
comment. You can enable Disqus_ by setting ``disqus_shortname`` variable.
.. confval:: disqus_shortname
Disqus_ short name for the website.
.. confval:: disqus_pages
Choose to disqus pages that are not posts, default is ``False``.
.. confval:: disqus_drafts
Choose to disqus posts that are drafts (without a published date),
default is ``False``.
.. _sidebars:
2014-05-11 16:33:42 -07:00
Blog sidebars
2014-05-11 16:33:42 -07:00
-------------
Finally, there are seven sidebars you can include in your HTML output
using Sphinx_ :confval:`html_sidebars` configuration option. Sidebars that
you see on the left are listed below in the same order:
.. code-block:: python
html_sidebars = {
'**': [...,
'postcard.html', 'recentposts.html',
'tagcloud.html', 'categories.html',
'archives.html', ]
}
:file:`postcard.html` provides information regarding the current post.
:file:`recentposts.html` lists most recent five posts. Others provide a
link to a archive pages generated for each tag, category, and year.
2014-09-14 21:19:41 -07:00
In addition, there are ``authors.html``, ``languages.html``, and
``locations.html`` sidebars that link to author and location archive pages.
2015-04-08 22:53:58 -07:00
Command Options
---------------
.. update:: Apr 7, 2015
Added :ref:`commands` options.
.. confval:: ablog_website
Directory name for build output files. Default is ``_website``.
.. confval:: ablog_doctrees
Directory name for build cache files. Default is ``.doctrees``.
.. confval:: ablog_builder
HTML builder, default is ``dirhtml``. Build HTML pages, but with
a single directory per document. Makes for prettier URLs (no .html)
if served from a webserver. Alternative is ``html`` to build
one HTML file per document.
.. confval:: github_pages
GitHub user name used by ``ablog deploy`` command. See :ref:`deploy`
and :ref:`deploy-to-github-pages` for more information.