getpelican / pelican Goto Github PK
View Code? Open in Web Editor NEWStatic site generator that supports Markdown and reST syntax. Powered by Python.
Home Page: https://getpelican.com
License: GNU Affero General Public License v3.0
Static site generator that supports Markdown and reST syntax. Powered by Python.
Home Page: https://getpelican.com
License: GNU Affero General Public License v3.0
Hi,
After a fresh installation of pelican-main, I have an error during generatation of my first thread which has tags. :
[...] pelican/generators.py", line 243, in generate_context
for tag, count in tag_cloud
ZeroDivisionError: float division by zero
For determining the size font, pelican does a little trick with mathematics functions. :
(line 240)
math.floor(steps - (steps - 1) * math.log(count) / math.log(max_count))
But :
(line 233)
max_count = max(tags).
When you have a single article with tags, the max can only be 1, and log(1) == 0.0.
I hope that is clear to you.
pelican raises an AttributeError when generating for Markdown entry files. Traceback for the error follows:
Traceback (most recent call last):
File "/usr/bin/pelican", line 3, in <module>
main()
File
"/usr/lib/python2.6/site-packages/pelican/__init__.py", line 137, in main
pelican.run()
File
"/usr/lib/python2.6/site-packages/pelican/__init__.py", line 61, in run
p.generate_context()
File
"/usr/lib/python2.6/site-packages/pelican/generators.py", line 192, in generate_context
filename=f)
File
"/usr/lib/python2.6/site-packages/pelican/contents.py", line 33, in __init__
self.slug = slugify(self.title)
AttributeError:
'Article' object has no attribute 'title'
Each .md file has a "Title" attribute.
I find it hard to debug using the traces: the only one appearing are the stack traces or the "[ok] Writing ..."
If there was a selectable logging level, with more or less details on the pelican processus, it would be useful.
Hey,
Say I add an image in my article, giving it a relative address, like content/my_image.jpg
.
My article has a category category
.
It works well in the root directory, but since the articles also appear in the categories, the relative address which was content/my_image.jpg
is now translated in category/content/my_image.jpg
.
I see one solution, using the site address to handle these kind of relative addresses: we simply prefix the relative address with the SITEURL value.
As the title suggests, if you have PATH in the configuration file, you should be able not to specify it on the command line.
To have it happen you need to add
, nargs='?',
in __init__.py
line 84 (where you add the path
argument), moreover you should change
if path.endswith('/'):
in
if path and path.endswith('/'):
in line 13 (inside init_params
) so that in case the user has not given a path you don't call endswith
on None
.
I would send in a patch, or fork, but it seems a bit too much for such a small change. Beside the fact that I don't use git normally…
When too many posts in the blog, the index page becomes very very long.
I saw that when I only had 5 links the layout becomes bad. The first two are well arranged, but then the others are not aligned and have no border-bottom.
I found it on 2.5.3 release and repository.
Hello,
With the last GIT version of Pelican, building a blog located in /path/to/content/ gives categories nammed /path/to/content/foo, path/to/content/bar, etc...
Steps to reproduce the problem:
Here is a Bash session showing the problem:
[18:18:13] skami@skami-laptop:/tmp$ mkdir -p content/{cat1,cat2}
[18:18:45] skami@skami-laptop:/tmp$ echo -en 'Post 1\n#####\n\n...' >> content/cat1/post1.rst
[18:19:26] skami@skami-laptop:/tmp$ echo -en 'Post 2\n#####\n\n...' >> content/cat2/post2.rst
[18:19:39] skami@skami-laptop:/tmp$ tree content/
content/
├── cat1
│ └── post1.rst
└── cat2
└── post2.rst
2 directories, 2 files
[18:19:44] skami@skami-laptop:/tmp$ pelican content/ -o output
[ok] writing /tmp/output/feeds/all.atom.xml
[ok] writing /tmp/output/feeds/content/cat1.atom.xml
[ok] writing /tmp/output/feeds/content/cat2.atom.xml
[ok] writing /tmp/output/feeds/all-en.atom.xml
[ok] writing /tmp/output/post-2.html
[ok] writing /tmp/output/post-1.html
[ok] writing /tmp/output/index.html
[ok] writing /tmp/output/tags.html
[ok] writing /tmp/output/categories.html
[ok] writing /tmp/output/archives.html
[ok] writing /tmp/output/category/content/cat1.html
[ok] writing /tmp/output/category/content/cat2.html
[ok] copying /usr/local/lib/python2.6/dist-packages/pelican/themes/notmyidea/static to /tmp/output/theme/.
[18:20:01] skami@skami-laptop:/tmp$ tree output/
output/
├── archives.html
├── categories.html
├── category
│ └── content
│ ├── cat1.html
│ └── cat2.html
├── feeds
│ ├── all.atom.xml
│ ├── all-en.atom.xml
│ └── content
│ ├── cat1.atom.xml
│ └── cat2.atom.xml
├── index.html
├── post-1.html
├── post-2.html
├── tags.html
└── theme
├── css
│ ├── main.css
│ ├── pygment.css
│ ├── reset.css
│ └── wide.css
└── images
└── icons
├── delicious.png
├── lastfm.png
├── linkedin.png
├── rss.png
└── twitter.png
8 directories, 21 files
[18:20:21] skami@skami-laptop:/tmp$
Thanks for reading
I think it would be good to insert empty html files in /tag /category /pages folders.
If we go on {SITEURL}/pages we have the list of all html pages. Users wouldn't have to make a .htaccess file to disable them.
when running
pelican -t simple prog/dvcs/git/pelican/samples/content/
it gives
[ok] writing /home/solstice/output/feeds/all.atom.xml
[ok] writing /home/solstice/output/feeds/prog/dvcs/git/pelican/samples/content.atom.xml
[ok] writing /home/solstice/output/feeds/bar.atom.xml
[ok] writing /home/solstice/output/feeds/yeah.atom.xml
Traceback (most recent call last):
File "/usr/bin/pelican", line 39, in <module>
generator.run(processors)
File "/usr/lib/python2.7/site-packages/pelican/generators.py", line 53, in run
p.process(context, self)
File "/usr/lib/python2.7/site-packages/pelican/processors.py", line 97, in process
self.generate_pages(context, generator)
File "/usr/lib/python2.7/site-packages/pelican/processors.py", line 46, in generate_pages
templates = generator.get_templates()
File "/usr/lib/python2.7/site-packages/pelican/generators.py", line 122, in get_templates
template, path))
Exception: Unable to load page.html from /usr/lib/python2.7/site-packages/pelican/themes/simple/templates
Use a rss feed to import the contents of a weblog to pelican. (with support of RST and Markdown, via pandoc)
The documentation doesnt talk about pages, it could be useful to do so.
In the same time, it could be useful too to split the documentation into different pieces, not like it currently is (only one readme).
Like : contents, section, chapter
...
Documentation is not really up to date. Seems there is a need to update it, and to put more informations about the settings, theme support and extending pelican, too. (moving away from a one-page-doc)
There's a problem with rss feeds since changes on locales and dates. It comes from publication date that must be an RFC-822 date-time.
You can see the problem to this page http://feedvalidator.org/check.cgi?url=http%3A%2F%2Ffreeculture.homelinux.com%2Ffeeds%2Fall.rss.xml
Hi,
At first, I thought categories were sorted by alphabetical order. But I've got a problem with a personal / private blog. I've assigned the year to the "Category" property of its articles, and as a result, the categories are sorted like this:
2009 2011 2010
How could I sort these in ascending or descending order?
I would like to translate some of my articles, but I didn't understood how to make the translation link
Suppose a french article "Mon premier article" and I would like to do the translation with an english article "My first post"
So I have created the premier_article.rst file with :lang: fr.
but if I do first_post.rst with :lang: en, how can Pelican understand that the article are translation of the other ?
I don't understand this point. If you could help me.
Thanks
As previously discussed on linuxfr, when i run the command
pelican some/long/directory/name
I end up with the first category being named some/long/directory/name
using latest 35dc0bf
so it does not seems to be fixed.
I upgraded my pelican version today, and I had this bug which erase all my blog folder
File "../pelican/bin/pelican", line 37, in
generator.run(processors)
File "/usr/local/lib/python2.6/dist-packages/pelican-2.5.0-py2.6.egg/pelican/generators.py", line 65, in run
p.process(context, self)
File "/usr/local/lib/python2.6/dist-packages/pelican-2.5.0-py2.6.egg/pelican/processors.py", line 108, in process
self.generate_feeds(context, generator)
File "/usr/local/lib/python2.6/dist-packages/pelican-2.5.0-py2.6.egg/pelican/processors.py", line 36, in generate_feeds
generator.generate_feed(self.articles, context, context['FEED'])
File "/usr/local/lib/python2.6/dist-packages/pelican-2.5.0-py2.6.egg/pelican/generators.py", line 94, in generate_feed
categories=element.tags,
AttributeError: 'Article' object has no attribute 'tags'
I precise i didn't put any tags on my article. Are they necessary ? Will it be ok if I create tag on all my articles ?
Hello,
I had a problem when setting the blogroll with this line :
('Génération Linux', 'http://www.generation-linux.fr'),
I discovered than the problem comes from the accents of 'Génération Linux' and dissapears when I replace É by E.
I hadn't the # -- coding: utf-8 -- line, but the problem is the same with and without.
I receive this line of error about Unicode :
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
All is in the title.
Hi !
I think it would be good to order categories and tags alphabeticaly in templates.
But I don't know really where to search : pelican source or jinja2 ?
There should be at least one paragraph saying that when someone uses ".. code-block::" rst directive, he/she should insert the short or full name of the lexer as the first argument according to http://pygments.org/docs/lexers/. It's unclear for people unfamiliar with Sphinx/pelican/pygments.
I think it would be great to be able to choose the ordering of the articles : older or newer at top.
What do you think ?
in http://docs.notmyidea.org/alexis/pelican/getting_started.html#syntactic-recognition you suggest to use
::code-block identifier
as a way to introduce code. I think you should instead use
.. code-block:: identifier
given that in the code (37:pelican/rstdirectives.py) you actually registr a directive that in rst requires the second syntax to be used.
Use pelican to make a photoblog easily, parsing exif pictures infos.
I try to use tags in themes, but when I make a {{ article.tags }} in the template, I receive something like [u'images']
Is it actually possible to have a list of tag links ?
Thanks
Since Fix #12, the older articles are on the top of the page on the index.html, and the newer at the bottom.
I precise this problem doesn't appear on categories pages.
Implant a simple way to add extra features to Pelican.
In this purpose, I propose an implantation which uses blinker signal library.
Please take a look to my branch plugin: https://github.com/nduhamel/pelican/tree/plugin
I want to add a internationalization support, using Jinja2's gettext extension.
Work in progress.
Hi,
I've been working on a private blog, and there'll only be french-speaking persons reading it. I know I've got to translate static english strings into french from the templates, and I'm fine with that. But I've got issue with date formatting.
templates are using:
{{ article.date.strftime('%a %d %B %Y') }}
which should use locale for formatting. And then, all the dates are in English, like "Tue 25 January 2011". How would it be possible to display dates in french or whatever language I'd like, for a project (settings?) or event a specific page (if I've got translated pages, I surely need a translated date for this specific page...)
Regarding the license of the theme being used (https://github.com/mitsuhiko/flask-sphinx-themes/blob/master/LICENSE#L21) it a change is needed.
With metadata and global config file
I've got a problem, probably caused by a Unicode / ascii issue caused by the brand-new-shiny locale date formatting.
I guess, the "december" month becoming "Décembre" spits out the following message:
File "/home/bruno/Projets/[redacted]/pelican/pelican/themes/simple/templates/article.html", line 7, in block "content"
{{ article.locale_date }}
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128)
the chosen formatting is:
DEFAULT_DATE_FORMAT = u'%a %d %B %Y'
If no informations about date is indicated, add a way to fallback using the mtime informations of a file to get it. (I'm thinking about deactivating such feature by default, but allowing to do so if wanted/needed)
Hello,
There is a problem with the Pelican's license:
According to this page, «a copyright notice» and «a statement of copying permission» must be present in the header of all files of Pelican, like this:
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
#
# Copyright (c) 20XX-2011 XXXXXX XXXXXXX
#
# This file is part of Pelican.
#
# Pelican is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pelican is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Pelican. If not, see <http://www.gnu.org/licenses/>.
#
But this text is only present in the LICENSE
file, instead of the complete license
I propose to add a support for posts translation. For example, some posts in my russian blog, could have an english translation and I want to show a link to all available translations from the post written in default language.
We need a special meta field Lang
and a setting option DEFAULT_LANG=en
.
Then we'll need to stack posts with equal slugs and different Lang metafields together and crosslink them.
What do you think? I could try to implement this feature in my fork, and send you a patch.
The archive.html page is not sorted by date.
Would be great to fix it.
When making translations of article, the urls of the articles have the value of the slug instead of the title of the article.
So if we create a translation few days after, the original url is lost.
Serve the static content using SimpleHttpServer.
It's currently impossible to use images on the articles/pages.
Find a way to fix that.
hi,
it would be nice to control the deletion of the output directory with an additional commandline argument (eg. '-d'):
what do you think? I can implement this with an appropriate update to the docs as well if it is ok to have such a feature…
Create a test suite for pelican.
Hi,
is there an easy way to generate archive pages per year and year/month?
This could be really useful for building linkable archive-sidebars like:
or:
Steve Howe and I discussed about separating a bit more the content folders, into different categories.
One proposition that could fit the needs is the following:
/content
/pages
/articles
/category1
/category2
/static
/images
/...
/pelican.conf.py
and then, while generating the output, change a bit that too:
/output (generated by pelican)
/static (a copy of the one in contents/static)
/theme
/theme1
css/main.css
...
/categories
/pages
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.