Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FAQ entry about theme overrides #3406

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ How do I create my own theme?

Please refer to :ref:`theming-pelican`.

Can I override individual templates without forking the whole theme?
====================================================================

Yes, you can override existing templates of the theme that you are using, or
add new templates, via the ``THEME_TEMPLATES_OVERRIDES`` variable. For example,
to override the page template, you can define the location for your templates
like this::

THEME_TEMPLATES_OVERRIDES = ["templates"]

You can then define a custom template in ``templates/page.html``.
See :ref:`settings/themes` for details.

I want to use Markdown, but I got an error.
===========================================

Expand Down Expand Up @@ -122,7 +135,8 @@ For content in Markdown format::
Template: template_name

Then just make sure your theme contains the relevant template file (e.g.
``template_name.html``).
``template_name.html``). If you just want to add a new custom template to an
existing theme, you can also provide it in a directory specified by ``THEME_TEMPLATES_OVERRIDES`` (see :ref:`settings/themes`).

How can I override the generated URL of a specific page or article?
===================================================================
Expand Down