4

content/some_dir包含不应扫描页面或模板的子目录以及应按原样显示的 .html 文件和图像。包括并且似乎some_dir并没有阻止鹈鹕扫描并警告我我的页面格式不正确,图像没有's,等等。STATIC_PATHSPAGE_EXCLUDESalt

4

2 回答 2

3

In my pelican site I have a LOT of pre-formatted static html that I didn't want to have to edit. (Static archive of old web forums - 30K html files)

You can use STATIC_PATHS, with ARTICLE_EXCLUDES and PAGE_EXCLUDES to do what you want, but you'll discover that for some reason pelican still wants to look at each file. Doing this increased my build times 10x or so with my data. In short, use the static_paths to add your html files, and then the excludes settings to tell pelican to not process them.

Instead I tried the following, and use this now. In my top-level directory, I made a directory 'output-skel' and then I edited my Makefile. In the html target, I added this line as one of the commands that is run:

        rsync -SHqav output-skel/ $(OUTPUTDIR)

so my html make block looks like this:

html:
    $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
    rsync -SHqav output-skel/ $(OUTPUTDIR)

This way, I can put ANY file I want to include in my output in it's relative path in output-skel and have it show up where I want it.

This sure beats having 30k entries in my STATIC_PATHS. I put .htaccess files, static-html, some 'downloads' files there.

As an aside, I also add the following lines to my html make target:

        chown -R root:www $(OUTPUTDIR)
        find $(OUTPUTDIR) -type d | xargs chmod 750
        find $(OUTPUTDIR) -type f | xargs chmod 640

Just to keep things neat and tidy.

于 2014-06-14T05:27:29.243 回答
2

您可以尝试ARTICLE_EXCLUDES(查找文章时要排除的目录列表)或IGNORE_FILES(与处理器忽略的源文件匹配的文件通配模式列表)。

来源:http ://docs.getpelican.com/en/3.3.0/settings.html

于 2014-04-09T17:11:52.683 回答