在Pelican支持的博客中启用搜索功能?

时间:2014-06-12 14:51:51

标签: python search blogs pelican

我正在使用Pelican和Elegant主题来生成我的博客。但是,我无法弄清楚如何打开搜索功能。我添加了tipue_searchsitemap插件,但没有运气。我正在附加配置文件pelicanconf.py以供参考。

#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals

AUTHOR = u'abc'
SITENAME = u"abc"
DEFAULT_DATE = 'fs'
SITEURL = 'http://example.github.io'
TIMEZONE = 'Asian/Shanghai'
THEME = 'elegant'
DEFAULT_PAGINATION = 10

ARTICLE_URL = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/'
ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html'
YEAR_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/index.html'
MONTH_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/index.html'

# Uncomment following line if you want document-relative URLs when developing
# RELATIVE_URLS = True

PLUGIN_PATH = 'pelican-plugins'
PLUGINS = ["sitemap", 
       "tipue_search", 
       "render_math", 
       "summary",
       "neighbors"]

SITEMAP = {
    "format": "xml",
    "priorities": {
        "articles": 0.7,
        "indexes": 0.5,
        "pages": 0.3,
    },
    "changefreqs": {
        "articles": "monthly",
        "indexes": "daily",
        "pages": "monthly",
    }
}

2 个答案:

答案 0 :(得分:3)

要使用Tipue搜索,启用插件后还需要执行一些步骤。 Here是一个很好的教程。

不要忘记您也可以使用Google Custom Search

答案 1 :(得分:0)

检查此链接并复制配置文件并对其进行修改 http://blog.john-pfeiffer.com/how-to-set-up-a-pelican-static-blog-site/