mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
669 lines
29 KiB
Text
669 lines
29 KiB
Text
# SOME DESCRIPTIVE TITLE.
|
||
# Copyright (C) 2010–2024
|
||
# This file is distributed under the same license as the PELICAN package.
|
||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
|
||
#
|
||
msgid ""
|
||
msgstr ""
|
||
"Project-Id-Version: PELICAN 4\n"
|
||
"Report-Msgid-Bugs-To: \n"
|
||
"POT-Creation-Date: 2025-07-13 11:46+0800\n"
|
||
"PO-Revision-Date: 2024-06-26 19:00+0800\n"
|
||
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
|
||
"Language: zh_CN\n"
|
||
"Language-Team: \n"
|
||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||
"MIME-Version: 1.0\n"
|
||
"Content-Type: text/plain; charset=utf-8\n"
|
||
"Content-Transfer-Encoding: 8bit\n"
|
||
"Generated-By: Babel 2.17.0\n"
|
||
|
||
#: ../../plugins.rst:4 3df58bcad1a64350a8e763d87d7470e3
|
||
msgid "Plugins"
|
||
msgstr "插件"
|
||
|
||
#: ../../plugins.rst:6 5e0f2aa517254778a71d1e742b051645
|
||
msgid ""
|
||
"Beginning with version 3.0, Pelican supports plugins. Plugins are a way "
|
||
"to add features to Pelican without having to directly modify the Pelican "
|
||
"core."
|
||
msgstr "Pelican从3.0版本开始支持插件。通过插件,不必直接修改Pelican的核心代码就可以给Pelican添加新功能。"
|
||
|
||
#: ../../plugins.rst:10 40ad4aad1dc54b929f6059031edae0d9
|
||
msgid "How to use plugins"
|
||
msgstr "如何使用插件"
|
||
|
||
#: ../../plugins.rst:12 8fc9f8cba76b4bb9930d80b5b985885a
|
||
msgid ""
|
||
"Starting with version 4.5, Pelican moved to a new plugin structure "
|
||
"utilizing namespace packages that can be easily installed via Pip_. "
|
||
"Plugins supporting this structure will install under the namespace "
|
||
"package ``pelican.plugins`` and can be automatically discovered by "
|
||
"Pelican. To see a list of Pip-installed namespace plugins that are active"
|
||
" in your environment, run::"
|
||
msgstr ""
|
||
"Pelican从4.5版本开始使用了一种全新的插件结构,利用了命名空间包,并且可以轻松地通过 Pip_ "
|
||
"进行安装。支持此结构地插件都会被安装在命名空间包 ``pelican.plugins`` "
|
||
"下,因此Pelican可以自动发现他们。下面的命令可以用于查看环境中用Pip安装的所有插件:"
|
||
|
||
#: ../../plugins.rst:20 de052285e7f645a9ab551433f3c07d46
|
||
msgid ""
|
||
"If you leave the ``PLUGINS`` setting as default (``None``), Pelican will "
|
||
"automatically discover namespace plugins and register them. If, on the "
|
||
"other hand, you specify a ``PLUGINS`` setting as a list of plugins, this "
|
||
"auto-discovery will be disabled. At that point, only the plugins you "
|
||
"specify will be registered, and you must explicitly list any namespace "
|
||
"plugins as well."
|
||
msgstr ""
|
||
"若将 ``PLUGINS`` 配置项设为默认的 ``None`` ,Pelican会自动发现命名空间中的插件并且将他们全部加载;若你在 "
|
||
"``PLUGINS`` 设置项中指定了一系列的插件,Pelican就不会去自动发现插件,也就是说,你需要显式地指定所有要使用的插件。"
|
||
|
||
#: ../../plugins.rst:26 a9675be841b84df584e67087cd23ab34
|
||
msgid ""
|
||
"If you are using the ``PLUGINS`` setting, you can specify plugins in two "
|
||
"ways. The first method specifies plugins as a list of strings. Namespace "
|
||
"plugins can be specified either by their full names "
|
||
"(``pelican.plugins.myplugin``) or by their short names (``myplugin``)::"
|
||
msgstr ""
|
||
"在配置 ``PLUGINS`` 时,有两种方式。一是用字符串列表指定插件的名称,可以是包含命名空间的完整名称(例如 "
|
||
"``pelican.plugins.myplugin`` ),也可以是简短名称( ``myplugin``):"
|
||
|
||
#: ../../plugins.rst:35 188bf617180b4a7b9bc09f3fb1c201ae
|
||
msgid ""
|
||
"Alternatively, you can import them in your settings file and pass the "
|
||
"modules::"
|
||
msgstr "二是在设置文件中先import进来,再将import进的模块放在 ``PLUGINS`` 设置项中:"
|
||
|
||
#: ../../plugins.rst:43 2d5db874810245a98b59ab080a0df1a5
|
||
msgid ""
|
||
"When experimenting with different plugins (especially the ones that deal "
|
||
"with metadata and content) caching may interfere and the changes may not "
|
||
"be visible. In such cases disable caching with ``LOAD_CONTENT_CACHE = "
|
||
"False`` or use the ``--ignore-cache`` command-line switch."
|
||
msgstr ""
|
||
"在尝试不同的插件时(尤其是那些处理元数据和内容的插件),缓存可能会相互干扰,一些更改不会生效。发生这种情况时,就需要通过设置 "
|
||
"``LOAD_CONTENT_CACHE = False`` 或使用 ``--ignore-cache`` 命令行选项禁用缓存。"
|
||
|
||
#: ../../plugins.rst:48 7421f93c1d714c9c853fc9311681515a
|
||
msgid ""
|
||
"If your plugins are not in an importable path, you can specify a list of "
|
||
"paths via the ``PLUGIN_PATHS`` setting. As shown in the following "
|
||
"example, paths in the ``PLUGIN_PATHS`` list can be absolute or relative "
|
||
"to the settings file::"
|
||
msgstr ""
|
||
"如果插件处于无法直接进行import的路径,可以在 ``PLUGIN_PATHS`` 配置项中指定这些路径。如下例所示, "
|
||
"``PLUGIN_PATHS`` 中的路径可以是绝对的,也可以是相对于设置文件的:"
|
||
|
||
#: ../../plugins.rst:56 b8406038d0284d3fbef9d3de1fa7fd9f
|
||
msgid "Where to find plugins"
|
||
msgstr "在哪儿下载插件"
|
||
|
||
#: ../../plugins.rst:57 b07653ce77194a998630a55ae9511de5
|
||
msgid ""
|
||
"Namespace plugins can be found in the `pelican-plugins organization`_ as "
|
||
"individual repositories. Legacy plugins are located in the `pelican-"
|
||
"plugins repository`_ and will be gradually phased out in favor of the "
|
||
"namespace versions."
|
||
msgstr ""
|
||
"新的命名空间插件可以在GitHub的 `pelican-plugins 组织`_ "
|
||
"中找到,每个插件都是一个独立的仓库。而老的插件则可以在GitHub的 `pelican-plugins 仓库`_ "
|
||
"中找到。这些老的插件会逐步淘汰并转移到新的命名空间版本。"
|
||
|
||
#: ../../plugins.rst:65 5c55fa6f3d664be2a49b8256dc2f6a2e
|
||
msgid ""
|
||
"Please note that while we do our best to review and maintain these "
|
||
"plugins, they are submitted by the Pelican community and thus may have "
|
||
"varying levels of support and interoperability."
|
||
msgstr "请注意,尽管我们尽全力审查和维护这些插件,但这些插件是Pelican社区提交的,因此支持性和互操作性程度各不相同。"
|
||
|
||
#: ../../plugins.rst:70 25339a713a97492c88b0e60024ac34b8
|
||
msgid "How to create plugins"
|
||
msgstr "如何创建插件"
|
||
|
||
#: ../../plugins.rst:72 62b6b4a1a5f0486e8b3a39d6a7050f0a
|
||
msgid ""
|
||
"Plugins are based on the concept of signals. Pelican sends signals, and "
|
||
"plugins subscribe to those signals. The list of available signals is "
|
||
"documented in a subsequent section."
|
||
msgstr "插件是基于信号这一概念的。Pelican会发送信号,插件则订阅这些信号。可用的信号在下一节会贴出来。"
|
||
|
||
#: ../../plugins.rst:76 f8f74b0257be46a1878e72e126166bd0
|
||
msgid ""
|
||
"The only rule to follow for plugins is to define a ``register`` callable,"
|
||
" in which you map the signals to your plugin logic. Let's take a simple "
|
||
"example::"
|
||
msgstr ""
|
||
"对于插件来说,唯一需要遵循的规则就是一定要定义一个可调用的 ``register`` ,在 ``register`` "
|
||
"中需要将信号映射到插件逻辑上。下面是一个简单的例子:"
|
||
|
||
#: ../../plugins.rst:93 163eebc74421416da2ad497830c42771
|
||
msgid ""
|
||
"Signal receivers are weakly-referenced and thus must not be defined "
|
||
"within your ``register`` callable or they will be garbage-collected "
|
||
"before the signal is emitted."
|
||
msgstr "信号接收器在Pelican中是弱引用的,因此不能将它定义在可调用的 ``register`` 中,否则接收器在信号发送之前就会被回收。"
|
||
|
||
#: ../../plugins.rst:97 bb63bd2d24e341a1a4f7dfa118648d9a
|
||
msgid ""
|
||
"If multiple plugins connect to the same signal, plugins will be invoked "
|
||
"in the order they are registered. When the ``PLUGINS`` setting is "
|
||
"defined, plugin invocation order will be the order in which the plugins "
|
||
"are listed in the ``PLUGINS`` setting. If you rely on auto-discovered "
|
||
"namespace plugins and have no ``PLUGINS`` setting defined, plugins will "
|
||
"be invoked in the same order that they are discovered (the same order as "
|
||
"listed in the output of the ``pelican-plugins`` command). If you want to "
|
||
"specify the order explicitly, disable auto-discovery by defining "
|
||
"``PLUGINS`` in the desired order."
|
||
msgstr ""
|
||
"对于关联到同一个信号的多个插件,将按照它们注册的前后顺序执行。但若设置了 ``PLUGINS`` "
|
||
"配置项,则会以此配置项中的顺序为准。如果您使用了无需PLUGINS设置的新版命名空间插件,它们将按照被探测到的顺序进行连接(与 pelican-"
|
||
"plugins 输出的顺序相同)。若您此时仍想要显式指定顺序,设置 ``PLUGINS`` 配置项即可。"
|
||
|
||
#: ../../plugins.rst:107 062aa3a3402141cfbd376d4fee1b5b34
|
||
msgid "Namespace plugin structure"
|
||
msgstr "命名空间插件的结构"
|
||
|
||
#: ../../plugins.rst:109 e6968290620d4de3b71ff62d5abba91f
|
||
msgid ""
|
||
"Namespace plugins must adhere to a certain structure in order to function"
|
||
" properly. They need to be installable (i.e. contain ``setup.py`` or "
|
||
"equivalent) and have a folder structure as follows::"
|
||
msgstr "命名空间插件必须遵循特定的结构才能正常工作。这些插件需要是可安装的(即包含 ``setup.py`` 或其他等效文件),并且遵循下述文件夹结构:"
|
||
|
||
#: ../../plugins.rst:122 b9782f71fae14bce9854b8b5056407d8
|
||
msgid ""
|
||
"It is crucial that ``pelican`` or ``pelican/plugins`` folder **not** "
|
||
"contain an ``__init__.py`` file. In fact, it is best to have those "
|
||
"folders empty besides the listed folders in the above structure and keep "
|
||
"your plugin related files contained solely in the "
|
||
"``pelican/plugins/myplugin`` folder to avoid any issues."
|
||
msgstr ""
|
||
"非常关键的一点就是, ``pelican`` 和 ``pelican/plugins`` 文件夹下都 **不能** 包含 "
|
||
"``__init__.py`` 文件。事实上,这两个文件夹下最好是只有上面列出的文件夹,并且保证与插件相关的文件都仅包含在 "
|
||
"``pelican/plugins/myplugin`` 文件夹中,以避免奇奇怪怪的问题。"
|
||
|
||
#: ../../plugins.rst:128 8440bc91329c498c90fadab556391a84
|
||
msgid ""
|
||
"To easily set up the proper structure, a `cookiecutter template for "
|
||
"plugins`_ is provided. Refer to that project's README for instructions on"
|
||
" how to use it."
|
||
msgstr "为了让大家更容易就能建立正确的结构,我们为插件提供了一个 `cookiecutter模板`_ ,使用方法参考此项目README文件中的指示即可。"
|
||
|
||
#: ../../plugins.rst:134 bb029c6c9ea14a2dac684d516fb9a1eb
|
||
msgid "List of signals"
|
||
msgstr "信号列表"
|
||
|
||
#: ../../plugins.rst:136 968d92d9b3bb4491ad9c0e4a015e73f9
|
||
msgid "Here is the list of currently implemented signals:"
|
||
msgstr "下面是目前已经实现了的信号:"
|
||
|
||
#: ../../plugins.rst:139 f2db011f146d40bf9f07ec6b09c7c6d0
|
||
msgid "Signal"
|
||
msgstr "信号"
|
||
|
||
#: ../../plugins.rst:139 32f683cb25c74315ac803c62868bd7b2
|
||
msgid "Arguments"
|
||
msgstr "参数"
|
||
|
||
#: ../../plugins.rst:139 d02ae4c30dec40ae8bd894fda051562d
|
||
msgid "Description"
|
||
msgstr "描述"
|
||
|
||
#: ../../plugins.rst:141 d526b9cb6c3c409f9b2d243082dfbdc3
|
||
msgid "initialized"
|
||
msgstr "initialized"
|
||
|
||
#: ../../plugins.rst:141 ../../plugins.rst:142 ../../plugins.rst:160
|
||
#: ../../plugins.rst:163 0ab3e30cf009477980c4c619e0a7dc5e
|
||
#: 8cf4a2d70a234250a4d9f63e4e8cb49f a600f769faef42d99333442745c7b498
|
||
#: a69e7ba2df7a47658b2f0e4ade60d455
|
||
msgid "pelican object"
|
||
msgstr "pelican object"
|
||
|
||
#: ../../plugins.rst:142 3aff44965eec41269a45fd0b84b8b5d7
|
||
msgid "finalized"
|
||
msgstr "finalized"
|
||
|
||
#: ../../plugins.rst:142 6a3bd6c773b245af9151ff5669ef7f84
|
||
msgid ""
|
||
"invoked after all the generators are executed and just before pelican "
|
||
"exits useful for custom post processing actions, such as: - minifying "
|
||
"js/css assets. - notify/ping search engines with an updated sitemap."
|
||
msgstr "所有generator执行完成后调用,即pelican退出之前。这对于自定义后处理操作是非常有用的,例如可以简化js/css资源、向搜索引擎告知更新后的sitemap。"
|
||
|
||
#: ../../plugins.rst:146 eecb5a5dc1b84f94a830db617122f365
|
||
msgid "generator_init"
|
||
msgstr "generator_init"
|
||
|
||
#: ../../plugins.rst:146 b01311f8da704b55b38e23149c60bc22
|
||
msgid "generator"
|
||
msgstr "generator"
|
||
|
||
#: ../../plugins.rst:146 a3c477e7a8d04e94af4ee7a82c873ef2
|
||
msgid "invoked in the Generator.__init__"
|
||
msgstr "在Generator.__init__中调用"
|
||
|
||
#: ../../plugins.rst:147 246a49eb99d34589ac409e5613f27069
|
||
msgid "all_generators_finalized"
|
||
msgstr "all_generators_finalized"
|
||
|
||
#: ../../plugins.rst:147 0dafe1a8f7224b1bbe1af3ebeeac0b31
|
||
msgid "generators"
|
||
msgstr "generators"
|
||
|
||
#: ../../plugins.rst:147 9d5130f91ac748e58d96cfba7711e8f6
|
||
msgid "invoked after all the generators are executed and before writing output"
|
||
msgstr "在所有generator执行完后,写入输出内容前调用,"
|
||
|
||
#: ../../plugins.rst:148 3a7f543549164bb684f47daa5b1b9bd1
|
||
msgid "readers_init"
|
||
msgstr "readers_init"
|
||
|
||
#: ../../plugins.rst:148 0946829014734c53a0b1e389df853daf
|
||
msgid "readers"
|
||
msgstr "readers"
|
||
|
||
#: ../../plugins.rst:148 380ba486fff24555b3c312bee4645d23
|
||
msgid "invoked in the Readers.__init__"
|
||
msgstr "在Readers.__init__中调用"
|
||
|
||
#: ../../plugins.rst:149 ../../plugins.rst:203 04aa2b44a0b84da9b62b952b627a2b5c
|
||
#: e725d629327b48e3a7dffad1d07d81d2
|
||
msgid "article_generator_context"
|
||
msgstr "article_generator_context"
|
||
|
||
#: ../../plugins.rst:149 f0c440ead7fc46e2a90685c3fdffb5d4
|
||
msgid "article_generator, metadata"
|
||
msgstr "article_generator, metadata"
|
||
|
||
#: ../../plugins.rst:150 ../../plugins.rst:205 2ed41de1aaed481195aeacbc841459be
|
||
#: e9e159b6d49d4cd29ebbe6eb6e0bb3b1
|
||
msgid "article_generator_preread"
|
||
msgstr "article_generator_preread"
|
||
|
||
#: ../../plugins.rst:150 ../../plugins.rst:152 ../../plugins.rst:153
|
||
#: ../../plugins.rst:156 37277bd83e254f47b6df91ba6790f79e
|
||
#: 9d3b745b96114ff7931cbcc372901c3e b89f87d254984ec59e25045227c708bf
|
||
#: d38f0e2931b84b82adcc5aca5a4c2233
|
||
msgid "article_generator"
|
||
msgstr "article_generator"
|
||
|
||
#: ../../plugins.rst:150 7a45243569e84c1e9d5d49b5c1a7b86a
|
||
msgid ""
|
||
"invoked before a article is read in ArticlesGenerator.generate_context; "
|
||
"use if code needs to do something before every article is parsed"
|
||
msgstr "在ArticlesGenerator.generate_context读取文章之前调用;若代码需要在解析每篇文章前执行某些操作,就可以使用此信号。"
|
||
|
||
#: ../../plugins.rst:152 87c8e4ad4a104cb889172025f1b0229b
|
||
msgid "article_generator_init"
|
||
msgstr "article_generator_init"
|
||
|
||
#: ../../plugins.rst:152 46c1e5fbb90a4668afda3d66e4520689
|
||
msgid "invoked in the ArticlesGenerator.__init__"
|
||
msgstr "在ArticlesGenerator.__init__中调用"
|
||
|
||
#: ../../plugins.rst:153 de4b631d41e946c485ebb813e3dd6b62
|
||
msgid "article_generator_pretaxonomy"
|
||
msgstr "article_generator_pretaxonomy"
|
||
|
||
#: ../../plugins.rst:153 697a45a251fe4188b1f32cec631427b9
|
||
msgid ""
|
||
"invoked before categories and tags lists are created useful when e.g. "
|
||
"modifying the list of articles to be generated so that removed articles "
|
||
"are not leaked in categories or tags"
|
||
msgstr "在创建类别和标签列表之前调用。例如,当需要变更要生成的文章列表时可以使用,如此可以避免一些已移除文章在分类或标签列表中泄露。"
|
||
|
||
#: ../../plugins.rst:156 ../../plugins.rst:204 051dcac75cbf4f5ea3a665e6da642324
|
||
#: 2360e283fdd142ab8d65792581522e72
|
||
msgid "article_generator_finalized"
|
||
msgstr "article_generator_finalized"
|
||
|
||
#: ../../plugins.rst:156 0c3c808d5b7044018f8566ccc6dd3010
|
||
msgid "invoked at the end of ArticlesGenerator.generate_context"
|
||
msgstr "在ArticlesGenerator.generate_context的最后调用"
|
||
|
||
#: ../../plugins.rst:157 60d78048da4843a7a0307218c078d151
|
||
msgid "article_generator_write_article"
|
||
msgstr "article_generator_write_article"
|
||
|
||
#: ../../plugins.rst:157 2ac0d0e7306a4d5086bb2e8b7b17ffb1
|
||
msgid "article_generator, content"
|
||
msgstr "article_generator, content"
|
||
|
||
#: ../../plugins.rst:157 565551e010964925b10a3b5734913119
|
||
msgid "invoked before writing each article, the article is passed as content"
|
||
msgstr "在写入每篇文章前调用,文章以内容的形式作为参数传入。"
|
||
|
||
#: ../../plugins.rst:158 fd7918c3200f4714b028c8d0a200df98
|
||
msgid "article_writer_finalized"
|
||
msgstr "article_writer_finalized"
|
||
|
||
#: ../../plugins.rst:158 e54633543dbf4e5fb2dd4c1bfc09b1c1
|
||
msgid "article_generator, writer"
|
||
msgstr "article_generator, writer"
|
||
|
||
#: ../../plugins.rst:158 965e61a0fd6347faa2d7224a50a98b76
|
||
msgid ""
|
||
"invoked after all articles and related pages have been written, but "
|
||
"before the article generator is closed."
|
||
msgstr "在所有文章及相关联页面写入完成后,在文章generator关闭前调用。"
|
||
|
||
#: ../../plugins.rst:160 30df01c5c11a4ed58b006d78b007c68d
|
||
msgid "get_generators"
|
||
msgstr "get_generators"
|
||
|
||
#: ../../plugins.rst:160 758447f5e55a4738a14486b0e962034d
|
||
msgid ""
|
||
"invoked in Pelican.get_generator_classes, can return a Generator, or "
|
||
"several generators in a tuple or in a list."
|
||
msgstr "在Pelican.get_generator_classes中调用,可以返回一个Generator,也可以以一个元组或列表的形式返回多个generator。"
|
||
|
||
#: ../../plugins.rst:163 730e948388a24435be216830e0af5be6
|
||
msgid "get_writer"
|
||
msgstr "get_writer"
|
||
|
||
#: ../../plugins.rst:163 df9f9fef24984c4bad07b8834e79352f
|
||
msgid "invoked in Pelican.get_writer, can return a custom Writer."
|
||
msgstr "在Pelican.get_writer前调用,可以返回一个自定义Writer。"
|
||
|
||
#: ../../plugins.rst:165 ../../plugins.rst:206 1c172b26e92543d2be488a88cceaf576
|
||
#: 252231854c504621b28243dfba9d88ab
|
||
msgid "page_generator_context"
|
||
msgstr "page_generator_context"
|
||
|
||
#: ../../plugins.rst:165 a830e240c6564552ba4952bc657120a9
|
||
msgid "page_generator, metadata"
|
||
msgstr "page_generator, metadata"
|
||
|
||
#: ../../plugins.rst:166 ../../plugins.rst:207 09add2ea39344ad8936296a07cfd8e82
|
||
#: 0fc3cf365d9d418b8225e8f1f5da76d0
|
||
msgid "page_generator_preread"
|
||
msgstr "page_generator_preread"
|
||
|
||
#: ../../plugins.rst:166 ../../plugins.rst:168 ../../plugins.rst:169
|
||
#: 3c31cfe2f4744cd987f1638a4b82e5de a80ec8c388cb477abbcfc4f558d34df7
|
||
#: d485c4f9c2c443748234827727cc887e
|
||
msgid "page_generator"
|
||
msgstr "page_generator"
|
||
|
||
#: ../../plugins.rst:166 4d8b96aa6ebf47d885cd978c336679ff
|
||
msgid ""
|
||
"invoked before a page is read in PageGenerator.generate_context; use if "
|
||
"code needs to do something before every page is parsed."
|
||
msgstr "在PageGenerator.generate_context读取页面前调用,若代码需要在解析每个页面前执行某些操作,就可以使用此信号。"
|
||
|
||
#: ../../plugins.rst:168 ../../plugins.rst:209 06adf06d2b204100b9f80850b84bdff0
|
||
#: c0988434a401410e8cf6b4528e6d2870
|
||
msgid "page_generator_init"
|
||
msgstr "page_generator_init"
|
||
|
||
#: ../../plugins.rst:168 d359da10912949fa999dc3ad5215be66
|
||
msgid "invoked in the PagesGenerator.__init__"
|
||
msgstr "在PagesGenerator.__init__中调用"
|
||
|
||
#: ../../plugins.rst:169 ../../plugins.rst:208 0994b38b87704caea04ef0671a7b1c67
|
||
#: a97cf5f236a64959aa09838dbe03dfdc
|
||
msgid "page_generator_finalized"
|
||
msgstr "page_generator_finalized"
|
||
|
||
#: ../../plugins.rst:169 4cfdfe952daf4e3ea5ea1c8b2cf7a664
|
||
msgid "invoked at the end of PagesGenerator.generate_context"
|
||
msgstr "在PagesGenerator.generate_context的最后调用"
|
||
|
||
#: ../../plugins.rst:170 7e2504584a1b4fa4ae88c5002bcbb26f
|
||
msgid "page_generator_write_page"
|
||
msgstr "page_generator_write_page"
|
||
|
||
#: ../../plugins.rst:170 ea204a5fe703472ea5afea283135b94d
|
||
msgid "page_generator, content"
|
||
msgstr "page_generator, content"
|
||
|
||
#: ../../plugins.rst:170 22dd198fe6dc498f944e2c0e2c595c6c
|
||
msgid "invoked before writing each page, the page is passed as content"
|
||
msgstr "在写入每个页面前调用,页面以内容形式作为参数传入"
|
||
|
||
#: ../../plugins.rst:171 84d5def2c4fc4a2489d2b4fc1fa445df
|
||
msgid "page_writer_finalized"
|
||
msgstr "page_writer_finalized"
|
||
|
||
#: ../../plugins.rst:171 c55d65276a4e49c58c34d12cc062c90d
|
||
msgid "page_generator, writer"
|
||
msgstr "page_generator, writer"
|
||
|
||
#: ../../plugins.rst:171 b2a3d1c7c2864a08829833bc16b3223e
|
||
msgid ""
|
||
"invoked after all pages have been written, but before the page generator "
|
||
"is closed."
|
||
msgstr "调用于所有页面写入完成后,在页面generator关闭前。"
|
||
|
||
#: ../../plugins.rst:173 ../../plugins.rst:210 097c5b3dc1d34a5eb7c1b4ae67179b3e
|
||
#: a420152f887e4977bdd26a5fa7230915
|
||
msgid "static_generator_context"
|
||
msgstr "static_generator_context"
|
||
|
||
#: ../../plugins.rst:173 1bbacfe960644e4a902b9c866e3fffce
|
||
msgid "static_generator, metadata"
|
||
msgstr "static_generator, metadata"
|
||
|
||
#: ../../plugins.rst:174 ../../plugins.rst:211 c1242bcf76fc40568f67a2ce4e70c0bb
|
||
#: f407aa94870645c891bb349edc3ae9a4
|
||
msgid "static_generator_preread"
|
||
msgstr "static_generator_preread"
|
||
|
||
#: ../../plugins.rst:174 ../../plugins.rst:177 ../../plugins.rst:178
|
||
#: 36f5be5c982b42d097c0465f542e490f cf0ebefd743246dd9db1b37a8c6a43a8
|
||
#: d5cd54887d904bcca02b0df4f22580e9
|
||
msgid "static_generator"
|
||
msgstr "static_generator"
|
||
|
||
#: ../../plugins.rst:174 1b2fbadf156644429e66ad2e64d26658
|
||
msgid ""
|
||
"invoked before a static file is read in StaticGenerator.generate_context;"
|
||
" use if code needs to do something before every static file is added to "
|
||
"the staticfiles list."
|
||
msgstr "在StaticGenerator.generate_context读取静态文件前调用,若代码需要在每个静态文件加入静态文件列表前进行一些修改,就可以使用此信号。"
|
||
|
||
#: ../../plugins.rst:177 654377fe53434f77b3ba294b5689d1d4
|
||
msgid "static_generator_init"
|
||
msgstr "static_generator_init"
|
||
|
||
#: ../../plugins.rst:177 e9b3cbbde7a6443a81d025d1a4fe6145
|
||
msgid "invoked in the StaticGenerator.__init__"
|
||
msgstr "在StaticGenerator.__init__中调用"
|
||
|
||
#: ../../plugins.rst:178 202be739e43444f48f122d3e5f657a45
|
||
msgid "static_generator_finalized"
|
||
msgstr "static_generator_finalized"
|
||
|
||
#: ../../plugins.rst:178 06080672fd614d39a79aa6d3a783087f
|
||
msgid "invoked at the end of StaticGenerator.generate_context"
|
||
msgstr "在StaticGenerator.generate_context的最后调用"
|
||
|
||
#: ../../plugins.rst:179 ce174fb4533143518c13b16ab6dbe4c8
|
||
msgid "content_object_init"
|
||
msgstr "content_object_init"
|
||
|
||
#: ../../plugins.rst:179 5089a38bad1447cab62f350df8e76f31
|
||
msgid "content_object"
|
||
msgstr "content_object"
|
||
|
||
#: ../../plugins.rst:179 d105f652be424f5cad8bfaf7be69ec4b
|
||
msgid "invoked at the end of Content.__init__"
|
||
msgstr "在Content.__init__的最后调用"
|
||
|
||
#: ../../plugins.rst:180 dbda8a11bca744a4ba5fc51d044f1d6e
|
||
msgid "content_written"
|
||
msgstr "content_written"
|
||
|
||
#: ../../plugins.rst:180 c8ba95ebcc2e4c79ae79717a730fe504
|
||
msgid "path, context"
|
||
msgstr "path, context"
|
||
|
||
#: ../../plugins.rst:180 6d9caed8fa24400a86f8ede1c3ecb260
|
||
msgid "invoked each time a content file is written."
|
||
msgstr "每一次内容文件写入后调用。"
|
||
|
||
#: ../../plugins.rst:181 73a4265b050c4b32be186bb2cec59f30
|
||
msgid "feed_generated"
|
||
msgstr "feed_generated"
|
||
|
||
#: ../../plugins.rst:181 78fa3603986f417286f2e7440f5aff57
|
||
msgid "context, feed"
|
||
msgstr "context, feed"
|
||
|
||
#: ../../plugins.rst:181 13dcd9e5fb2f408db72b87b88877596b
|
||
msgid ""
|
||
"invoked each time a feed gets generated. Can be used to modify a feed "
|
||
"object before it gets written."
|
||
msgstr "每个feed生成前调用。可以用于在feed写入前修改之。"
|
||
|
||
#: ../../plugins.rst:183 3a959768d5704e459940cbfcf8e1459c
|
||
msgid "feed_written"
|
||
msgstr "feed_written"
|
||
|
||
#: ../../plugins.rst:183 86844bee049a445e87db283bdf325338
|
||
msgid "path, context, feed"
|
||
msgstr "path, context, feed"
|
||
|
||
#: ../../plugins.rst:183 e79185da7cb54bf5aa59a46846222391
|
||
msgid "invoked each time a feed file is written."
|
||
msgstr "每一个feed文件写入后调用。"
|
||
|
||
#: ../../plugins.rst:188 0fe0539bad1c4fcbbebbdaa98d328ee9
|
||
msgid ""
|
||
"Avoid ``content_object_init`` signal if you intend to read ``summary`` or"
|
||
" ``content`` properties of the content object. That combination can "
|
||
"result in unresolved links when :ref:`ref-linking-to-internal-content` "
|
||
"(see `pelican-plugins bug #314`_). Use ``_summary`` and ``_content`` "
|
||
"properties instead, or, alternatively, run your plugin at a later stage "
|
||
"(e.g. ``all_generators_finalized``)."
|
||
msgstr ""
|
||
"请避免使用 ``content_object_init`` 信号读取content对象的 ``summary`` 或 ``content`` "
|
||
"属性,这可能导致在 :ref:`ref-linking-to-internal-content` 时无法解析链接(请参阅 `pelican-"
|
||
"plugins bug #314`_ )。请改用 ``_summary`` 和 ``_content`` 属性,或者就在后续阶段再运行插件(例如 "
|
||
"``all_generators_finalized`` 时)。"
|
||
|
||
#: ../../plugins.rst:197 77ca681d0d7a4a9ea42f7eebf683f024
|
||
msgid ""
|
||
"After Pelican 3.2, signal names were standardized. Older plugins may "
|
||
"need to be updated to use the new names:"
|
||
msgstr "Pelican3.2之后,信号名都进行了标准化,较老的插件可能需要进行更新:"
|
||
|
||
#: ../../plugins.rst:201 c83f9215c5964ba49cb5ed849c777495
|
||
msgid "Old name"
|
||
msgstr "旧名称"
|
||
|
||
#: ../../plugins.rst:201 167435de345b443fa51c27b355121e14
|
||
msgid "New name"
|
||
msgstr "新名称"
|
||
|
||
#: ../../plugins.rst:203 bcdf136cbb2c4dedbd90f6e56f584c6b
|
||
msgid "article_generate_context"
|
||
msgstr "article_generate_context"
|
||
|
||
#: ../../plugins.rst:204 60fe5b91f4a54f0997f93d927b0d81c4
|
||
msgid "article_generate_finalized"
|
||
msgstr "article_generate_finalized"
|
||
|
||
#: ../../plugins.rst:205 31252537627f4042b7f7b4e0a4a33aeb
|
||
msgid "article_generate_preread"
|
||
msgstr "article_generate_preread"
|
||
|
||
#: ../../plugins.rst:206 719da4844a0a4b6fbb2cf2d9b7e51deb
|
||
msgid "pages_generate_context"
|
||
msgstr "pages_generate_context"
|
||
|
||
#: ../../plugins.rst:207 f7c865fd6824473aad024fc606235b48
|
||
msgid "pages_generate_preread"
|
||
msgstr "pages_generate_preread"
|
||
|
||
#: ../../plugins.rst:208 74c47460bacf4fd68f2536580efb1480
|
||
msgid "pages_generator_finalized"
|
||
msgstr "pages_generator_finalized"
|
||
|
||
#: ../../plugins.rst:209 b403e7f978c24d989d99587579f31d3c
|
||
msgid "pages_generator_init"
|
||
msgstr "pages_generator_init"
|
||
|
||
#: ../../plugins.rst:210 94e5184530c94cc48d00fd819fffd649
|
||
msgid "static_generate_context"
|
||
msgstr "static_generate_context"
|
||
|
||
#: ../../plugins.rst:211 00ca2c730ad840f584d3f9dd30daf0cd
|
||
msgid "static_generate_preread"
|
||
msgstr "static_generate_preread"
|
||
|
||
#: ../../plugins.rst:215 f8044e028ccd4d64954e24375a739cd2
|
||
msgid "Recipes"
|
||
msgstr "具体使用方法举例"
|
||
|
||
#: ../../plugins.rst:217 0c441d12047240199025f2d3ac954167
|
||
msgid ""
|
||
"We eventually realised some of the recipes to create plugins would be "
|
||
"best shared in the documentation somewhere, so here they are!"
|
||
msgstr "下面分享了一些创建插件的具体方法,请享用!"
|
||
|
||
#: ../../plugins.rst:221 bb96f2da7b3340cb9ed56ee1ad59796b
|
||
msgid "How to create a new reader"
|
||
msgstr "如何创建一个新的reader"
|
||
|
||
#: ../../plugins.rst:223 49dbbbd2c5ca4798a1b9d67b48630d36
|
||
msgid ""
|
||
"One thing you might want is to add support for your very own input "
|
||
"format. While it might make sense to add this feature in Pelican core, we"
|
||
" wisely chose to avoid this situation and instead have the different "
|
||
"readers defined via plugins."
|
||
msgstr "你可能需要添加对输入文件格式的特殊支持。这似乎可以作为Pelican核心的一个功能,但我们选择避免将此功能放在核心中,而是通过插件实现不同的reader。"
|
||
|
||
#: ../../plugins.rst:228 af8936c711204a0aa7c85835124065c5
|
||
msgid ""
|
||
"The rationale behind this choice is mainly that plugins are really easy "
|
||
"to write and don't slow down Pelican itself when they're not active."
|
||
msgstr "做出这个决定主要是因为实现这样的格式支持插件非常容易,而且这样在不需要此功能时也不会影响Pelican自身的速度。"
|
||
|
||
#: ../../plugins.rst:231 11dac8bd71994c18a289086ec95a0273
|
||
msgid "No more talking — here is an example::"
|
||
msgstr "多说无益,下面是一个具体例子:"
|
||
|
||
#: ../../plugins.rst:267 f6bf903ae8de4ac183ecea699de568dc
|
||
msgid "Adding a new generator"
|
||
msgstr "添加新的generator"
|
||
|
||
#: ../../plugins.rst:269 50d39b45550446a493a6d5d6eb971103
|
||
msgid ""
|
||
"Adding a new generator is also really easy. You might want to have a look"
|
||
" at :doc:`internals` for more information on how to create your own "
|
||
"generator."
|
||
msgstr "添加一个generator也非常简单,你可能会想要看一看 :doc:`internals` ,其中有关于如何创建generator的内容。"
|
||
|
||
#: ../../plugins.rst:283 1b4bc8c2b02645dd81b06ffdbd759c36
|
||
msgid "Adding a new writer"
|
||
msgstr "添加新的writer"
|
||
|
||
#: ../../plugins.rst:285 ac526121b895429d8412605bca594684
|
||
msgid ""
|
||
"Adding a writer will allow you to output additional file formats to disk,"
|
||
" or change how the existing formats are written to disk. Note that only "
|
||
"one writer will be active at a time, so be sure to either subclass the "
|
||
"built-in Writer, or completely re-implement it."
|
||
msgstr "添加writer可以让你将其他文件格式输出到磁盘,或者可以改变现有格式写入磁盘的方式。请注意,一次只能启用一个writer,因此请确保继承了内置的Writer,并且完全重新实现之。"
|
||
|
||
#: ../../plugins.rst:290 4335016710cd417ca9b8068cb7a45d51
|
||
msgid "Here is a basic example of how to set up your own writer::"
|
||
msgstr "下面是启用你的自定义writer的一个基本例子:"
|
||
|
||
#: ../../plugins.rst:310 c65b371d4bf740c49dfe190407c9af69
|
||
msgid "Using Plugins to Inject Content"
|
||
msgstr "使用插件添加内容"
|
||
|
||
#: ../../plugins.rst:312 9f180f86d09f43d7aff4607bb7deb6f1
|
||
msgid ""
|
||
"You can programmatically inject articles or pages using plugins. This can"
|
||
" be useful if you plan to fetch articles from an API, for example."
|
||
msgstr "可以通过插件以可编程的方式添加文章或页面。如果你打算从某些API获取文章,这就会很有用。"
|
||
|
||
#: ../../plugins.rst:315 a65dd6bb4d0e48438dcf6d545bfaa053
|
||
msgid ""
|
||
"Following is a simple example of how one can build a plugin that injects "
|
||
"a custom article, using the ``article_generator_pretaxonomy`` signal::"
|
||
msgstr "下面是一个简单的示例,说明了如何使用 ``article_generator_pretaxonomy`` 信号构建一个添加自定义文章的插件:"
|