鹈鹕主题,最初用于minchin.ca。
minchin.pelican.themes.minchindotca的Python项目详细描述
Minchin dot CA是Pelican的主题, 用python编写的静态站点生成器。
Minchin dot CA主题基于引导程序3,最初用于 Minchin.ca。
安装
安装Minchin dot CA主题的最简单方法是使用 关于皮普。这也将自动安装所需的依赖项。
pip install minchin.pelican.themes.minchindotca
然后,在pelicanconf.py文件中,导入模型,使用 内置函数指定主题位置,设置默认值 颜色方案,设置所用的图像处理图案,并添加一些金贾 主题使用的筛选器:
fromminchin.pelican.themesimportminchindotcaTHEME=minchindotca.get_path()BOOTSTRAP_THEME='minchindotca'IMAGE_PROCESS={'article-feature':["scale_in 848 848 True"],'index-feature':["scale_in 263 263 True"],}# Jijna2 filtersdefdatetimefilter(value,format='%Y/%m/%d %H:%M'):"""convert a datetime to a different format."""returnvalue.strftime(format)defarticle_date(value):"""Converts a date to the format we want it displayed on the article template. """returnvalue.strftime('%A, %B %-d, %Y')defbreaking_spaces(value):"""Converts non-breaking spaces to regular spaces."""returnvalue.replace('\u00A0',' ')JINJA_FILTERS={'datetimefilter':datetimefilter,'article_date':article_date,'breaking_spaces':breaking_spaces,}
您可能还需要通过使用 设置(见下文)。
要求
Minchin dot ca需要鹈鹕和image_process插件。 这可以通过pip:
手动安装pip install pelican minchin.pelican.plugins.image_process
附加设置
细节即将揭晓。同时,请参考Bootstrap 3 theme上的设置。