我有一个类似于以下内容的现有网站:
.
|-blog
|-articles
| |-foo.html
|-images
|-references
当我运行pelican时,它需要foo.html并将其存储在输出目录的根目录中。有没有办法告诉鹈鹕保留文章目录,以便在那里创建foo.html?我在官方文档中找不到答案。
*更新*
使用我正在使用的pelican配置文件进行更新:
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Donny'
SITENAME = u"Happy Valley"
SITEURL = ''
SHOW_FULL_ARTICLE = True
THEME = 'themes/pelican-clean-blog'
PATH = 'site_content'
TIMEZONE = 'US/Eastern'
DEFAULT_LANG = u'en'
PLUGINS = ['pelican_alias']
STATIC_PATHS = ['presentations']
site_content目录包含上面列出的树。我想做的是让pelican从源代码中获取articles / foo.html,并将其作为/articles/foo.html在输出目录中显示。为了保持目录清洁,我希望它创建一个实际的文章目录并将生成的文件放在那里。
答案 0 :(得分:0)
这适用于我(this之后):
content/
├── p001
│ └── myArticle001.md
│ └── img001
│ └── myPic1.png
│ └── myPic2.png
├── p002
│ └── myArticle002.md
│ └── img002
│ └── myPic1.png
│ └── myPic2.png
在pelicanconfig.py
集合中:
PATH = 'content'
STATIC_PATHS = ['p001','p002']
ARTICLE_PATHS = STATIC_PATHS
运行Pelican后我得到了:
output/
├── p001
│ └── img001
│ └── myPic1.png
│ └── myPic2.png
├── p002
│ └── img002
│ └── myPic1.png
│ └── myPic2.png
├── posts
│ └── myArticle001.md
│ └── myArticle002.md