pelican

Python Pelican: How can I separate content by category?

孤街浪徒 提交于 2019-12-11 04:31:53
问题 I want to have a few elements on the menu: blog about projects texts experiments I have 3 first items in the menu - blog is a folder with articles, about and projects are pages. However, when I create another folder "texts" and add .md files to it, articles still appears under "blog" with 'texts' as a category. I can manually create two Menue items and bound them to text and blogpost searches, but is there any more elegand way to separate content? 来源: https://stackoverflow.com/questions

How I can add attribute to img tag in Pelican

我的梦境 提交于 2019-12-11 03:24:03
问题 I want to add attribute to image tag in order to reference from JavaScript library as below. <img src="img/sample.png" data-action="zoom"> However, I only can add alt, width, height as I know as below as outcome from Pelican. <img alt="thumbnail" height="250px" src="/images/mech2.jpg"> 回答1: If you're using a Markdown ( .md ) file to create your article, then you can literally just include an image element with any attributes you like: ![This image is in Markdown format]({filename}/images/foo

Is it possible to make automatic section header numbering in reST start at subsection level?

空扰寡人 提交于 2019-12-11 01:19:57
问题 Is there anyway to get reST to start numbering the sections only, at say, the second level? I am using the auto-numbering setting: .. section-numbering:: What I would like is for the input: Section A ========= Subsection A.1 ------------ Subsection A.2 ------------ Section B ========= Subsection B.1 ------------ Subsection B.2 ------------ to output Section A and B's headers unnumbered, but number the subsections (that is, Subsection A.1, A.2 and B.1, B.2). Having looked through the

Pelican static site generator change fontsize

痴心易碎 提交于 2019-12-09 23:50:43
问题 Dose anyone can give me a hint on how to change the fontsize with CSS for a Pelican Site. I use the pelican-bootstrap3 theme. I do not want to fork and modify the Theme. I would like to change the size with the custom.css feature. thanks for the help mathias 回答1: Check out the pelican-bootstrap-3 help page on github. What you can do is make a custom.css file that looks like this: html { font-size:150% } The trick is putting your custom.css file in your content folder and telling pelican where

Extending rst container to output extra div attributes

风流意气都作罢 提交于 2019-12-07 04:47:11
问题 I'm starting to use pelican with reStructuredText rst page format. I have custom javascript (jQuery) things that I'd like to control with div attributes like data-default-tpl="basename" with nested content. What to extend and what. I've looked at Directives and nodes , but I just can't wrap my head around how to do it. .. rstdiv:: class1 class2 :name: namessid :extra: thisIsMyextra .. rstdiv:: nested class3 :name: nestedid :extra: data-default-tpl="basename" some text .. container:: This is

Querying for specific articles (via tag/category) in Pelican themes

痞子三分冷 提交于 2019-12-05 13:03:28
Is it possible to set query parameters via jinja in Pelican template files? index.html {% if articles %} {% for article in articles_page.object_list if article.category == 'article' %} #stuff {% endfor %} {% endif %} This will return articles in the article category, but only if they happen to be in the articles already queried for. The desirable setup would be to grab x articles in y category (or with y tag) - is that possible? This code snippet works for me to bring back a list of all articles matching a tag: {% block content %} <ul> {% for article in articles if FAVORITES_TAG in article

How to link your own articles on a Pelican blog?

大憨熊 提交于 2019-12-05 04:48:39
I tried to link with the html file name, but it works because they are on the same folder. [Title](./this-is-the-file.html) But it is possible that another article would appear on another folder because of the ARTICLE_URL pattern. Examples: [Title 1](/2014/02/article1.html) [Title 2](/2014/01/25/article2.html) Is it possible to link your own articles with a reference to the slug ? Any other better solution than the generated HTML file name ? Justin Mayer As noted in the documentation , you can link to other source content files via: [a link relative to content root]({filename}/this-is-the

Pelican static site generator change fontsize

余生长醉 提交于 2019-12-04 19:31:49
Dose anyone can give me a hint on how to change the fontsize with CSS for a Pelican Site. I use the pelican-bootstrap3 theme. I do not want to fork and modify the Theme. I would like to change the size with the custom.css feature. thanks for the help mathias Check out the pelican-bootstrap-3 help page on github . What you can do is make a custom.css file that looks like this: html { font-size:150% } The trick is putting your custom.css file in your content folder and telling pelican where it is and then where it should be put in your output. You must also tell the pelican-bootstrap-3 theme

Error using pelican-quickstart “No module named html_parser”

谁说我不能喝 提交于 2019-12-03 17:13:10
问题 I decided to give pelican a try, but when I run pelican-quickstart , I get the following dialog: $ pelican-quickstart Traceback (most recent call last): File "/usr/local/bin/pelican-quickstart", line 9, in <module> load_entry_point('pelican==3.4.0', 'console_scripts', 'pelican-quickstart')() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/System

Error using pelican-quickstart “No module named html_parser”

纵饮孤独 提交于 2019-12-03 05:29:41
I decided to give pelican a try, but when I run pelican-quickstart , I get the following dialog: $ pelican-quickstart Traceback (most recent call last): File "/usr/local/bin/pelican-quickstart", line 9, in <module> load_entry_point('pelican==3.4.0', 'console_scripts', 'pelican-quickstart')() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2394, in