complete traslation of faq

This commit is contained in:
GeorgeHu 2023-11-29 14:54:08 +08:00
commit ebebaee52b
2 changed files with 97 additions and 61 deletions

View file

@ -3,7 +3,6 @@
# This file is distributed under the same license as the Pelican package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Pelican 4\n"
@ -21,23 +20,23 @@ msgstr ""
#: ../../faq.rst:2
msgid "Frequently Asked Questions (FAQ)"
msgstr ""
msgstr "常见问题"
#: ../../faq.rst:4
msgid "Here are some frequently asked questions about Pelican."
msgstr ""
msgstr "以下回答了一些关于Pelican的常见问题。"
#: ../../faq.rst:7
msgid "What's the best way to communicate a problem, question, or suggestion?"
msgstr ""
msgstr "交流问题、疑问或提建议的最佳方式是什么?"
#: ../../faq.rst:9
msgid "Please read our :doc:`feedback guidelines <contribute>`."
msgstr ""
msgstr "请参阅文档 :doc:`feedback guidelines <contribute>` 。"
#: ../../faq.rst:12
msgid "How can I help?"
msgstr ""
msgstr "我如何能帮上忙?"
#: ../../faq.rst:14
msgid ""
@ -46,7 +45,9 @@ msgid ""
"<https://github.com/getpelican/pelican/discussions>`_. Please first check"
" the existing list of discussions and issues (both open and closed) in "
"order to avoid submitting topics that have already been covered before."
msgstr ""
msgstr "有好多种方法可以提供帮助。首先,可以在 `Pelican讨论板块 <https://github.com/getpelican/pelican/discussions>`_ "
"中提出任何关于Pelican的建议或是问题。在提问或建议之前请先查看已关闭或开放的issues中是否已有相关"
"内容,以避免内容上的重复。"
#: ../../faq.rst:20
msgid ""
@ -55,17 +56,19 @@ msgid ""
"make your changes, and issue a pull request. Someone will review your "
"changes as soon as possible. Please refer to the :doc:`How to Contribute "
"<contribute>` section for more details."
msgstr ""
msgstr "如果你想要对项目进行贡献请fork `Git仓库 <https://github.com/getpelican/pelican/>`_ "
"创建一个新的功能分支并在其中进行修改在修改完成后提出一个PR。项目组会尽快审核你的PR。关于此的更多"
"内容,请参见 :doc:`How to Contribute <contribute>` 一节。"
#: ../../faq.rst:26
msgid ""
"You can also contribute by creating themes and improving the "
"documentation."
msgstr ""
msgstr "你可以发起的贡献当然也包括创建主题和改进文档。"
#: ../../faq.rst:29
msgid "Is the Pelican settings file mandatory?"
msgstr ""
msgstr "一定需要Pelican配置文件吗"
#: ../../faq.rst:31
msgid ""
@ -73,11 +76,12 @@ msgid ""
"Pelican. For basic operations, it's possible to specify options while "
"invoking Pelican via the command line. See ``pelican --help`` for more "
"information."
msgstr ""
msgstr "配置文件是可选的其本质是使您可以更方便地配置Pelican。对于一些基本的配置操作完全可以"
"在命令行中指定,调用 ``pelican --help`` 可以查看pelican命令的更多信息。"
#: ../../faq.rst:36
msgid "Changes to the settings file take no effect"
msgstr ""
msgstr "对配置文件的修改没有生效"
#: ../../faq.rst:38
msgid ""
@ -85,11 +89,12 @@ msgid ""
" caching may interfere and the changes may not be visible. In such cases,"
" ensure that caching is disabled via ``LOAD_CONTENT_CACHE = False`` or "
"use the ``--ignore-cache`` command-line switch."
msgstr ""
msgstr "在尝试不同的配置时(尤其是尝试不同元数据时),缓存很可能会产生干扰,使得修改不可见。"
"此时,确保配置了 ``LOAD_CONTENT_CACHE = False`` 或在命令行中加上 ``--ignore-cache`` 以禁用缓存。"
#: ../../faq.rst:44
msgid "I'm creating my own theme. How do I use Pygments for syntax highlighting?"
msgstr ""
msgstr "在自己创建主题时如何使用Pygments来调整语法高亮"
#: ../../faq.rst:46
msgid ""
@ -100,30 +105,33 @@ msgid ""
"styles can be used to render Django code, for example, use the style "
"selector drop-down at top-right on the `Pygments project demo site "
"<https://pygments.org/demo/>`_."
msgstr ""
msgstr "Pygments会为生成的内容添加一些类。这些类会为主题所用主题会通过CSS来为代码添加语法高亮。"
"具体来说你可以通过主题CSS文件中的 ``.highlight pre`` 类来自定义语法高亮的外观。在"
"`Pygments 项目的demo网站 <https://pygments.org/demo/>`_ 上可以预览能够渲染的代码类型。"
#: ../../faq.rst:53
msgid ""
"You can use the following example commands to generate a starting CSS "
"file from a Pygments built-in style (in this case, \"monokai\") and then "
"copy the generated CSS file to your new theme::"
msgstr ""
msgstr "你可以使用下面的命令来让Pygments使用内置风格此处为 \"monokai\" 生成一个初始CSS文件"
"然后将此文件拷贝到新主题中:"
#: ../../faq.rst:60
msgid "Don't forget to import your ``pygment.css`` file from your main CSS file."
msgstr ""
msgstr "不要忘了在你的CSS主文件中引入 ``pygment.css`` 文件。"
#: ../../faq.rst:63
msgid "How do I create my own theme?"
msgstr ""
msgstr "如何创建我自己的主题?"
#: ../../faq.rst:65
msgid "Please refer to :ref:`theming-pelican`."
msgstr ""
msgstr "请参阅 :ref:`theming-pelican` 。"
#: ../../faq.rst:68
msgid "I want to use Markdown, but I got an error."
msgstr ""
msgstr "我想要使用Markdown但是出错了。"
#: ../../faq.rst:70
msgid ""
@ -133,96 +141,102 @@ msgid ""
"have content in Markdown format, you will need to explicitly install the "
"Markdown library. You can do so by typing the following command, "
"prepending ``sudo`` if permissions require it::"
msgstr ""
msgstr "如果没有事先安装Markdown库在生成Markdown内容时会看到一条提示 ``No valid files found "
"in content`` 。虽然Markdown并不是必需依赖但如果你写的内容中含有Markdown格式就需要安装Markdown"
"库了。输入下面的命令以安装Markdown库如果有要求权限请在前面添加 ``sudo`` "
#: ../../faq.rst:80
msgid "Can I use arbitrary metadata in my templates?"
msgstr ""
msgstr "在模板中可以使用任意元数据吗?"
#: ../../faq.rst:82
msgid ""
"Yes. For example, to include a modified date in a Markdown post, one "
"could include the following at the top of the article::"
msgstr ""
msgstr "当然可以。例如可以在Markdown帖子中包含一个“修改日期”加在文章开头即可"
#: ../../faq.rst:87
msgid ""
"For reStructuredText, this metadata should of course be prefixed with a "
"colon::"
msgstr ""
msgstr "对于reStructuredText此元数据也应当以冒号为前缀"
#: ../../faq.rst:91
msgid ""
"This metadata can then be accessed in templates such as ``article.html`` "
"via::"
msgstr ""
msgstr "此元数据可以在模板中获取到,例如在 ``article.html`` 中,可以像这样获取:"
#: ../../faq.rst:97
msgid ""
"If you want to include metadata in templates outside the article context "
"(e.g., ``base.html``), the ``if`` statement should instead be::"
msgstr ""
msgstr "如果您想在article模板之外的模板中包含此元数据例如 ``base.html`` ),则 ``if`` 语句应改为:"
#: ../../faq.rst:103
msgid "How do I assign custom templates on a per-page basis?"
msgstr ""
msgstr "如何为某个页面指定某个模板?"
#: ../../faq.rst:105
msgid ""
"It's as simple as adding an extra line of metadata to any page or article"
" that you want to have its own template. For example, this is how it "
"would be handled for content in reST format::"
msgstr ""
msgstr "这非常简单在任何页面或者文章中都可以通过多添加一行元数据来指定特定模板。例如在reST中使用"
#: ../../faq.rst:111
msgid "For content in Markdown format::"
msgstr ""
msgstr "对于Markdown则使用"
#: ../../faq.rst:115
msgid ""
"Then just make sure your theme contains the relevant template file (e.g. "
"``template_name.html``)."
msgstr ""
msgstr "确保对应的模板文件在主题中存在即可(例如 ``template_name.html`` )。"
#: ../../faq.rst:119
msgid "How can I override the generated URL of a specific page or article?"
msgstr ""
msgstr "如何重写某一个页面或文章生成的URL"
#: ../../faq.rst:121
msgid ""
"Include ``url`` and ``save_as`` metadata in any pages or articles that "
"you want to override the generated URL. Here is an example page in reST "
"format::"
msgstr ""
msgstr "在任意页面或文章中都可以添加 ``url`` 和 ``save_as`` 元数据这样就可以重写URL了。"
"下面以reST格式为例"
#: ../../faq.rst:130
msgid ""
"With this metadata, the page will be written to "
"``override/url/index.html`` and Pelican will use the URL "
"``override/url/`` to link to this page."
msgstr ""
msgstr "有了这样的元数据,此页面会写入 ``override/url/index.html`` Pelican会将"
"``override/url/`` 作为链接到此页面的URL。"
#: ../../faq.rst:134
msgid "How can I use a static page as my home page?"
msgstr ""
msgstr "如何使用一个静态页面作为主页?"
#: ../../faq.rst:136
msgid ""
"The override feature mentioned above can be used to specify a static page"
" as your home page. The following Markdown example could be stored in "
"``content/pages/home.md``::"
msgstr ""
msgstr "上一个问题中提到的特性可以用于实现此需求。下面例子中的Markdown文件保存为"
"``content/pages/home.md`` "
#: ../../faq.rst:146
msgid ""
"If the original blog index is still wanted, it can then be saved in a "
"different location by setting ``INDEX_SAVE_AS = 'blog_index.html'`` for "
"the ``'index'`` direct template."
msgstr ""
msgstr "如果仍需要原来的博客主页(即 ``'index'`` 直接模板),可以通过设置 "
"``INDEX_SAVE_AS = 'blog_index.html'`` 将其存储在其他位置。"
#: ../../faq.rst:151
msgid "What if I want to disable feed generation?"
msgstr ""
msgstr "可以禁用订阅源生成吗?"
#: ../../faq.rst:153
msgid ""
@ -230,19 +244,20 @@ msgid ""
"All but three feed settings already default to ``None``, so if you want "
"to disable all feed generation, you only need to specify the following "
"settings::"
msgstr ""
msgstr "要禁用订阅源,所有订阅源相关的设置都应被设为 ``None`` 。其中有三项设置默认为 ``None`` "
"因此如果要彻底不生成订阅源,你只需要指定下面这些设置:"
#: ../../faq.rst:163
msgid ""
"The word ``None`` should not be surrounded by quotes. Please note that "
"``None`` and ``''`` are not the same thing."
msgstr ""
msgstr "``None`` 两侧不需要加引号。请注意 ``None`` 和 ``''`` 不是同一个东西。"
#: ../../faq.rst:167
msgid ""
"I'm getting a warning about feeds generated without SITEURL being set "
"properly"
msgstr ""
msgstr "Pelican警告说由于SITEURL设置不正确无法正常生成订阅源"
#: ../../faq.rst:169
msgid ""
@ -250,17 +265,18 @@ msgid ""
"<https://validator.w3.org/feed/docs/rss2.html#comments>`_. In order to "
"properly generate links in Pelican you will need to set ``SITEURL`` to "
"the full path of your site."
msgstr ""
msgstr "`RSS和Atom订阅源要求所有URL都要链接到绝对地址 <https://validator.w3.org/feed/docs/rss2.html#comments>`_ 。"
"为了让Pelican正确生成链接你需要将站点的 ``SITEURL`` 设置为完整路径。"
#: ../../faq.rst:174
msgid ""
"Feeds are still generated when this warning is displayed, but links "
"within may be malformed and thus the feed may not validate."
msgstr ""
msgstr "虽然Pelican提出了警告但是仍会生成订阅源但其中的链接可能是坏掉的这会导致订阅源不可用。"
#: ../../faq.rst:178
msgid "Can I force Atom feeds to show only summaries instead of article content?"
msgstr ""
msgstr "可以让Atom订阅源只显示摘要不显示文章内容吗"
#: ../../faq.rst:180
msgid ""
@ -274,11 +290,14 @@ msgid ""
"content RSS feeds). So the default feed generation behavior provides "
"users with a choice: subscribe to Atom feeds for full content or to RSS "
"feeds for just the summaries."
msgstr ""
msgstr "绝大多数使用订阅源阅读器的人都更喜欢直接在阅读器中阅读文章内容,而不是另外再打开窗口来阅读。"
"因此Pelican不支持使Atom只包含摘要。但是由于RSS不包含单独的 ``content`` 字段因此Pelican在发布RSS"
"时默认只包含摘要当然也可以设置为包含文章内容。Pelican在订阅源生成上的如此行为就可以让用户自行选择订阅类型"
"包含了完整内容的Atom或是只包含摘要的RSS。"
#: ../../faq.rst:191
msgid "Is Pelican only suitable for blogs?"
msgstr ""
msgstr "Pelican只适合用于博客吗"
#: ../../faq.rst:193
msgid ""
@ -288,13 +307,15 @@ msgid ""
" your product and do not need tags on your site, you could remove the "
"relevant HTML code from your theme. You can also disable generation of "
"tag-related pages via::"
msgstr ""
msgstr "不是的。Pelican可以很方便就用于创建维护任何静态站点为此你需要对主题和配置做一些定制。"
"例如如果要为你的产品构建一个宣传网站即不需要使用标签从主题中移除与标签相关的HTML代码即可。"
"另外,还可以通过下面的设置来禁用标签相关页面的生成:"
#: ../../faq.rst:203
msgid ""
"Why does Pelican always write all HTML files even with content caching "
"enabled?"
msgstr ""
msgstr "启用内容缓存后Pelican为什么仍会写入所有HTML文件"
#: ../../faq.rst:205
msgid ""
@ -307,7 +328,9 @@ msgid ""
"This would require a lot more processing time and memory and storage "
"space. Simply writing the files each time is a lot faster and a lot more "
"reliable."
msgstr ""
msgstr "为了确定HTML输出确实和之前的不同模板上下文、插件等很多生成环境都需要保存并比较某种哈希值"
"对于不可哈希的内容类型还需要进行一些额外处理。另外由于插件、分页等内容的存在输出的HTML很可能"
"会与之前不同。因此考虑到处理时间和存储空间每次都重新写入HTML会更快更可靠。"
#: ../../faq.rst:214
msgid ""
@ -316,11 +339,13 @@ msgid ""
"content hasn't changed. A simple solution is to make ``rsync`` use the "
"``--checksum`` option, which will make it compare the file checksums in a"
" much faster way than Pelican would."
msgstr ""
msgstr "然而,这样的机制会使得在每次生成站点后,文件的修改时间都会变化,因此基于 ``rsync`` 上传时会把"
"没有变化的内容也进行上传。一个简便的解决方法就是给 ``rsync`` 加上 ``--checksum`` 选项这会比Pelican在"
"生成时进行校验更快。"
#: ../../faq.rst:221
msgid "How to process only a subset of all articles?"
msgstr ""
msgstr "如何只处理一部分文章?"
#: ../../faq.rst:223
msgid ""
@ -329,11 +354,12 @@ msgid ""
"filenames of those articles in ``ARTICLE_PATHS``. A list of such "
"filenames could be found using a command similar to ``cd content; find "
"-name '*.md' | head -n 10``."
msgstr ""
msgstr "简便起见,在调试时可能只需要处理几篇文章。可以通过在设置项 ``ARTICLE_PATHS`` 中添加需要处理的文章"
"的文件名。可以通过类似于 ``cd content; find -name '*.md' | head -n 10`` 的命令获取文章文件名的一个列表。"
#: ../../faq.rst:229
msgid "My tag cloud is missing/broken since I upgraded Pelican"
msgstr ""
msgstr "在升级Pelican后标签云消失或不可用了"
#: ../../faq.rst:231
msgid ""
@ -341,11 +367,13 @@ msgid ""
" moved out of Pelican core and into a separate `plugin "
"<https://github.com/pelican-plugins/tag-cloud>`_. See the :ref:`plugins` "
"documentation for further information about the Pelican plugin system."
msgstr ""
msgstr "我们一直致力于精简Pelican标签云生成的功能已经从Pelican核心中移除转而放到了一个单独的 "
"`插件 <https://github.com/pelican-plugins/tag-cloud>`_ 中。查看 :ref:`plugins` 文档获取更多关于"
"Pelican插件系统的信息。"
#: ../../faq.rst:237
msgid "Since I upgraded Pelican my pages are no longer rendered"
msgstr ""
msgstr "升级Pelican后一些页面没有被渲染"
#: ../../faq.rst:239
msgid ""
@ -354,15 +382,17 @@ msgid ""
"section, ``PAGES`` has been removed. This is quickly resolved by updating"
" your theme to iterate over ``pages`` instead of ``PAGES``. Just "
"replace::"
msgstr ""
msgstr "在以前的版本中,主题通过小写的 ``pages`` 和大写的 ``PAGES`` 都能获取到页面。"
"为了使之与 :ref:`templates-variables` 一节中的内容保持一致,大写的 ``PAGES`` 被删除了。"
"只要将主题中的 ``PAGES`` 替换为 ``pages`` ,问题即可解决。例如将原先的:"
#: ../../faq.rst:246
msgid "with something like::"
msgstr ""
msgstr "替换为:"
#: ../../faq.rst:251
msgid "How can I stop Pelican from trying to parse my static files as content?"
msgstr ""
msgstr "如何避免让Pelican将我的静态文件解析为内容文件译者注例如要将一个HTML文件作为静态文件"
#: ../../faq.rst:253
msgid ""
@ -372,18 +402,21 @@ msgid ""
"files that have a valid content file ending (``.html``, ``.rst``, "
"``.md``, ...) will be treated as articles or pages before they get "
"treated as static files."
msgstr ""
msgstr "Pelican的文章与页面生成器会先于静态文件生成器运行。这意味着若使用与默认配置类似的设置即"
"静态资源文件夹定义在某个 ``*_PATHS`` 配置项中,所有以有效内容文件后缀结尾的文件( ``.html`` 、 ``.rst`` 、 "
"``.md`` 等)都会被视为文章或者页面,而不是静态文件。"
#: ../../faq.rst:259
msgid ""
"To circumvent this issue either use the appropriate ``*_EXCLUDES`` "
"setting or disable the offending reader via ``READERS`` if you don't need"
" it."
msgstr ""
msgstr "为了避免这个问题,使用合适的 ``*_EXCLUDES`` 配置,在必要时还可以通过 ``READERS`` 配置项"
"来直接禁用产生问题的reader"
#: ../../faq.rst:263
msgid "Why is [arbitrary Markdown syntax] not supported?"
msgstr ""
msgstr "为什么不是所有的Markdown语法都支持"
#: ../../faq.rst:265
msgid ""
@ -396,7 +429,10 @@ msgid ""
"Alternatively, some folks have created Pelican plugins that support "
"Markdown variants, so that may be your best choice if there is a "
"particular variant you want to use when writing your content."
msgstr ""
msgstr "Pelican并不直接对Markdown进行处理而是将此任务交给 Python-Markdown_ 项目,此项目的核心有意只"
"遵循原始的Markdown语法规则而不服从之后传播开的大量Markdown风格。另外 Python-Markdown_ 时相当模块化的,"
"你想要使用的语法可能已经有现成的 `Markdown扩展`_ 进行了实现。或者也有人创建了支持Markdown变体的Pelican"
"插件如果你想要用某种Markdown变体可以在这些地方寻找支持。"
#~ msgid ""
#~ "If you want to contribute, please "