2

我正在使用 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",
    }
}
4

3 回答 3

4

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

不要忘记您也可以使用Google 自定义搜索

于 2014-06-12T15:08:28.903 回答
0

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

于 2014-12-15T23:21:34.973 回答
0

Tipue Search 已失效。使用pelican-algolia来自 PyPI 的插件。

pip install pelican-algolia

之后在 pelicanconf.py 中定义四个变量

ALGOLIA_APP_ID = "<Your Algolia App ID>"
ALGOLIA_SEARCH_API_KEY = "<Your Search-only Api Key>"
ALGOLIA_INDEX_NAME = "<You Algolia App Index name>"
ALGOLIA_ADMIN_API_KEY = <"ALGOLIA_ADMIN_API_KEY">

关于如何为 Pelican 配置 Algolia的简短教程。

于 2021-11-04T23:27:25.457 回答