| 1 |
# SOME DESCRIPTIVE TITLE. |
| 2 |
# Copyright (C) 2010–2024 |
| 3 |
# This file is distributed under the same license as the PELICAN package. |
| 4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024. |
| 5 |
# |
| 6 |
msgid "" |
| 7 |
msgstr "" |
| 8 |
"Project-Id-Version: PELICAN 4\n" |
| 9 |
"Report-Msgid-Bugs-To: \n" |
| 10 |
"POT-Creation-Date: 2024-06-24 19:06+0800\n" |
| 11 |
"PO-Revision-Date: 2024-06-26 19:00+0800\n" |
| 12 |
"Last-Translator: GeorgeHu <[email protected]>\n" |
| 13 |
"Language: zh_CN\n" |
| 14 |
"Language-Team: \n" |
| 15 |
"Plural-Forms: nplurals=1; plural=0;\n" |
| 16 |
"MIME-Version: 1.0\n" |
| 17 |
"Content-Type: text/plain; charset=utf-8\n" |
| 18 |
"Content-Transfer-Encoding: 8bit\n" |
| 19 |
"Generated-By: Babel 2.15.0\n" |
| 20 |
|
| 21 |
#: ../../plugins.rst:4 b1b40bca7d3748008eefe26806d5d5ef |
| 22 |
msgid "Plugins" |
| 23 |
msgstr "插件" |
| 24 |
|
| 25 |
#: ../../plugins.rst:6 42ca486828e4442a9d74216d0d8bb37d |
| 26 |
msgid "" |
| 27 |
"Beginning with version 3.0, Pelican supports plugins. Plugins are a way " |
| 28 |
"to add features to Pelican without having to directly modify the Pelican " |
| 29 |
"core." |
| 30 |
msgstr "" |
| 31 |
"Pelican从3.0版本开始支持插件。通过插件,不必直接修改Pelican的核心代码就可以给" |
| 32 |
"Pelican添加新功能。" |
| 33 |
|
| 34 |
#: ../../plugins.rst:10 6bb8ab4cb7eb44ddb1ed4734f47f6781 |
| 35 |
msgid "How to use plugins" |
| 36 |
msgstr "如何使用插件" |
| 37 |
|
| 38 |
#: ../../plugins.rst:12 822e0bd7ce2f4433a7c39b3accde01a1 |
| 39 |
msgid "" |
| 40 |
"Starting with version 4.5, Pelican moved to a new plugin structure " |
| 41 |
"utilizing namespace packages that can be easily installed via Pip_. " |
| 42 |
"Plugins supporting this structure will install under the namespace " |
| 43 |
"package ``pelican.plugins`` and can be automatically discovered by " |
| 44 |
"Pelican. To see a list of Pip-installed namespace plugins that are active" |
| 45 |
" in your environment, run::" |
| 46 |
msgstr "" |
| 47 |
"Pelican从4.5版本开始使用了一种全新的插件结构,利用了命名空间包," |
| 48 |
"并且可以轻松地通过 Pip_ 进行安装。支持此结构地插件都会被安装在命名空间包 " |
| 49 |
"``pelican.plugins`` 下,因此Pelican可以自动发现他们。下面的命令可以用于" |
| 50 |
"查看环境中用Pip安装的所有插件:" |
| 51 |
|
| 52 |
#: ../../plugins.rst:20 2b59c5d107dc4b118dc76116910e9495 |
| 53 |
msgid "" |
| 54 |
"If you leave the ``PLUGINS`` setting as default (``None``), Pelican will " |
| 55 |
"automatically discover namespace plugins and register them. If, on the " |
| 56 |
"other hand, you specify a ``PLUGINS`` setting as a list of plugins, this " |
| 57 |
"auto-discovery will be disabled. At that point, only the plugins you " |
| 58 |
"specify will be registered, and you must explicitly list any namespace " |
| 59 |
"plugins as well." |
| 60 |
msgstr "" |
| 61 |
"若将 ``PLUGINS`` 配置项设为默认的 ``None`` ,Pelican会自动发现命名空间中的" |
| 62 |
"插件并且将他们全部加载;若你在 ``PLUGINS`` 设置项中指定了一系列的插件," |
| 63 |
"Pelican就不会去自动发现插件,也就是说,你需要显式地指定所有要使用的插件。" |
| 64 |
|
| 65 |
#: ../../plugins.rst:26 52d1968196294569a478931f7022e686 |
| 66 |
msgid "" |
| 67 |
"If you are using the ``PLUGINS`` setting, you can specify plugins in two " |
| 68 |
"ways. The first method specifies plugins as a list of strings. Namespace " |
| 69 |
"plugins can be specified either by their full names " |
| 70 |
"(``pelican.plugins.myplugin``) or by their short names (``myplugin``)::" |
| 71 |
msgstr "" |
| 72 |
"在配置 ``PLUGINS`` 时,有两种方式。一是用字符串列表指定插件的名称,可以是包含" |
| 73 |
"命名空间的完整名称(例如 ``pelican.plugins.myplugin`` ),也可以是简短名称" |
| 74 |
"( ``myplugin``):" |
| 75 |
|
| 76 |
#: ../../plugins.rst:35 b2c75e52e66e4000968e744ffa4b89a9 |
| 77 |
msgid "" |
| 78 |
"Alternatively, you can import them in your settings file and pass the " |
| 79 |
"modules::" |
| 80 |
msgstr "" |
| 81 |
"二是在设置文件中先import进来,再将import进的模块放在 ``PLUGINS`` 设置项中:" |
| 82 |
|
| 83 |
#: ../../plugins.rst:43 88af9139373f4cd89fa5b958196c9448 |
| 84 |
msgid "" |
| 85 |
"When experimenting with different plugins (especially the ones that deal " |
| 86 |
"with metadata and content) caching may interfere and the changes may not " |
| 87 |
"be visible. In such cases disable caching with ``LOAD_CONTENT_CACHE = " |
| 88 |
"False`` or use the ``--ignore-cache`` command-line switch." |
| 89 |
msgstr "" |
| 90 |
"在尝试不同的插件时(尤其是那些处理元数据和内容的插件),缓存可能会相互干扰," |
| 91 |
"一些更改不会生效。发生这种情况时,就需要通过设置 ``LOAD_CONTENT_CACHE = False`` " |
| 92 |
"或使用 ``--ignore-cache`` 命令行选项禁用缓存。" |
| 93 |
|
| 94 |
#: ../../plugins.rst:48 d0e3cd59052c4a7d995fb5e1e15d9799 |
| 95 |
msgid "" |
| 96 |
"If your plugins are not in an importable path, you can specify a list of " |
| 97 |
"paths via the ``PLUGIN_PATHS`` setting. As shown in the following " |
| 98 |
"example, paths in the ``PLUGIN_PATHS`` list can be absolute or relative " |
| 99 |
"to the settings file::" |
| 100 |
msgstr "" |
| 101 |
"如果插件处于无法直接进行import的路径,可以在 ``PLUGIN_PATHS`` 配置项中指定这些路径。" |
| 102 |
"如下例所示, ``PLUGIN_PATHS`` 中的路径可以是绝对的,也可以是相对于设置文件的:" |
| 103 |
|
| 104 |
#: ../../plugins.rst:56 4c3de952a8514e5caea402392b911f0b |
| 105 |
msgid "Where to find plugins" |
| 106 |
msgstr "在哪儿下载插件" |
| 107 |
|
| 108 |
#: ../../plugins.rst:57 16173c9dceb0409f89964412dd7e71e9 |
| 109 |
msgid "" |
| 110 |
"Namespace plugins can be found in the `pelican-plugins organization`_ as " |
| 111 |
"individual repositories. Legacy plugins are located in the `pelican-" |
| 112 |
"plugins repository`_ and will be gradually phased out in favor of the " |
| 113 |
"namespace versions." |
| 114 |
msgstr "" |
| 115 |
"新的命名空间插件可以在GitHub的 `pelican-plugins 组织`_ 中找到,每个插件都是" |
| 116 |
"一个独立的仓库。而老的插件则可以在GitHub的 `pelican-plugins 仓库`_ 中找到。" |
| 117 |
"这些老的插件会逐步淘汰并转移到新的命名空间版本。" |
| 118 |
|
| 119 |
#: ../../plugins.rst:65 a30a9862112b47128f6e7b28c6836f27 |
| 120 |
msgid "" |
| 121 |
"Please note that while we do our best to review and maintain these " |
| 122 |
"plugins, they are submitted by the Pelican community and thus may have " |
| 123 |
"varying levels of support and interoperability." |
| 124 |
msgstr "" |
| 125 |
"请注意,尽管我们尽全力审查和维护这些插件,但这些插件是Pelican社区提交的," |
| 126 |
"因此支持性和互操作性程度各不相同。" |
| 127 |
|
| 128 |
#: ../../plugins.rst:70 f4e140c61c0f45ed8ac53dca3b05b1f1 |
| 129 |
msgid "How to create plugins" |
| 130 |
msgstr "如何创建插件" |
| 131 |
|
| 132 |
#: ../../plugins.rst:72 43013c6cf4f34ca09205e8dab0b9fa6d |
| 133 |
msgid "" |
| 134 |
"Plugins are based on the concept of signals. Pelican sends signals, and " |
| 135 |
"plugins subscribe to those signals. The list of available signals is " |
| 136 |
"documented in a subsequent section." |
| 137 |
msgstr "" |
| 138 |
"插件是基于信号这一概念的。Pelican会发送信号,插件则订阅这些信号。可用的信号" |
| 139 |
"在下一节会贴出来。" |
| 140 |
|
| 141 |
#: ../../plugins.rst:76 5377a966ab114a29acb61f79eadc632b |
| 142 |
msgid "" |
| 143 |
"The only rule to follow for plugins is to define a ``register`` callable," |
| 144 |
" in which you map the signals to your plugin logic. Let's take a simple " |
| 145 |
"example::" |
| 146 |
msgstr "" |
| 147 |
"对于插件来说,唯一需要遵循的规则就是一定要定义一个可调用的 ``register`` ," |
| 148 |
"在 ``register`` 中需要将信号映射到插件逻辑上。下面是一个简单的例子:" |
| 149 |
|
| 150 |
#: ../../plugins.rst:93 2217318326524c62804ec94e55a4ca20 |
| 151 |
msgid "" |
| 152 |
"Signal receivers are weakly-referenced and thus must not be defined " |
| 153 |
"within your ``register`` callable or they will be garbage-collected " |
| 154 |
"before the signal is emitted." |
| 155 |
msgstr "" |
| 156 |
"信号接收器在Pelican中是弱引用的,因此不能将它定义在可调用的 ``register`` 中," |
| 157 |
"否则接收器在信号发送之前就会被回收。" |
| 158 |
|
| 159 |
#: ../../plugins.rst:97 6731cc78478a46c5a0cb51a8cd477318 |
| 160 |
msgid "" |
| 161 |
"If multiple plugins connect to the same signal, plugins will be executed " |
| 162 |
"in the order they are connected. With ``PLUGINS`` setting, order will be " |
| 163 |
"as defined in the setting. If you rely on auto-discovered namespace " |
| 164 |
"plugins, no ``PLUGINS`` setting, they will be connected in the same order" |
| 165 |
" they are discovered (same order as ``pelican-plugins`` output). If you " |
| 166 |
"want to specify the order explicitly, disable auto-discovery by defining " |
| 167 |
"``PLUGINS`` in the desired order." |
| 168 |
msgstr "" |
| 169 |
"如果多个插件关联到同一个信号,插件将按照它们关联的前后顺序执行。但若设置了 " |
| 170 |
"``PLUGINS`` 配置项会以此配置项中的顺序为准。如果您使用了无需PLUGINS设置的新版" |
| 171 |
"命名空间插件,它们将按照被探测到的顺序进行连接(与 pelican-plugins 输出的顺序相同)。" |
| 172 |
|
| 173 |
#: ../../plugins.rst:105 6dad534cc0014b78a3638a91cc4a1120 |
| 174 |
msgid "Namespace plugin structure" |
| 175 |
msgstr "命名空间插件的结构" |
| 176 |
|
| 177 |
#: ../../plugins.rst:107 aa6f290c3f4d42558b684d0e3487af95 |
| 178 |
msgid "" |
| 179 |
"Namespace plugins must adhere to a certain structure in order to function" |
| 180 |
" properly. They need to be installable (i.e. contain ``setup.py`` or " |
| 181 |
"equivalent) and have a folder structure as follows::" |
| 182 |
msgstr "" |
| 183 |
"命名空间插件必须遵循特定的结构才能正常工作。这些插件需要是可安装的" |
| 184 |
"(即包含 ``setup.py`` 或其他等效文件),并且遵循下述文件夹结构:" |
| 185 |
|
| 186 |
#: ../../plugins.rst:120 b8d73cfdb5f042cca1705f97d693263d |
| 187 |
msgid "" |
| 188 |
"It is crucial that ``pelican`` or ``pelican/plugins`` folder **not** " |
| 189 |
"contain an ``__init__.py`` file. In fact, it is best to have those " |
| 190 |
"folders empty besides the listed folders in the above structure and keep " |
| 191 |
"your plugin related files contained solely in the " |
| 192 |
"``pelican/plugins/myplugin`` folder to avoid any issues." |
| 193 |
msgstr "" |
| 194 |
"非常关键的一点就是, ``pelican`` 和 ``pelican/plugins`` 文件夹下都 **不能** 包含 " |
| 195 |
"``__init__.py`` 文件。事实上,这两个文件夹下最好是只有上面列出的文件夹," |
| 196 |
"并且保证与插件相关的文件都仅包含在 ``pelican/plugins/myplugin`` 文件夹中," |
| 197 |
"以避免奇奇怪怪的问题。" |
| 198 |
|
| 199 |
#: ../../plugins.rst:126 c3f08ae8c0d7415098157bbd1c99ce08 |
| 200 |
msgid "" |
| 201 |
"To easily set up the proper structure, a `cookiecutter template for " |
| 202 |
"plugins`_ is provided. Refer to that project's README for instructions on" |
| 203 |
" how to use it." |
| 204 |
msgstr "" |
| 205 |
"为了让大家更容易就能建立正确的结构,我们为插件提供了一个 `cookiecutter模板`_ ," |
| 206 |
"使用方法参考此项目README文件中的指示即可。" |
| 207 |
|
| 208 |
#: ../../plugins.rst:132 c2321eec3dc84224918172c5040a259f |
| 209 |
msgid "List of signals" |
| 210 |
msgstr "信号列表" |
| 211 |
|
| 212 |
#: ../../plugins.rst:134 78c4cfefae7e412f8f6287da2e3c8d34 |
| 213 |
msgid "Here is the list of currently implemented signals:" |
| 214 |
msgstr "下面是目前已经实现了的信号:" |
| 215 |
|
| 216 |
#: ../../plugins.rst:137 7a3c3b8b0f114d54b497ab77b09dc558 |
| 217 |
msgid "Signal" |
| 218 |
msgstr "信号" |
| 219 |
|
| 220 |
#: ../../plugins.rst:137 781b5c11f87f43b9ba4b3e75bee696d0 |
| 221 |
msgid "Arguments" |
| 222 |
msgstr "参数" |
| 223 |
|
| 224 |
#: ../../plugins.rst:137 df7d14950fed44f4a4b93908aed36060 |
| 225 |
msgid "Description" |
| 226 |
msgstr "描述" |
| 227 |
|
| 228 |
#: ../../plugins.rst:139 598901e7cb5b49ac9acb5f148bf7c0e7 |
| 229 |
msgid "initialized" |
| 230 |
msgstr "initialized" |
| 231 |
|
| 232 |
#: ../../plugins.rst:139 ../../plugins.rst:140 ../../plugins.rst:158 |
| 233 |
#: ../../plugins.rst:161 4cedbf9ee7fb4c7abe20e15e4ee1c7fb |
| 234 |
#: 704ff7e1ddfc4eb3bd7798d25df1e668 bc98001ef73d419b8f811bbb3d3a571a |
| 235 |
#: c9104ccaf84c48d98fafca001ec187e2 |
| 236 |
msgid "pelican object" |
| 237 |
msgstr "pelican object" |
| 238 |
|
| 239 |
#: ../../plugins.rst:140 6f1a09178e2c44c9bda76ed0c0025bef |
| 240 |
msgid "finalized" |
| 241 |
msgstr "finalized" |
| 242 |
|
| 243 |
#: ../../plugins.rst:140 175a1d1ab8374325812a00cfd581e54e |
| 244 |
msgid "" |
| 245 |
"invoked after all the generators are executed and just before pelican " |
| 246 |
"exits useful for custom post processing actions, such as: - minifying " |
| 247 |
"js/css assets. - notify/ping search engines with an updated sitemap." |
| 248 |
msgstr "" |
| 249 |
"所有generator执行完成后调用,即pelican退出之前。这对于自定义后处理操作是" |
| 250 |
"非常有用的,例如可以简化js/css资源、向搜索引擎告知更新后的sitemap。" |
| 251 |
|
| 252 |
#: ../../plugins.rst:144 8d390b6db281423d92a4d7bd4921b4b4 |
| 253 |
msgid "generator_init" |
| 254 |
msgstr "generator_init" |
| 255 |
|
| 256 |
#: ../../plugins.rst:144 fef4d6e70a4c4365be408a5f1579135c |
| 257 |
msgid "generator" |
| 258 |
msgstr "generator" |
| 259 |
|
| 260 |
#: ../../plugins.rst:144 dbe5ff1590dc4df38cb8fd234708c7bd |
| 261 |
msgid "invoked in the Generator.__init__" |
| 262 |
msgstr "在Generator.__init__中调用" |
| 263 |
|
| 264 |
#: ../../plugins.rst:145 0324812d14d9452fbf28c286c2a10834 |
| 265 |
msgid "all_generators_finalized" |
| 266 |
msgstr "all_generators_finalized" |
| 267 |
|
| 268 |
#: ../../plugins.rst:145 f6170ebf34b247868d149f0efca462b3 |
| 269 |
msgid "generators" |
| 270 |
msgstr "generators" |
| 271 |
|
| 272 |
#: ../../plugins.rst:145 d67dff93c28146498074abbf3aeb5103 |
| 273 |
msgid "invoked after all the generators are executed and before writing output" |
| 274 |
msgstr "在所有generator执行完后,写入输出内容前调用," |
| 275 |
|
| 276 |
#: ../../plugins.rst:146 0e9feed7804b4bbdb23711f9d6ad4f40 |
| 277 |
msgid "readers_init" |
| 278 |
msgstr "readers_init" |
| 279 |
|
| 280 |
#: ../../plugins.rst:146 f0de00423c104ecd8e60fb3450b534b4 |
| 281 |
msgid "readers" |
| 282 |
msgstr "readers" |
| 283 |
|
| 284 |
#: ../../plugins.rst:146 b554b35806e34e51bc5ab974fb517541 |
| 285 |
msgid "invoked in the Readers.__init__" |
| 286 |
msgstr "在Readers.__init__中调用" |
| 287 |
|
| 288 |
#: ../../plugins.rst:147 ../../plugins.rst:201 003cdeb23b67433e8cf70c600a42e8e4 |
| 289 |
#: 7f4a2f6665064a16bcd1b7ea347f5b49 |
| 290 |
msgid "article_generator_context" |
| 291 |
msgstr "article_generator_context" |
| 292 |
|
| 293 |
#: ../../plugins.rst:147 8997b3fd1a8d4efb86245916e50c31b9 |
| 294 |
msgid "article_generator, metadata" |
| 295 |
msgstr "article_generator, metadata" |
| 296 |
|
| 297 |
#: ../../plugins.rst:148 ../../plugins.rst:203 4496df152e48410995ae35f73e3ce0e9 |
| 298 |
#: f46672e3f919441ba2486f9641752913 |
| 299 |
msgid "article_generator_preread" |
| 300 |
msgstr "article_generator_preread" |
| 301 |
|
| 302 |
#: ../../plugins.rst:148 ../../plugins.rst:150 ../../plugins.rst:151 |
| 303 |
#: ../../plugins.rst:154 3408ba823f14463196f2296480e25c7d |
| 304 |
#: 43b073d3f3ad4a2ba3d0c18447cb7cf6 c776a7323f0a41babb44daf3abfd6b85 |
| 305 |
#: f47ca0a3f9654ed4b7653fd946b2d9b6 |
| 306 |
msgid "article_generator" |
| 307 |
msgstr "article_generator" |
| 308 |
|
| 309 |
#: ../../plugins.rst:148 94e2a57c5b074d068f051d5de850060c |
| 310 |
msgid "" |
| 311 |
"invoked before a article is read in ArticlesGenerator.generate_context; " |
| 312 |
"use if code needs to do something before every article is parsed" |
| 313 |
msgstr "" |
| 314 |
"在ArticlesGenerator.generate_context读取文章之前调用;若代码需要在解析每篇文章前" |
| 315 |
"执行某些操作,就可以使用此信号。" |
| 316 |
|
| 317 |
#: ../../plugins.rst:150 c58f32123f234e6cafa42aa4ede5bf73 |
| 318 |
msgid "article_generator_init" |
| 319 |
msgstr "article_generator_init" |
| 320 |
|
| 321 |
#: ../../plugins.rst:150 10d3585dc8f94d978643a9c2dc9219a9 |
| 322 |
msgid "invoked in the ArticlesGenerator.__init__" |
| 323 |
msgstr "在ArticlesGenerator.__init__中调用" |
| 324 |
|
| 325 |
#: ../../plugins.rst:151 93ec423e266b4ba9b941a5826e290fec |
| 326 |
msgid "article_generator_pretaxonomy" |
| 327 |
msgstr "article_generator_pretaxonomy" |
| 328 |
|
| 329 |
#: ../../plugins.rst:151 27290d55819e4bfabe1624059956258f |
| 330 |
msgid "" |
| 331 |
"invoked before categories and tags lists are created useful when e.g. " |
| 332 |
"modifying the list of articles to be generated so that removed articles " |
| 333 |
"are not leaked in categories or tags" |
| 334 |
msgstr "" |
| 335 |
"在创建类别和标签列表之前调用。例如,当需要变更要生成的文章列表时可以使用," |
| 336 |
"如此可以避免一些已移除文章在分类或标签列表中泄露。" |
| 337 |
|
| 338 |
#: ../../plugins.rst:154 ../../plugins.rst:202 12c99acda2ac45debe4fc574a246fc63 |
| 339 |
#: f3bfb220e59d473bb27601c16f5a1625 |
| 340 |
msgid "article_generator_finalized" |
| 341 |
msgstr "article_generator_finalized" |
| 342 |
|
| 343 |
#: ../../plugins.rst:154 4cb8ed5b4701426b8e1707c6c6b0d48f |
| 344 |
msgid "invoked at the end of ArticlesGenerator.generate_context" |
| 345 |
msgstr "在ArticlesGenerator.generate_context的最后调用" |
| 346 |
|
| 347 |
#: ../../plugins.rst:155 c19a632018d44ad2b72d5cf6b7cc9c14 |
| 348 |
msgid "article_generator_write_article" |
| 349 |
msgstr "article_generator_write_article" |
| 350 |
|
| 351 |
#: ../../plugins.rst:155 9da20e77d40b45e292ae994fb0fbe97c |
| 352 |
msgid "article_generator, content" |
| 353 |
msgstr "article_generator, content" |
| 354 |
|
| 355 |
#: ../../plugins.rst:155 a2d5bc3f72b64e47bcaccff3bf27dec2 |
| 356 |
msgid "invoked before writing each article, the article is passed as content" |
| 357 |
msgstr "在写入每篇文章前调用,文章以内容的形式作为参数传入。" |
| 358 |
|
| 359 |
#: ../../plugins.rst:156 0db965f5b99f49e48fc1db531c139f13 |
| 360 |
msgid "article_writer_finalized" |
| 361 |
msgstr "article_writer_finalized" |
| 362 |
|
| 363 |
#: ../../plugins.rst:156 c6af98478be14eb283bb95e7b6a3118c |
| 364 |
msgid "article_generator, writer" |
| 365 |
msgstr "article_generator, writer" |
| 366 |
|
| 367 |
#: ../../plugins.rst:156 c48e1152864c4249886f3c7ed4ece85b |
| 368 |
msgid "" |
| 369 |
"invoked after all articles and related pages have been written, but " |
| 370 |
"before the article generator is closed." |
| 371 |
msgstr "" |
| 372 |
"在所有文章及相关联页面写入完成后,在文章generator关闭前调用。" |
| 373 |
|
| 374 |
#: ../../plugins.rst:158 f6af27fc844d43779d581cb4383b97ed |
| 375 |
msgid "get_generators" |
| 376 |
msgstr "get_generators" |
| 377 |
|
| 378 |
#: ../../plugins.rst:158 b41e27f19c47478a8ece4f43a685f6be |
| 379 |
msgid "" |
| 380 |
"invoked in Pelican.get_generator_classes, can return a Generator, or " |
| 381 |
"several generators in a tuple or in a list." |
| 382 |
msgstr "" |
| 383 |
"在Pelican.get_generator_classes中调用,可以返回一个Generator,也可以以一个" |
| 384 |
"元组或列表的形式返回多个generator。" |
| 385 |
|
| 386 |
#: ../../plugins.rst:161 f23075094c4f46958de609a44850eb6d |
| 387 |
msgid "get_writer" |
| 388 |
msgstr "get_writer" |
| 389 |
|
| 390 |
#: ../../plugins.rst:161 365671a73e17434f90973ee8e632fa32 |
| 391 |
msgid "invoked in Pelican.get_writer, can return a custom Writer." |
| 392 |
msgstr "在Pelican.get_writer前调用,可以返回一个自定义Writer。" |
| 393 |
|
| 394 |
#: ../../plugins.rst:163 ../../plugins.rst:204 299eef53e530489a9e7366042919059f |
| 395 |
#: 917cc78965d84285bc832cecf181ce55 |
| 396 |
msgid "page_generator_context" |
| 397 |
msgstr "page_generator_context" |
| 398 |
|
| 399 |
#: ../../plugins.rst:163 26f64e1dbe854ca287aa0f59b269477c |
| 400 |
msgid "page_generator, metadata" |
| 401 |
msgstr "page_generator, metadata" |
| 402 |
|
| 403 |
#: ../../plugins.rst:164 ../../plugins.rst:205 c2ec4e60dda142569cdcfe5a311b21a5 |
| 404 |
#: fcd417f63054406ea7869a2a945dc819 |
| 405 |
msgid "page_generator_preread" |
| 406 |
msgstr "page_generator_preread" |
| 407 |
|
| 408 |
#: ../../plugins.rst:164 ../../plugins.rst:166 ../../plugins.rst:167 |
| 409 |
#: 89c2d7a279604926a290c2665fe8082a 98ab9a5bc2804442a217233f4ab8a003 |
| 410 |
#: fca779509f1742e99e3d10a6602561c9 |
| 411 |
msgid "page_generator" |
| 412 |
msgstr "page_generator" |
| 413 |
|
| 414 |
#: ../../plugins.rst:164 295fe11e61ba4f80a145ce06a1ffc777 |
| 415 |
msgid "" |
| 416 |
"invoked before a page is read in PageGenerator.generate_context; use if " |
| 417 |
"code needs to do something before every page is parsed." |
| 418 |
msgstr "" |
| 419 |
"在PageGenerator.generate_context读取页面前调用,若代码需要在解析每个页面前" |
| 420 |
"执行某些操作,就可以使用此信号。" |
| 421 |
|
| 422 |
#: ../../plugins.rst:166 ../../plugins.rst:207 4f2b1db9b6054af2b0fd0545082bcafd |
| 423 |
#: db8ee3e356d84758b427d9f29d034000 |
| 424 |
msgid "page_generator_init" |
| 425 |
msgstr "page_generator_init" |
| 426 |
|
| 427 |
#: ../../plugins.rst:166 1d4e2e940e0f4dd5a151519aea710454 |
| 428 |
msgid "invoked in the PagesGenerator.__init__" |
| 429 |
msgstr "在PagesGenerator.__init__中调用" |
| 430 |
|
| 431 |
#: ../../plugins.rst:167 ../../plugins.rst:206 319e921c48474a43bbdac4bf43a688f2 |
| 432 |
#: 5e9b33a48c51417fb5211824b0ad008d |
| 433 |
msgid "page_generator_finalized" |
| 434 |
msgstr "page_generator_finalized" |
| 435 |
|
| 436 |
#: ../../plugins.rst:167 019fa3fddf2e4725b978326f221c80bd |
| 437 |
msgid "invoked at the end of PagesGenerator.generate_context" |
| 438 |
msgstr "在PagesGenerator.generate_context的最后调用" |
| 439 |
|
| 440 |
#: ../../plugins.rst:168 0f77c3c609594768a0aaed6529260b97 |
| 441 |
msgid "page_generator_write_page" |
| 442 |
msgstr "page_generator_write_page" |
| 443 |
|
| 444 |
#: ../../plugins.rst:168 0ca5fb200a254cff8529cb5d95e8e26e |
| 445 |
msgid "page_generator, content" |
| 446 |
msgstr "page_generator, content" |
| 447 |
|
| 448 |
#: ../../plugins.rst:168 164d45dac5ab4df8abd898c1466e186d |
| 449 |
msgid "invoked before writing each page, the page is passed as content" |
| 450 |
msgstr "在写入每个页面前调用,页面以内容形式作为参数传入" |
| 451 |
|
| 452 |
#: ../../plugins.rst:169 4780473ba6ae47998f891232f122b34a |
| 453 |
msgid "page_writer_finalized" |
| 454 |
msgstr "page_writer_finalized" |
| 455 |
|
| 456 |
#: ../../plugins.rst:169 6c516a5ae777406ca9ed7bf27b7124c7 |
| 457 |
msgid "page_generator, writer" |
| 458 |
msgstr "page_generator, writer" |
| 459 |
|
| 460 |
#: ../../plugins.rst:169 e8978d0fb878427cbf686608c593aa67 |
| 461 |
msgid "" |
| 462 |
"invoked after all pages have been written, but before the page generator " |
| 463 |
"is closed." |
| 464 |
msgstr "调用于所有页面写入完成后,在页面generator关闭前。" |
| 465 |
|
| 466 |
#: ../../plugins.rst:171 ../../plugins.rst:208 47bf9969c38b4fef9e15e9d7ea67630e |
| 467 |
#: d9a3d5d939d4499b9320ea15dbd3f26e |
| 468 |
msgid "static_generator_context" |
| 469 |
msgstr "static_generator_context" |
| 470 |
|
| 471 |
#: ../../plugins.rst:171 47064012c4e447f5a1f087a7af420f8f |
| 472 |
msgid "static_generator, metadata" |
| 473 |
msgstr "static_generator, metadata" |
| 474 |
|
| 475 |
#: ../../plugins.rst:172 ../../plugins.rst:209 7050e1889934465a8837ba65fa249118 |
| 476 |
#: f45c31c591fd450badd89a7f87c6f991 |
| 477 |
msgid "static_generator_preread" |
| 478 |
msgstr "static_generator_preread" |
| 479 |
|
| 480 |
#: ../../plugins.rst:172 ../../plugins.rst:175 ../../plugins.rst:176 |
| 481 |
#: 1e99fc14855a4a2e8d1f4758e12792d9 45cdf5c2a8d049889b4315d1ea78f462 |
| 482 |
#: b7ae37b94f2f44feb24ac32b0cdfa447 |
| 483 |
msgid "static_generator" |
| 484 |
msgstr "static_generator" |
| 485 |
|
| 486 |
#: ../../plugins.rst:172 431017db31bf439f8d3fb5e16b020376 |
| 487 |
msgid "" |
| 488 |
"invoked before a static file is read in StaticGenerator.generate_context;" |
| 489 |
" use if code needs to do something before every static file is added to " |
| 490 |
"the staticfiles list." |
| 491 |
msgstr "" |
| 492 |
"在StaticGenerator.generate_context读取静态文件前调用,若代码需要在每个静态文件" |
| 493 |
"加入静态文件列表前进行一些修改,就可以使用此信号。" |
| 494 |
|
| 495 |
#: ../../plugins.rst:175 2a380c26f2984e659ec36248a543a4c3 |
| 496 |
msgid "static_generator_init" |
| 497 |
msgstr "static_generator_init" |
| 498 |
|
| 499 |
#: ../../plugins.rst:175 832447303775460c83743d831aa58290 |
| 500 |
msgid "invoked in the StaticGenerator.__init__" |
| 501 |
msgstr "在StaticGenerator.__init__中调用" |
| 502 |
|
| 503 |
#: ../../plugins.rst:176 b01307445d54485a9036fb0f9619ff78 |
| 504 |
msgid "static_generator_finalized" |
| 505 |
msgstr "static_generator_finalized" |
| 506 |
|
| 507 |
#: ../../plugins.rst:176 2f7e7e25668b44fc824bb39270c3de96 |
| 508 |
msgid "invoked at the end of StaticGenerator.generate_context" |
| 509 |
msgstr "在StaticGenerator.generate_context的最后调用" |
| 510 |
|
| 511 |
#: ../../plugins.rst:177 2a34785767ee416dbe41a6aa1f7e4ab1 |
| 512 |
msgid "content_object_init" |
| 513 |
msgstr "content_object_init" |
| 514 |
|
| 515 |
#: ../../plugins.rst:177 c41d8a8653a94d648b573b5c13db3954 |
| 516 |
msgid "content_object" |
| 517 |
msgstr "content_object" |
| 518 |
|
| 519 |
#: ../../plugins.rst:177 379b6d76d2f14d05bf1502d2c55b125f |
| 520 |
msgid "invoked at the end of Content.__init__" |
| 521 |
msgstr "在Content.__init__的最后调用" |
| 522 |
|
| 523 |
#: ../../plugins.rst:178 10761aa6a1d54ee0a28e562bdacffebf |
| 524 |
msgid "content_written" |
| 525 |
msgstr "content_written" |
| 526 |
|
| 527 |
#: ../../plugins.rst:178 001ad90e09ab4b21a702b2ed9771a156 |
| 528 |
msgid "path, context" |
| 529 |
msgstr "path, context" |
| 530 |
|
| 531 |
#: ../../plugins.rst:178 69b05b02e1564fe4b48dbd2926fdaec3 |
| 532 |
msgid "invoked each time a content file is written." |
| 533 |
msgstr "每一次内容文件写入后调用。" |
| 534 |
|
| 535 |
#: ../../plugins.rst:179 30938518f54f46028c8fd03808471be7 |
| 536 |
msgid "feed_generated" |
| 537 |
msgstr "feed_generated" |
| 538 |
|
| 539 |
#: ../../plugins.rst:179 e29bf37e7114454099baa21955b7fce0 |
| 540 |
msgid "context, feed" |
| 541 |
msgstr "context, feed" |
| 542 |
|
| 543 |
#: ../../plugins.rst:179 366ba164593242309dab922c36667dc3 |
| 544 |
msgid "" |
| 545 |
"invoked each time a feed gets generated. Can be used to modify a feed " |
| 546 |
"object before it gets written." |
| 547 |
msgstr "每个feed生成前调用。可以用于在feed写入前修改之。" |
| 548 |
|
| 549 |
#: ../../plugins.rst:181 0b6d7fc85d374b9c82c60d4a0df69fcd |
| 550 |
msgid "feed_written" |
| 551 |
msgstr "feed_written" |
| 552 |
|
| 553 |
#: ../../plugins.rst:181 d3fdc3a669e9418b9f6e738c549fa151 |
| 554 |
msgid "path, context, feed" |
| 555 |
msgstr "path, context, feed" |
| 556 |
|
| 557 |
#: ../../plugins.rst:181 3da952e464034f8c8491caa94f0aec2d |
| 558 |
msgid "invoked each time a feed file is written." |
| 559 |
msgstr "每一个feed文件写入后调用。" |
| 560 |
|
| 561 |
#: ../../plugins.rst:186 24bf768827184a8a9c2ad9d23d3549e4 |
| 562 |
msgid "" |
| 563 |
"Avoid ``content_object_init`` signal if you intend to read ``summary`` or" |
| 564 |
" ``content`` properties of the content object. That combination can " |
| 565 |
"result in unresolved links when :ref:`ref-linking-to-internal-content` " |
| 566 |
"(see `pelican-plugins bug #314`_). Use ``_summary`` and ``_content`` " |
| 567 |
"properties instead, or, alternatively, run your plugin at a later stage " |
| 568 |
"(e.g. ``all_generators_finalized``)." |
| 569 |
msgstr "" |
| 570 |
"请避免使用 ``content_object_init`` 信号读取content对象的 ``summary`` 或 " |
| 571 |
"``content`` 属性,这可能导致在 :ref:`ref-linking-to-internal-content` 时无法" |
| 572 |
"解析链接(请参阅 `pelican-plugins bug #314`_ )。请改用 ``_summary`` 和 " |
| 573 |
"``_content`` 属性,或者就在后续阶段再运行插件(例如 ``all_generators_finalized`` 时)。" |
| 574 |
|
| 575 |
#: ../../plugins.rst:195 9222300d10c74a9eb27fc229488e63a4 |
| 576 |
msgid "" |
| 577 |
"After Pelican 3.2, signal names were standardized. Older plugins may " |
| 578 |
"need to be updated to use the new names:" |
| 579 |
msgstr "" |
| 580 |
"Pelican3.2之后,信号名都进行了标准化,较老的插件可能需要进行更新:" |
| 581 |
|
| 582 |
#: ../../plugins.rst:199 2ba779a696064672965e17c70f70d927 |
| 583 |
msgid "Old name" |
| 584 |
msgstr "旧名称" |
| 585 |
|
| 586 |
#: ../../plugins.rst:199 d21e933be9064983aa2cfaeca4f00cb9 |
| 587 |
msgid "New name" |
| 588 |
msgstr "新名称" |
| 589 |
|
| 590 |
#: ../../plugins.rst:201 805ac7c62fc94113a3481890793f5417 |
| 591 |
msgid "article_generate_context" |
| 592 |
msgstr "article_generate_context" |
| 593 |
|
| 594 |
#: ../../plugins.rst:202 d6f1a03ae49349b091045c8079b80d44 |
| 595 |
msgid "article_generate_finalized" |
| 596 |
msgstr "article_generate_finalized" |
| 597 |
|
| 598 |
#: ../../plugins.rst:203 c967c8322a744c2c970beb6b98b90743 |
| 599 |
msgid "article_generate_preread" |
| 600 |
msgstr "article_generate_preread" |
| 601 |
|
| 602 |
#: ../../plugins.rst:204 71adeb83fba74317ad0fac5784612a3d |
| 603 |
msgid "pages_generate_context" |
| 604 |
msgstr "pages_generate_context" |
| 605 |
|
| 606 |
#: ../../plugins.rst:205 d2297a5ec351411e8a66a74d8168caa0 |
| 607 |
msgid "pages_generate_preread" |
| 608 |
msgstr "pages_generate_preread" |
| 609 |
|
| 610 |
#: ../../plugins.rst:206 fb572935b7f445d298ff2c9c89c59c4e |
| 611 |
msgid "pages_generator_finalized" |
| 612 |
msgstr "pages_generator_finalized" |
| 613 |
|
| 614 |
#: ../../plugins.rst:207 0bb615d8a6f643a3a1a9abac2ec4f712 |
| 615 |
msgid "pages_generator_init" |
| 616 |
msgstr "pages_generator_init" |
| 617 |
|
| 618 |
#: ../../plugins.rst:208 beddb5f81a62458b87c0703355a7b5a4 |
| 619 |
msgid "static_generate_context" |
| 620 |
msgstr "static_generate_context" |
| 621 |
|
| 622 |
#: ../../plugins.rst:209 8fe8895dcb464e11bb01657e975f1352 |
| 623 |
msgid "static_generate_preread" |
| 624 |
msgstr "static_generate_preread" |
| 625 |
|
| 626 |
#: ../../plugins.rst:213 44b14caddfd245c18cacd755fd0023e9 |
| 627 |
msgid "Recipes" |
| 628 |
msgstr "具体使用方法举例" |
| 629 |
|
| 630 |
#: ../../plugins.rst:215 c24473f41cc84d028c99fa56af636037 |
| 631 |
msgid "" |
| 632 |
"We eventually realised some of the recipes to create plugins would be " |
| 633 |
"best shared in the documentation somewhere, so here they are!" |
| 634 |
msgstr "" |
| 635 |
"下面分享了一些创建插件的具体方法,请享用!" |
| 636 |
|
| 637 |
#: ../../plugins.rst:219 96de26e8150e4339b3461d2dcc478cf3 |
| 638 |
msgid "How to create a new reader" |
| 639 |
msgstr "如何创建一个新的reader" |
| 640 |
|
| 641 |
#: ../../plugins.rst:221 3f26c1183b814401b333bbd8528675d9 |
| 642 |
msgid "" |
| 643 |
"One thing you might want is to add support for your very own input " |
| 644 |
"format. While it might make sense to add this feature in Pelican core, we" |
| 645 |
" wisely chose to avoid this situation and instead have the different " |
| 646 |
"readers defined via plugins." |
| 647 |
msgstr "" |
| 648 |
"你可能需要添加对输入文件格式的特殊支持。这似乎可以作为Pelican核心的一个功能," |
| 649 |
"但我们选择避免将此功能放在核心中,而是通过插件实现不同的reader。" |
| 650 |
|
| 651 |
#: ../../plugins.rst:226 8167dcbaa6864da3b2262a2a99e08a15 |
| 652 |
msgid "" |
| 653 |
"The rationale behind this choice is mainly that plugins are really easy " |
| 654 |
"to write and don't slow down Pelican itself when they're not active." |
| 655 |
msgstr "" |
| 656 |
"做出这个决定主要是因为实现这样的格式支持插件非常容易,而且这样在不需要此功能时" |
| 657 |
"也不会影响Pelican自身的速度。" |
| 658 |
|
| 659 |
#: ../../plugins.rst:229 26c8185062964b52921860cfa2ce508c |
| 660 |
msgid "No more talking — here is an example::" |
| 661 |
msgstr "多说无益,下面是一个具体例子:" |
| 662 |
|
| 663 |
#: ../../plugins.rst:265 ea51efb1925f45e79c87d6e5488cbbcd |
| 664 |
msgid "Adding a new generator" |
| 665 |
msgstr "添加新的generator" |
| 666 |
|
| 667 |
#: ../../plugins.rst:267 9e04f17a5fa1488d82d3629edf8cdf3f |
| 668 |
msgid "" |
| 669 |
"Adding a new generator is also really easy. You might want to have a look" |
| 670 |
" at :doc:`internals` for more information on how to create your own " |
| 671 |
"generator." |
| 672 |
msgstr "" |
| 673 |
"添加一个generator也非常简单,你可能会想要看一看 :doc:`internals` ,其中有关于" |
| 674 |
"如何创建generator的内容。" |
| 675 |
|
| 676 |
#: ../../plugins.rst:281 f4c92958e88a41a7a0deee697b48fc58 |
| 677 |
msgid "Adding a new writer" |
| 678 |
msgstr "添加新的writer" |
| 679 |
|
| 680 |
#: ../../plugins.rst:283 188bf0e8a68446458ae525c67cfe098c |
| 681 |
msgid "" |
| 682 |
"Adding a writer will allow you to output additional file formats to disk," |
| 683 |
" or change how the existing formats are written to disk. Note that only " |
| 684 |
"one writer will be active at a time, so be sure to either subclass the " |
| 685 |
"built-in Writer, or completely re-implement it." |
| 686 |
msgstr "" |
| 687 |
"添加writer可以让你将其他文件格式输出到磁盘,或者可以改变现有格式写入磁盘的方式。" |
| 688 |
"请注意,一次只能启用一个writer,因此请确保继承了内置的Writer,并且完全重新实现之。" |
| 689 |
|
| 690 |
#: ../../plugins.rst:288 edb5d1fa15bc48859c2912ba7c344286 |
| 691 |
msgid "Here is a basic example of how to set up your own writer::" |
| 692 |
msgstr "下面是启用你的自定义writer的一个基本例子:" |
| 693 |
|
| 694 |
#: ../../plugins.rst:308 0df8f3318357472cbd72e17e1b5085b2 |
| 695 |
msgid "Using Plugins to Inject Content" |
| 696 |
msgstr "使用插件添加内容" |
| 697 |
|
| 698 |
#: ../../plugins.rst:310 d0161dbe86c44111a6295259ec8cab54 |
| 699 |
msgid "" |
| 700 |
"You can programmatically inject articles or pages using plugins. This can" |
| 701 |
" be useful if you plan to fetch articles from an API, for example." |
| 702 |
msgstr "" |
| 703 |
"可以通过插件以可编程的方式添加文章或页面。如果你打算从某些API获取文章,这就会很有用。" |
| 704 |
|
| 705 |
#: ../../plugins.rst:313 5d5c41dbeb7243d4b497752771bc7858 |
| 706 |
msgid "" |
| 707 |
"Following is a simple example of how one can build a plugin that injects " |
| 708 |
"a custom article, using the ``article_generator_pretaxonomy`` signal::" |
| 709 |
msgstr "" |
| 710 |
"下面是一个简单的示例,说明了如何使用 ``article_generator_pretaxonomy`` " |
| 711 |
"信号构建一个添加自定义文章的插件:" |