# SOME DESCRIPTIVE TITLE. # Copyright (C) 2010–2024 # This file is distributed under the same license as the PELICAN package. # FIRST AUTHOR , 2024. # msgid "" msgstr "" "Project-Id-Version: PELICAN 4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-09-15 09:23+0800\n" "PO-Revision-Date: 2024-06-25 19:00+0800\n" "Last-Translator: GeorgeHu \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.15.0\n" #: ../../content.rst:2 0e0d4e5751154cd4a5002b3f93cce14a msgid "Writing content" msgstr "创作内容" #: ../../content.rst:5 4316c31e97f740239cb3daaa533c0b64 msgid "Articles and pages" msgstr "文章和页面" #: ../../content.rst:7 66e59f17488f4914a6d5c4538214dd91 msgid "" "Pelican considers \"articles\" to be chronological content, such as posts" " on a blog, and thus associated with a date." msgstr "Pelican将“文章”(article)视为有时间顺序的内容,例如博客上的博文就是文章。" #: ../../content.rst:10 ed244e3e671f450daf0617a80274878b msgid "" "The idea behind \"pages\" is that they are usually not temporal in nature" " and are used for content that does not change very often (e.g., " "\"About\" or \"Contact\" pages)." msgstr "“页面”(page)指的是不经常改变的内容,例如“关于”“联系我们”这样的。" #: ../../content.rst:14 f30d12684e0043438418655ba9f5cf25 msgid "You can find sample content in the repository at ``samples/content/``." msgstr "" "在代码仓库的 ``samples/content/`` " "文件夹下有一些内容示例供您查看。(译者注:原文档中还有post与content的说法,一般既指代文章又指代页面,后文统一将其翻译为推文)" #: ../../content.rst:19 370562db18eb42f19935009d087595b4 msgid "File metadata" msgstr "文件元数据" #: ../../content.rst:21 e9e758d40aeb42a78a5e25ddbca35a3b msgid "" "Pelican tries to be smart enough to get the information it needs from the" " file system (for instance, about the category of your articles), but " "some information you need to provide in the form of metadata inside your " "files." msgstr "Pelican可以从文件系统中自动地获取一些信息(例如文章的分类),但是有些信息需要您以元数据的形式在文件中提供。" #: ../../content.rst:25 276a3d27de8c41a784b3c4fa6b0b9f1b msgid "" "If you are writing your content in reStructuredText format, you can " "provide this metadata in text files via the following syntax (give your " "file the ``.rst`` extension)::" msgstr "如果您用reStructuredText的格式进行内容创作,您可以按照下面的语法在文本文件中提供元数据(请给文本文件加上 ``.rst`` 后缀):" #: ../../content.rst:40 b5d99eedf95a4b6bbf760eccb4add31b msgid "" "Author and tag lists may be semicolon-separated instead, which allows you" " to write authors and tags containing commas::" msgstr "如果有多个作者或多个文章标签,需要将他们以分号分隔,这样就可以在作者或标签中使用逗号了:" #: ../../content.rst:46 18ae0e8b1cae406381a546bf2462c1e6 msgid "" "Pelican implements an extension to reStructuredText to enable support for" " the ``abbr`` HTML tag. To use it, write something like this in your " "post::" msgstr "Pelican在reStructuredText上实现了 ``abbr`` HTML标签的使用支持。在正文部分按照下面的形式书写即可。" #: ../../content.rst:51 62c068f033f0498d888dd72f23f9d231 msgid "" "You can also use Markdown syntax (with a file ending in ``.md``, " "``.markdown``, ``.mkd``, or ``.mdown``). Markdown generation requires " "that you first explicitly install the Python-Markdown_ package, which can" " be done via ``pip install Markdown``." msgstr "" "Pelican同时也支持Markdown语法(文件的扩展名需要为 ``.md`` 、 ``.markdown``、 ``.mkd`` 或 " "``.mdown`` )要让Pelican进行Markdown的生成,需要先通过 ``pip install Markdown`` 安装 " "Python-Markdown_ 。" #: ../../content.rst:56 f39e1de0f9ea4533942c5bf0bff7866f msgid "" "Pelican also supports `Markdown Extensions`_, which might have to be " "installed separately if they are not included in the default ``Markdown``" " package and can be configured and loaded via the ``MARKDOWN`` setting." msgstr "" "Pelican同样支持 `Markdown扩展`_ ,可以是 ``Markdown`` 包自带的扩展,也可以是另外安装的,可以通过 " "``MARKDOWN`` 配置项管理这些扩展。" #: ../../content.rst:60 c9f3ab98c3d54b53bf647ba9202b5386 msgid "Metadata syntax for Markdown posts should follow this pattern::" msgstr "Markdown中的元数据语法需要按照下面的格式书写:" #: ../../content.rst:73 ba840c208e4b4198ac0a2bd672a94f36 msgid "" "You can also have your own metadata keys (so long as they don't conflict " "with reserved metadata keywords) for use in your templates. The following" " table contains a list of reserved metadata keywords:" msgstr "您也可以定义自己的元数据类型(只要和保留的元数据关键字不冲突),这些自定义的元数据关键字可以用在自定义的模板中。下面的列出了所有保留的元数据关键字。" #: ../../content.rst:78 a9537c5593d9458d9193dacc82c27f2f msgid "Metadata" msgstr "元数据类型" #: ../../content.rst:78 ../../content.rst:548 827ac866a3914692ac5fc9eaa1921aac #: a55315aa4aee4e30a7768bc54d7063da msgid "Description" msgstr "描述" #: ../../content.rst:80 d5e5b3902b9f46e3a827c551e26d84bd msgid "``title``" msgstr "``title``" #: ../../content.rst:80 07eb7d1b1a5f458084564729052749e7 msgid "Title of the article or page" msgstr "文章或页面的标题" #: ../../content.rst:81 37abd449ffca4436a505f0dc35343cea msgid "``date``" msgstr "``date``" #: ../../content.rst:81 a13a424e96f643068af63b0d0d2dbb27 msgid "Publication date (e.g., ``YYYY-MM-DD HH:SS``)" msgstr "发布日期(需要以 ``YYYY-MM-DD HH:SS`` 的格式)" #: ../../content.rst:82 7534c5908891457797988ef7a67b17db msgid "``modified``" msgstr "``modified``" #: ../../content.rst:82 6cc7d4c20ee44e31bb54173b24aa9afe msgid "Modification date (e.g., ``YYYY-MM-DD HH:SS``)" msgstr "最后修改日期(需要以 ``YYYY-MM-DD HH:SS`` 的格式)" #: ../../content.rst:83 0f7d30bb91bf46f7a0e2dd5ab186955d msgid "``tags``" msgstr "``tags``" #: ../../content.rst:83 e07fee37f1de414f82b38e7ff5e9051b msgid "Content tags, separated by commas" msgstr "推文标签,以逗号分隔" #: ../../content.rst:84 cc730907be1c4bb6a4d1f4e551f1bb13 msgid "``keywords``" msgstr "``keywords``" #: ../../content.rst:84 b4185fda72084329b551f26b6eff5bd5 msgid "Content keywords, separated by commas (HTML content only)" msgstr "推文关键字,以逗号分隔(只能在HTML内容中使用)" #: ../../content.rst:85 98438d6e0fbf4783a580516079fa5f3b msgid "``category``" msgstr "``category``" #: ../../content.rst:85 48e04733764e4962bfe4d16828b34d79 msgid "Content category (one only — not multiple)" msgstr "推文分类(只能归属到一个分类中,不支持多个)" #: ../../content.rst:86 275265cdeaaf4515b8f84dd79d29e181 msgid "``slug``" msgstr "``slug``" #: ../../content.rst:86 d910b7a82ea540179d561f639e531b9d msgid "Identifier used in URLs and translations" msgstr "URL和翻译的唯一标识符" #: ../../content.rst:87 ac2a927028d647a0b4f5edb14e5b1851 msgid "``author``" msgstr "``author``" #: ../../content.rst:87 bd27267c861f470db23499a67a631854 msgid "Content author, when there is only one" msgstr "当只有一个作者时可以使用这个元数据" #: ../../content.rst:88 9616ecb488914e4eaa192ecb4e437ba0 msgid "``authors``" msgstr "``authors``" #: ../../content.rst:88 762660408c274f5690dba81dcc88c662 msgid "Content authors, when there are multiple" msgstr "当有多个作者时需要使用这个元数据" #: ../../content.rst:89 40d65df77e0f4e75a26615d60775a382 msgid "``summary``" msgstr "``summary``" #: ../../content.rst:89 f072a97cf1c54b7fbd383f205732f1c2 msgid "Brief description of content for index pages" msgstr "简短的推文概要,会显示在首页上" #: ../../content.rst:90 69018dfa7f9b4e74b518fc1940af8908 msgid "``lang``" msgstr "``lang``" #: ../../content.rst:90 f139c5b2a2774ee3bb83d4bd3b523a93 msgid "Content language ID (``en``, ``fr``, etc.)" msgstr "推文所用语言的ID(例如 ``en`` 、 ``fr`` 、 ``zh-cn`` 等)" #: ../../content.rst:91 13757ce4c6a84096b4d131232eaeb8b4 msgid "``translation``" msgstr "``translation``" #: ../../content.rst:91 9b3f475397bc4d60a1eb911f6763285f msgid "If content is a translation of another (``true`` or ``false``)" msgstr "手动指定当前内容是否是某个翻译版本(该元数据的值只能是 ``true`` 或 ``false``)" #: ../../content.rst:92 3f294461641949eead16c79e7bffdb22 msgid "``status``" msgstr "``status``" #: ../../content.rst:92 f6ab65a6adf64379a14fb89d300d9eaa msgid "Content status: ``draft``, ``hidden``, ``skip``, or ``published``" msgstr "推文的状态: ``draft``、 ``hidden`` 、 ``skip`` 或 ``published`` " #: ../../content.rst:93 d9aefdcc77aa462d9934eb49f2b39095 msgid "``template``" msgstr "``template``" #: ../../content.rst:93 41ecae4039714f31b0220f0d0f45a0c7 msgid "Name of template to use to generate content (without extension)" msgstr "用于指定要使用的生成模板,只需要写模板的名字,不需要模板文件的后缀名" #: ../../content.rst:94 892e239c7a9145beb61b2f583284f448 msgid "``save_as``" msgstr "``save_as``" #: ../../content.rst:94 3bc3792a6a5c4e79bcf8f77fc48f313b msgid "Save content to this relative file path" msgstr "将内容保存到指定的相对文件路径" #: ../../content.rst:95 8c3ed87a54734ca1bba051448d8169f9 msgid "``url``" msgstr "``url``" #: ../../content.rst:95 2b55b515c7ce40e48eae20fbc67107bb msgid "URL to use for this article/page" msgstr "指定本篇文章或页面要使用的URL" #: ../../content.rst:98 81c7cc35f7b74566b7dd9083c2fc17f1 msgid "" "Readers for additional formats (such as AsciiDoc_) are available via " "plugins, which you can find via the `Pelican Plugins`_ collection as well" " as the legacy `pelican-plugins`_ repository." msgstr "" "对其他格式的支持(例如 AsciiDoc_ )可以通过插件实现,在 `Pelican插件`_ 集中可以查看所有插件。当然,在老的 " "`pelican-plugins`_ 仓库中也可以查看。" #: ../../content.rst:102 b808c2914ee14c1380fe53e5e1f378f7 msgid "" "Pelican can also process HTML files ending in ``.html`` and ``.htm``. " "Pelican interprets the HTML in a very straightforward manner, reading " "metadata from ``meta`` tags, the title from the ``title`` tag, and the " "body out from the ``body`` tag::" msgstr "" "Pelican还能处理后缀名为 ``.html`` 和 ``.htm`` " "的HTML文件Pelican在解释转换HTML文件时用的方法非常直接,会从 ``meta`` HTML标签中获取元数据信息,从 ``title``" " HTML标签中获取标题,从 ``body`` 标签中获取文章的正文内容:" #: ../../content.rst:122 289c3761b4b94691bee5ef07e8ab25ff msgid "" "With HTML, there is one simple exception to the standard metadata: tags " "can be specified either via the ``tags`` metadata, as is standard in " "Pelican, or via the ``keywords`` metadata, as is standard in HTML. The " "two can be used interchangeably." msgstr "" "当使用HTML文件时,上述的众多元数据中有一个比较特殊的存在——tags。这个元数据在HTML文档中有两种方式可以指定,一种是Pelican中定义的" " ``tags`` (上面的例子中用的就是这种);另一种是使用HTML中定义的 ``keywords`` " "(即将name属性的“tags”换成“keywords”)。" #: ../../content.rst:127 9af1403c5c624860bd73aba6f6ad642f msgid "" "Note that, aside from the title, none of this content metadata is " "mandatory: if the date is not specified and ``DEFAULT_DATE`` is set to " "``'fs'``, Pelican will rely on the file's \"mtime\" timestamp, and the " "category can be determined by the directory in which the file resides. " "For example, a file located at ``python/foobar/myfoobar.rst`` will have a" " category of ``foobar``. If you would like to organize your files in " "other ways where the name of the subfolder would not be a good category " "name, you can set the setting ``USE_FOLDER_AS_CATEGORY`` to ``False``. " "When parsing dates given in the page metadata, Pelican supports the W3C's" " `suggested subset ISO 8601`__." msgstr "" "需要注意的是,除了title外,其他所有元数据都是可以缺省的。若未指定日期元数据并且将 ``DEFAULT_DATE`` 设为了 " "``'fs'``,Pelican就会从文件的 “mtime” 时间戳中获取日期信息;文件所在目录的名称会被作为category。例如 " "``python/foobar/myfoobar.rst`` 的category元数据值就会被设为 ``foobar`` " "。如果您不希望子目录的名称成为category的值,则需要在设置中将 ``USE_FOLDER_AS_CATEGORY`` 设为 " "``False`` 。进行日期元数据的解析时,Pelican支持W3C的 `suggested subset ISO 8601`__ 标准。" #: ../../content.rst:137 0f142fac1e9e41eeb0cf4cc70a42f72b msgid "" "So the title is the only required metadata. If that bothers you, worry " "not. Instead of manually specifying a title in your metadata each time, " "you can use the source content file name as the title. For example, a " "Markdown source file named ``Publishing via Pelican.md`` would " "automatically be assigned a title of *Publishing via Pelican*. If you " "would prefer this behavior, add the following line to your settings " "file::" msgstr "" "总而言之,标题是唯一必须指定的元数据。如果您甚至懒得写标题,也不用担心,Pelican会自动将文件名作为内容的标题。例如,Markdown源文件 " "``Publishing via Pelican.md`` 的标题会自动设为 *Publishing via " "Pelican*。如果您希望启用这个特性,请在设置文件中添加下面这么一行:" #: ../../content.rst:148 481919b7e3974c8293d420886105941f msgid "" "When experimenting with different settings (especially the metadata ones)" " 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`` 参数。" #: ../../content.rst:155 466fa8d713b343d1a8ae8266c3031479 msgid "" "``modified`` should be last time you updated the article, and defaults to" " ``date`` if not specified. Besides you can show ``modified`` in the " "templates, feed entries in feed readers will be updated automatically " "when you set ``modified`` to the current date after you modified your " "article." msgstr "" "``modified`` 元数据中应该为文章最后一次的修改时间,若没有指定,会自动与 ``date`` 保持一致。在您修改文章并将 " "``modified`` 设为当前日期后,除了在模板中显示 ``modified`` 之外,feed阅读器中的feed条目也会自动更新。" #: ../../content.rst:160 e7c9358cd2a74e64863af04736d10775 msgid "" "``authors`` is a comma-separated list of article authors. If there's only" " one author you can use ``author`` field." msgstr "``authors`` 元数据中是文章作者的列表,各个作者之间用逗号分隔。若只有一个作者,可以使用 ``author`` 。" #: ../../content.rst:163 15bdeea8538244948ca509ee57ef8f63 msgid "" "If you do not explicitly specify summary metadata for a given post, the " "``SUMMARY_MAX_LENGTH`` setting can be used to specify how many words from" " the beginning of an article are used as the summary. You can also use an" " article's first N paragraphs as its summary using the " "``SUMMARY_MAX_PARAGRAPHS`` setting. If both settings are in use, the " "specified number of paragraphs will be used but may be truncated to " "respect the specified maximum length." msgstr "" "若您没有显式地指定summary元数据,Pelican会自动从推文开头截取 ``SUMMARY_MAX_LENGTH`` " "指定长度的内容作为summary。另外,您也可以使用配置项 ``SUMMARY_MAX_PARAGRAPHS`` " "指定推文开头前N段内容作为summary。若同时指定了这两个配置项,首先会考虑 ``SUMMARY_MAX_PARAGRAPHS`` " ",若前N段的总长度超过 ``SUMMARY_MAX_LENGTH`` ,还是会按照 ``SUMMARY_MAX_LENGTH`` 进行截断。" #: ../../content.rst:170 64a7dcd4911447338ac1871083242a83 msgid "" "You can also extract any metadata from the filename through a regular " "expression to be set in the ``FILENAME_METADATA`` setting. All named " "groups that are matched will be set in the metadata object. The default " "value for the ``FILENAME_METADATA`` setting will only extract the date " "from the filename. For example, if you would like to extract both the " "date and the slug, you could set something like: " "``'(?P\\d{4}-\\d{2}-\\d{2})_(?P.*)'``" msgstr "" "您可以通过 ``FILENAME_METADATA`` " "设置来使用正则表达式从文件名中提取元数据。正则匹配到的每个命名分组都被看成一个元数据。预设的 ``FILENAME_METADATA`` " "只会从文件名中提取date和slug。例如,可以使用 " "``'(?P\\d{4}-\\d{2}-\\d{2})_(?P.*)'`` 提取date和slug。" #: ../../content.rst:177 0b6aaca5fc60494fafd2bdf345f25ab3 msgid "" "Please note that the metadata available inside your files takes " "precedence over the metadata extracted from the filename." msgstr "请注意,您在推文中直接指定的元数据的优先级是大于从文件名中提取的。" #: ../../content.rst:181 463df99e715d44c09a48770ddda1e139 msgid "Pages" msgstr "页面" #: ../../content.rst:183 d2dd51b7abe14dc4921adcf50b8218fb msgid "" "If you create a folder named ``pages`` inside the content folder, all the" " files in it will be used to generate static pages, such as **About** or " "**Contact** pages. (See example filesystem layout below.)" msgstr "" "如果您在content文件夹下创建了一个 ``pages`` 文件夹,那么Pelican会为其中的每个文件生成一个例如 **关于** " "、**联系我们** 这样的静态页面。(具体可以看下面项目文件组织的例子)" #: ../../content.rst:187 3ac83019ba9c44e781a7b67c837c99d6 msgid "" "You can use the ``DISPLAY_PAGES_ON_MENU`` setting to control whether all " "those pages are displayed in the primary navigation menu. (Default is " "``True``.)" msgstr "您可以通过 ``DISPLAY_PAGES_ON_MENU`` 设置来决定页面是否被列在主导航菜单中(默认值为 ``True`` )。" #: ../../content.rst:190 56486e599f334e0fbc976bcf2d22bd5e msgid "" "If you want to exclude any pages from being linked to or listed in the " "menu, then add a ``status: hidden`` attribute to its metadata. This is " "useful for things like making error pages that fit the generated theme of" " your site." msgstr "" "如果您希望让某些页面不会被链接并且也不列在任何菜单中,可以为它加上元数据属性 ``status: hidden`` " "。这在将错误页面适配到所用主题时很有用。" #: ../../content.rst:195 0205a4cab1a040a4aef74a3c375855a4 msgid "Static content" msgstr "静态内容" #: ../../content.rst:197 2a86301465bd4f41944964cb0edf1572 msgid "" "Static files are files other than articles and pages that are copied to " "the output folder as-is, without processing. You can control which static" " files are copied over with the ``STATIC_PATHS`` setting of the project's" " ``pelicanconf.py`` file. Pelican's default configuration includes the " "``images`` directory for this, but others must be added manually. In " "addition, static files that are explicitly linked to are included (see " "below)." msgstr "" "静态文件与文章、页面不同,会原模原样地复制到输出文件夹中。当然,您也通过设置 ``STATIC_PATHS`` " "更改复制时的目标文件夹。Pelican的默认配置中只包含了 ``images`` " "一个文件夹,其他的需要手动添加。另外静态文件也包含那些被显式链接的(详见后文)。" #: ../../content.rst:206 3b74472b747e4cd494aae142ec4deecc msgid "" "In the default configuration, all files with a valid content file suffix " "(``.html``, ``.rst``, ``.md``, ...) get processed by the article and page" " generators *before* the static generator. This is avoided by altering " "the ``*_EXCLUDE`` settings appropriately." msgstr "" "在默认配置下,所有后缀名有效的文件( ``.html`` 、 ``.rst`` 、 ``.md`` , " "...)都会由文章/页面生成器处理,这是在静态文件处理之前完成的。若这些文件中的某一些是静态文件,可以合理使用 ``*_EXCLUDE`` " "配置项将他们排除(例如 ``ARTICLE_EXCLUDES`` 、 ``PAGE_EXCLUDES``)。" #: ../../content.rst:212 ab263a1d5b5a4fb0a705257701b8b6c3 msgid "Mixed content in the same directory" msgstr "在同一个目录下存放不同类型的内容" #: ../../content.rst:214 dfec139d8f98465ea117dcd02f3e7870 msgid "" "Starting with Pelican 3.5, static files can safely share a source " "directory with page source files, without exposing the page sources in " "the generated site. Any such directory must be added to both " "``STATIC_PATHS`` and ``PAGE_PATHS`` (or ``STATIC_PATHS`` and " "``ARTICLE_PATHS``). Pelican will identify and process the page source " "files normally, and copy the remaining files as if they lived in a " "separate directory reserved for static files." msgstr "" "从Pelican 3.5开始,静态文件就可以和页面源文件安全地放在同一目录下了。这些包含了不同类型内容文件的目录需要添加到 " "``STATIC_PATHS`` 和 ``PAGE_PATHS`` 中(或者 ``STATIC_PATHS`` 和 " "``ARTICLE_PATHS`` " "中)。Pelican会正常地识别和处理文章和页面源文件,然后再把静态文件复制,和处理处于单独一个文件夹的静态文件行为一致。" #: ../../content.rst:221 de484f74c05a48e4ac84631e56309bf6 msgid "" "Note: Placing static and content source files together in the same source" " directory does not guarantee that they will end up in the same place in " "the generated site. The easiest way to do this is by using the " "``{attach}`` link syntax (described below). Alternatively, the " "``STATIC_SAVE_AS``, ``PAGE_SAVE_AS``, and ``ARTICLE_SAVE_AS`` settings " "(and the corresponding ``*_URL`` settings) can be configured to place " "files of different types together, just as they could in earlier versions" " of Pelican." msgstr "" "请注意:Pelican不保证放在同一个源目录下的静态文件和内容文件在站点生成完后最终出现在同一个地方。要让他们出现在一个地方,可以使用 " "``{attach}`` 链接语法(下面会提到)。此外,还可以通过设置 ``STATIC_SAVE_AS`` 、 ``PAGE_SAVE_AS``" " 和 ``ARTICLE_SAVE_AS`` (还有相应的 ``*_URL`` 设置)让不同类型的文件最终放在一起。" #: ../../content.rst:232 6733f6cc9bbb4ee0995d7f818c24b850 msgid "Linking to internal content" msgstr "内部链接" #: ../../content.rst:234 e0f9e61fef924c82aa7950ad20c0b686 msgid "" "From Pelican 3.1 onwards, it is now possible to specify intra-site links " "to files in the *source content* hierarchy instead of files in the " "*generated* hierarchy. This makes it easier to link from the current post" " to other content that may be sitting alongside that post (instead of " "having to determine where the other content will be placed after site " "generation)." msgstr "" "从Pelican 3.1开始,站内链接可以在 *源文件* 层次下指定,而不是只能在 *生成后的站点* " "层次下指定。当需要在当前推文链接到邻近位置的内容时,可以直接从源内容文件的位置开始链接(而不需要考虑在站点生成后文件会被放在哪儿)。" #: ../../content.rst:240 8de8953b665841818066d12cec9631d4 msgid "" "To link to internal content (files in the ``content`` directory), use the" " following syntax for the link target: ``{filename}path/to/file``. Note: " "forward slashes, ``/``, are the required path separator in the " "``{filename}`` directive on all operating systems, including Windows." msgstr "" "要链接到站内(即在 ``content`` 目录下的文件),使用下述的目标链接语法: ``{filename}path/to/file`` " "。注意,在所有操作系统(当然也包括Windows)上,路径的分隔符都要使用正斜杠 ``/`` 。" #: ../../content.rst:246 dbd1404fa9fe47b7ba2594d1cc5d84f5 msgid "For example, a Pelican project might be structured like this::" msgstr "例如,某Pelican项目的文件结构组织如下:" #: ../../content.rst:257 04b1728643124b6e903acb6c32d6c970 msgid "In this example, ``article1.rst`` could look like this::" msgstr "在这个例子中, ``article1.rst`` 的内容如下:" #: ../../content.rst:269 9197b32aca1c4af6ac2f2b56e7498206 msgid "and ``article2.md``::" msgstr "``article2.md`` 的内容如下:" #: ../../content.rst:280 baccc8dc58cd482cb42bd44d78d16d42 msgid "Linking to static files" msgstr "链接到静态文件" #: ../../content.rst:282 33067c5bbb554baea7306b0c2f0b5356 msgid "" "You can link to static content using ``{static}path/to/file``. Files " "linked to with this syntax will automatically be copied to the output " "directory, even if the source directories containing them are not " "included in the ``STATIC_PATHS`` setting of the project's " "``pelicanconf.py`` file." msgstr "" "您可以通过 ``{static}path/to/file`` 链接到静态内容。使用这个指令链接的文件都会被自动复制到输出目录中,即使它没有包含在 " "``STATIC_PATHS`` 中。" #: ../../content.rst:287 ../../content.rst:322 533a9aee68e5452db609cc5e1e569381 #: 7c9993b8f8c44863975e5db9d5ce1cb8 msgid "For example, a project's content directory might be structured like this::" msgstr "例如,某Pelican项目的文件结构组织如下:" #: ../../content.rst:297 7c70d916da684551b499f25fd9567e11 msgid "``test.md`` would include::" msgstr "``test.md`` 的文件内容如下:" #: ../../content.rst:302 8921fb6dfbba4e6ea4c0220650617dc6 msgid "" "Site generation would then copy ``han.jpg`` to ``output/images/han.jpg``," " ``menu.pdf`` to ``output/pdfs/menu.pdf``, and write the appropriate " "links in ``test.md``." msgstr "" "站点生成时会将 ``han.jpg`` 拷贝到 ``output/images/han.jpg`` 、将 ``menu.pdf`` 拷贝到 " "``output/pdfs/menu.pdf`` ,同时也会自动把 ``test.md`` 中的相关链接都替换为正确的。" #: ../../content.rst:306 244c1bb923ec4b7ab33c039f2deefe94 msgid "" "If you use ``{static}`` to link to an article or a page, this will be " "turned into a link to its source code." msgstr "如果您使用 ``{static}`` 链接到文章或页面,会链接到他们的源文件而不是渲染后的文章或页面。" #: ../../content.rst:310 50d69d50e26d4b48b4b1fb2643efa0e6 msgid "Attaching static files" msgstr "将静态文件作为附件" #: ../../content.rst:312 f28e37fba55b49a99f03bbafc669ef87 msgid "" "Starting with Pelican 3.5, static files can be \"attached\" to a page or " "article using this syntax for the link target: ``{attach}path/to/file``. " "This works like the ``{static}`` syntax, but also relocates the static " "file into the linking document's output directory. If the static file " "originates from a subdirectory beneath the linking document's source, " "that relationship will be preserved on output. Otherwise, it will become " "a sibling of the linking document." msgstr "" "从Pelican 3.5开始,静态文件可以使用下述语法 “附” 在页面或文章上: ``{attach}path/to/file`` 。这和 " "``{static}`` " "语法很像,也会将静态文件重定位到文章或页面的对应输出目录中。当推文所链接的静态文件处于其源文件所在位置的子目录下时,这种父子关系在输出目录中会得以保留。否则,默认情况下,静态文件会和对应的文档输出到同一目录层级下。" #: ../../content.rst:320 dba2dfdd8ef14b41b37f9db53ebb9704 msgid "This only works for linking to static files." msgstr "这只在链接到静态文件时起作用。" #: ../../content.rst:333 a523bb1926b54025908733f0aca757c5 msgid "``pelicanconf.py`` would include::" msgstr "例如对于某设置文件 ``pelicanconf.py`` " #: ../../content.rst:340 d12e170143234a51862ac73d04acb16b msgid "``testpost.md`` would include::" msgstr "``testpost.md`` 的内容如下:" #: ../../content.rst:350 8628f5e27e51444fad84dc68aa8a74bb msgid "" "Site generation would then produce an output directory structured like " "this::" msgstr "对应生成输出的站点目录结构如下:" #: ../../content.rst:360 8f74e3a043b84a088708bc046118b327 msgid "" "Notice that all the files linked using ``{attach}`` ended up in or " "beneath the article's output directory." msgstr "可以注意到,使用 ``{attach}`` 链接的文件要么和文章输出处于同级目录,要么就是在文章所在位置的子目录下。" #: ../../content.rst:363 cdaf8ffc246645da8614e76072a6704d msgid "" "If a static file is linked multiple times, the relocating feature of " "``{attach}`` will only work in the first of those links to be processed. " "After the first link, Pelican will treat ``{attach}`` like ``{static}``. " "This avoids breaking the already-processed links." msgstr "" "若一个静态文件被多次链接, ``{attach}`` 只会在该静态文件第一次被链接时进行重定位处理(即按照上面的规则复制到对应目录)。之后使用 " "``{attach}`` 进行的链接的效果就和 ``{static}`` 一模一样了。这样子就可以避免破坏已经生成好的链接。" #: ../../content.rst:368 0783ef45de914a48af081fbf5978ae93 msgid "" "**Be careful when linking to a file from multiple documents:** Since the " "first link to a file finalizes its location and Pelican does not define " "the order in which documents are processed, using ``{attach}`` on a file " "linked by multiple documents can cause its location to change from one " "site build to the next. (Whether this happens in practice will depend on " "the operating system, file system, version of Pelican, and documents " "being added, modified, or removed from the project.) Any external sites " "linking to the file's old location might then find their links broken. " "**It is therefore advisable to use {attach} only if you use it in all " "links to a file, and only if the linking documents share a single " "directory.** Under these conditions, the file's output location will not " "change in future builds. In cases where these precautions are not " "possible, consider using ``{static}`` links instead of ``{attach}``, and " "letting the file's location be determined by the project's " "``STATIC_SAVE_AS`` and ``STATIC_URL`` settings. (Per-file ``save_as`` and" " ``url`` overrides can still be set in ``EXTRA_PATH_METADATA``.)" msgstr "" "**当同一文件被多个推文链接时需要尤其小心:** " "第一次链接到文件时,Pelican就会确定其最终位置,而Pelican处理推文的顺序是不能确定的,因此多个推文使用 ``{attach}`` " "链接到同一文件时,每一次站点生成后该文件的最终位置是无法确定的(这种情况发生与否取决于操作系统、文件系统、Pelican的版本、推文从项目中的添加修改移除)。当这种情况发生时,其他站点到本站点文件旧位置的链接就会损坏。**因此,只有当静态文件只被一篇推文链接,或链接到某静态文件的推文都在同一目录下时才使用" " {attach}**。在这种情况下,该文件的输出位置在站点构建中不会变化。如果无法保证上述条件来预防链接损坏,可以考虑使用 " "``{static}`` 来替换 ``{attach}`` 。如此,文件的最终位置就由 ``STATIC_SAVE_AS`` 和 " "``STATIC_URL`` 来决定。(每个文件的 ``save_as`` 和 ``url`` 仍然可以通过更改 " "``EXTRA_PATH_METADATA`` 设置来覆盖)" #: ../../content.rst:385 85347094a7f741ac96f2489969660181 msgid "" "When using ``{attach}``, any parent directory in ``*_URL`` / " "``*_SAVE_AS`` settings should match each other. See also: :ref:`url-" "settings`" msgstr "" "当使用{attach}时, ``*_URL`` / ``*_SAVE_AS`` 设置中的所有父目录都应该互相对应。具体请参见 " ":ref:`URL配置` 。" #: ../../content.rst:389 eaefe7d009be4a5797cabee8bf1230a4 msgid "Linking to authors, categories, index and tags" msgstr "链接到作者、分类、索引、标签" #: ../../content.rst:391 2c5b13a80a6b49acadeed0ff3d71236f msgid "" "You can link to authors, categories, index and tags using the " "``{author}name``, ``{category}foobar``, ``{index}`` and ``{tag}tagname`` " "syntax." msgstr "" "您可以通过 ``{author}name`` 、 ``{category}foobar`` 、 ``{index}`` 和 " "``{tag}tagname`` 这样的语法链接到作者、分类、索引和标签。" #: ../../content.rst:395 ec56f8d188bf4e41a961f00535b16dfb msgid "Deprecated internal link syntax" msgstr "已弃用的内部链接语法" #: ../../content.rst:397 01e39bc18c964baaaf43779b37fbaa01 msgid "" "To remain compatible with earlier versions, Pelican still supports " "vertical bars (``||``) in addition to curly braces (``{}``) for internal " "links. For example: ``|filename|an_article.rst``, ``|tag|tagname``, " "``|category|foobar``. The syntax was changed from ``||`` to ``{}`` to " "avoid collision with Markdown extensions or reST directives. Similarly, " "Pelican also still supports linking to static content with " "``{filename}``. The syntax was changed to ``{static}`` to allow linking " "to both generated articles and pages and their static sources." msgstr "" "为了保持和早期版本的兼容,在内部链接中除了使用花括号( ``{}`` )外,还支持在内部链接中使用竖线( ``||`` )。例如, " "``|filename|an_article.rst`` 、 ``|tag|tagname`` 、 ``|category|foobar`` " "。将语法中的 ``||`` 改到 ``{}`` 是为了避免和Markdown或reST的语法和指令相冲突。类似地, ``{filename}`` " "虽然仍能使用,但是其语法已经改为了 ``{static}`` 。 ``{static}`` 既可以链接到文章或页面,也可以链接到静态资源。" #: ../../content.rst:405 375eca8f0c324943a3d5ba60f46e8aa7 msgid "Support for the old syntax may eventually be removed." msgstr "对旧语法地支持最终会被移除。" #: ../../content.rst:408 d1e5719616d5454a810ed1562d0610fa msgid "Including other files" msgstr "引入其他文件" #: ../../content.rst:409 b429cad5b7904db5b16053bd9dbc7bb6 msgid "Both Markdown and reStructuredText syntaxes provide mechanisms for this." msgstr "Markdown和reStructuredText的语法中都提供了这种机制" #: ../../content.rst:411 fa6e783b42c84147a18f2a23136a8212 msgid "" "Following below are some examples for **reStructuredText** using `the " "include directive`_:" msgstr "下面是 **reStructuredText** 使用 `include指令`_ 的一些例子:" #: ../../content.rst:417 ecbaa72c1df64857b2e720ab7055e258 msgid "" "Include a fragment of a file delimited by two identifiers, highlighted as" " C++ (slicing based on line numbers is also possible):" msgstr "下面的例子,引入了一段用一对标识符分隔的文件片段,并指定以C++语法进行高亮显示。(同样支持通过行号指定片段)" #: ../../content.rst:426 04bf027b52124b669b3b56ea50ac240d msgid "" "Include a raw HTML file (or an inline SVG) and put it directly into the " "output without any processing:" msgstr "将一HTML文件(或者一个行内SVG)直接引入,并且不进行任何处理直接将其作为输出:" #: ../../content.rst:433 612365f02c5a471295f2f3601f0d95e9 msgid "" "For **Markdown**, one must rely on an extension. For example, using the " "`mdx_include plugin`_:" msgstr "对于 **Markdown** ,若要进行文件引入,就必须使用扩展插件。例如可以使用 `mdx_include plugin`_ :" #: ../../content.rst:443 30c87f2b5e594c24ac8ab719614c71fd msgid "Importing an existing site" msgstr "导入已有站点" #: ../../content.rst:445 f0f0ccd87dcc4afebe9b7d954481eeb2 msgid "" "It is possible to import your site from several other blogging sites " "(like WordPress, Tumblr, ..) using a simple script. See :ref:`import`." msgstr "您可以使用一个简单的脚本导入已有的站点(例如WordPress、Tumblr)。详见 :ref:`导入已有站点` 。" #: ../../content.rst:449 48de7111f6ec49ec8637c06e7d774f26 msgid "Translations" msgstr "翻译" #: ../../content.rst:451 0d1f7e6d14b746e2bb40f200c23f89a5 msgid "" "It is possible to translate articles. To do so, you need to add a " "``lang`` meta attribute to your articles/pages and set a ``DEFAULT_LANG``" " setting (which is English [en] by default). With those settings in " "place, only articles with the default language will be listed, and each " "article will be accompanied by a list of available translations for that " "article." msgstr "" "一篇文章可以有多个翻译版本。对于这类文章,您需要加上元数据属性 ``lang`` ,并且配置 ``DEFAULT_LANG`` " "(默认为[en])。完成上述配置后,文章列表中列出的是默认语言版本的文章,文章内容页中会列出所有可用的翻译版本供读者选择。" #: ../../content.rst:459 61df3a34ac194a2eb037c1b4e868265c msgid "" "This core Pelican functionality does not create sub-sites (e.g. " "``example.com/de``) with translated templates for each language. For such" " advanced functionality the `i18n_subsites plugin`_ can be used." msgstr "" "Pelican的这个核心功能并不会给同一文章的不同语言版本创建子站点(例如 ``example.com/de`` " ")。但是如果需要创建子站点的话,可以使用扩展插件 `i18n_subsites plugin`_ 。" #: ../../content.rst:464 c05ed4b06cec45248f976be0580b257c msgid "" "By default, Pelican uses the article's URL \"slug\" to determine if two " "or more articles are translations of one another. (This can be changed " "with the ``ARTICLE_TRANSLATION_ID`` setting.) The slug can be set " "manually in the file's metadata; if not set explicitly, Pelican will " "auto-generate the slug from the title of the article." msgstr "" "默认情况下,Pelican会使用文章的URL “slug” 来判断当前文档是否是同一篇文章的不同翻译版本。(这一点可以通过配置 " "``ARTICLE_TRANSLATION_ID`` " "来改变)slug可以通过元数据手动指定,若没有,Pelican会根据文章的标题(title)来自动生成slug。" #: ../../content.rst:470 e448fdfd15c046fb8c641fcead12b26d msgid "" "Here is an example of two articles, one in English and the other in " "French." msgstr "以下的例子是一篇文章有英语和法语两个翻译版本的情况。" #: ../../content.rst:472 62a186c5d6194a37b884343a858f2200 msgid "The English article::" msgstr "英语文章如下:" #: ../../content.rst:482 b32c5433696e4a09adb804cef323b3f1 msgid "And the French version::" msgstr "法语版本为:" #: ../../content.rst:492 b4d1d69ebe22462d985ebe2cfc8cd1e8 msgid "" "Post content quality notwithstanding, you can see that only item in " "common between the two articles is the slug, which is functioning here as" " an identifier. If you'd rather not explicitly define the slug this way, " "you must then instead ensure that the translated article titles are " "identical, since the slug will be auto-generated from the article title." msgstr "值得注意的是,以上两篇文章的slug是相同的,即slug作为唯一标识符存在。若您没有手动指定slug,那么请保证同一篇文章的不同翻译版本的标题是相同的。如此,由于slug会根据文章标题自动生成,它们隐含的slug会是相同的。" #: ../../content.rst:498 2e50d70746634009a070dc41068fbc89 msgid "" "If you do not want the original version of one specific article to be " "detected by the ``DEFAULT_LANG`` setting, use the ``translation`` " "metadata to specify which posts are translations::" msgstr "" "如果您不希望某篇文章的原始版本以 ``DEFAULT_LANG`` 翻译版本出现,可以使用 ``translation`` " "元数据来指出本推文是一个非默认语言的翻译版本。(译者注:例如,设置的默认语言为zh_CN,如果某篇推文的原始版本是英文而不是中文,那么对于中文翻译版本的就可以指定其translations元数据为true,即对于该推文来说,中文版本是翻译后的版本)" #: ../../content.rst:515 01ecf34fd1e440ea908fd181001b38b6 msgid "Syntax highlighting" msgstr "语法高亮" #: ../../content.rst:517 4d7eebd1886347b383ea3b1c517b821d msgid "" "Pelican can provide colorized syntax highlighting for your code blocks. " "To do so, you must use the following conventions inside your content " "files." msgstr "您可以按照下面的约定在文件内容中添加代码块,Pelican可以完成五彩缤纷的语法高亮。" #: ../../content.rst:520 5896f772fcd04f309e2188040f0bea60 msgid "" "For reStructuredText, use the ``code-block`` directive to specify the " "type of code to be highlighted (in these examples, we'll use " "``python``)::" msgstr "对于reStructuredText,使用 ``code-block`` 指令指定代码所使用的语言(此处以``python``为例):" #: ../../content.rst:527 ec6ec4c325c6406ba3b00437116b84b8 msgid "" "For Markdown, which utilizes the `CodeHilite extension`_ to provide " "syntax highlighting, include the language identifier just above the code " "block, indenting both the identifier and the code::" msgstr "Markdown则使用 `CodeHilite extension`_ 扩展插件来完成语法高亮。在代码上方标记所用语言,同时将其与代码都进行缩进:" #: ../../content.rst:541 58220db84e4d4ab7950dad7ad36ea1b5 msgid "" "The specified identifier (e.g. ``python``, ``ruby``) should be one that " "appears on the `list of available lexers " "`_." msgstr "" "指定语言的标识符(例如 ``python``、``ruby``)必须是在 `可用列表 " "`_ 中列出的。" #: ../../content.rst:544 cb10d4bc6f4c44008ce8324df993c2ed msgid "" "When using reStructuredText the following options are available in the " "`code-block` directive:" msgstr "对于reStructuredText,下面列出的选项可以在 `code-block` 命令中使用:" #: ../../content.rst:548 3598816f6ab54705aa545de3eb95a22c msgid "Option" msgstr "选项" #: ../../content.rst:548 2861fb4a308a443c971110b5757e9d13 msgid "Valid values" msgstr "有效值" #: ../../content.rst:550 638a4299a7d346659254d7aa6e2485e7 msgid "anchorlinenos" msgstr "anchorlinenos" #: ../../content.rst:550 ../../content.rst:574 ../../content.rst:576 #: 0e32384143484934af18e224e414a45b 217edf5016f74e23a906623d077191ff #: c6b0e9c5aa4340329b2fe203222055df msgid "N/A" msgstr "N/A" #: ../../content.rst:550 e219ff4135fb45e8b27fdd71a874ffee msgid "If present, wrap line numbers in ```` tags." msgstr "指定行号是否显示在 标签中" #: ../../content.rst:551 8e95919e90e14208a8150c2c52cb20b9 msgid "classprefix" msgstr "classprefix" #: ../../content.rst:551 ../../content.rst:559 ../../content.rst:561 #: ../../content.rst:570 ../../content.rst:572 ../../content.rst:577 #: ../../content.rst:578 96789c1cd92545b1a9153e9be1c5726d #: 9e591c65044b4ca4aa876e0dd5ba94bc a1920b40389d4b25a66cb0e755389960 #: bee284b2086a40a4aa28bc87c916d9df cb11442c371b48349bba579e7dfce72b #: e330b50a8cea43a5b55771f04fc4e688 f28e8d5bd9544ccbbcb99037c02f08cf msgid "string" msgstr "string" #: ../../content.rst:551 f6d85a8a8ec74c46a313bcfb72f5283a msgid "String to prepend to token class names" msgstr "要添加到用于语法高亮的css类名前面的字符串" #: ../../content.rst:552 4fd6cd04ea444c389c6f77030eb0a123 msgid "hl_lines" msgstr "hl_lines" #: ../../content.rst:552 aa5112c2c73e40d9940b5a21eaa1d650 msgid "numbers" msgstr "numbers" #: ../../content.rst:552 1b03b3add35c44eeaef4d3c31dd51fb4 msgid "" "List of lines to be highlighted, where line numbers to highlight are " "separated by a space. This is similar to ``emphasize-lines`` in Sphinx, " "but it does not support a range of line numbers separated by a hyphen, or" " comma-separated line numbers." msgstr "需要高亮的行号列表,行号之间以空格隔开。这与Sphinx中的 ``emphasize-lines`` 类似,但是不支持使用连字符和逗号指定行号范围。" #: ../../content.rst:559 abe7266edc704a0b857856e92fd2022b msgid "lineanchors" msgstr "lineanchors" #: ../../content.rst:559 baa7634eb7e646e39698c24bc3ee82af msgid "Wrap each line in an anchor using this string and -linenumber." msgstr "用此处指定的字符串和 “-行号”给每一行都加上锚点。" #: ../../content.rst:561 21ccf81937cf4fe38f556f2852524269 msgid "linenos" msgstr "linenos" #: ../../content.rst:561 2b1b4a9f23e448d4baaf5d36b896a5ba msgid "" "If present or set to \"table\", output line numbers in a table; if set to" " \"inline\", output them inline. \"none\" means do not output the line " "numbers for this table." msgstr "开启此选项或将此选项设为“table”时,输出表格时会带上行号;如果设为“inline”,则内联输出行号;如果设为“none”,则不输出行号。" #: ../../content.rst:566 d9813ccee6d24eae8c539fd9cc0ddd54 msgid "linenospecial" msgstr "linenospecial" #: ../../content.rst:566 ../../content.rst:568 ../../content.rst:569 #: 1eeb1f08e07e4f95a03cbeca48b422a6 bac61cf96bc3466985c9f4d5b934055b #: eadc4e3c92094e589c3b931d20cd97ab msgid "number" msgstr "number" #: ../../content.rst:566 ff3b3aa5e45e4a3a837400e8333f7c5a msgid "If set, every nth line will be given the 'special' CSS class." msgstr "是否每隔几行就设置一行特殊的css样式类。" #: ../../content.rst:568 e32730e901bb460e975410fe26a9432f msgid "linenostart" msgstr "linenostart" #: ../../content.rst:568 48d2621a74174b82a71d52a921e2f60f msgid "Line number for the first line." msgstr "起始行的行号。" #: ../../content.rst:569 fcb4c1088bb04cd9ba6e4273e3013369 msgid "linenostep" msgstr "linenostep" #: ../../content.rst:569 1ce5e05481f84c7f84964bb1d2e3e9ae msgid "Print every nth line number." msgstr "每隔几行输出一次" #: ../../content.rst:570 110dc8da76774b3ca517ad93c53fbd3f msgid "lineseparator" msgstr "lineseparator" #: ../../content.rst:570 b9ba8609393c4ec8b964481ae2c66614 msgid "String to print between lines of code, '\\n' by default." msgstr "每行输出代码之间的输出字符串,默认为 '\\n'。" #: ../../content.rst:572 8b336c4c8e65427ebb1a89e94232199a msgid "linespans" msgstr "linespans" #: ../../content.rst:572 07c2d6ca97084859b47b09237633a4ab msgid "Wrap each line in a span using this and -linenumber." msgstr "使用指定的字符串和“-行号”将每一行包装在一个span中。" #: ../../content.rst:574 bd0c5e4ba73d458aa14fce20c1347910 msgid "nobackground" msgstr "nobackground" #: ../../content.rst:574 07672d498e2f4b6e8d4da4b5382a34f0 msgid "If set, do not output background color for the wrapping element" msgstr "若设置,则不为元素输出背景颜色" #: ../../content.rst:576 a054798a57814cfd9b363d7048dd9e1e msgid "nowrap" msgstr "nowrap" #: ../../content.rst:576 de085518cf324de4b6d917c616e2b7dd msgid "If set, do not wrap the tokens at all." msgstr "若设置,则不对token进行换行处理。" #: ../../content.rst:577 5989452c45bd4cc187e1cd1cfb88b440 msgid "tagsfile" msgstr "tagsfile" #: ../../content.rst:577 74b9388dcbe048ff824108bafc0bf72b msgid "ctags file to use for name definitions." msgstr "用于命名定义的ctags文件" #: ../../content.rst:578 0b355baf272c4e87a18b1594b311258f msgid "tagurlformat" msgstr "tagurlformat" #: ../../content.rst:578 dde5f2fd922b4b45b5eca083527dd93a msgid "format for the ctag links." msgstr "用于ctag链接的格式" #: ../../content.rst:581 e034ff3a3ee44ef185f8c3aed60fc692 msgid "" "Note that, depending on the version, your Pygments module might not have " "all of these options available. Refer to the *HtmlFormatter* section of " "the `Pygments documentation `_ for" " more details on each of the options." msgstr "" "请注意,由于版本的不同,Pygments模块可能不完全支持上述选项。请参考 `Pygments文档 " "`_ 中 *HtmlFormatter* " "一节获取每个选项的详细信息。" #: ../../content.rst:586 e7df88ffb2d4475ca19259b222d1ab3e msgid "" "For example, the following code block enables line numbers, starting at " "153, and prefixes the Pygments CSS classes with *pgcss* to make the names" " more unique and avoid possible CSS conflicts::" msgstr "" "举个例子,下面的代码块开启了行号显示,从153行开始输出,并且指定Pygments的CSS类以 *pgcss* " "为前缀,使得类名更为独特并避免可能的CSS冲突:" #: ../../content.rst:597 fc9b8b1fa7364ce1a274281a8e2e7237 msgid "" "It is also possible to specify the ``PYGMENTS_RST_OPTIONS`` variable in " "your Pelican settings file to include options that will be automatically " "applied to every code block." msgstr "" "您也可以在Pelican的配置文件中指定 ``PYGMENTS_RST_OPTIONS`` " ",如此就可以让Pelican自动在每个代码块上使用指定的选项。" #: ../../content.rst:601 b51dfbadd3bc42a483611d7013a87241 msgid "" "For example, if you want to have line numbers displayed for every code " "block and a CSS prefix, you would set this variable to::" msgstr "" "举个例子,若您希望每个代码块都显示行号,并且在CSS类名前都加上前缀pgcss,就可以像这样设置 ``PYGMENTS_RST_OPTIONS``" " :" #: ../../content.rst:606 82a9f33cc7c9493e8d8772f6c6fb63da msgid "" "If specified, settings for individual code blocks will override the " "defaults in your settings file." msgstr "" "若指定了 ``PYGMENTS_RST_OPTIONS`` ,同时也为代码块单独指定了一些选项,单独指定的会将 " "``PYGMENTS_RST_OPTIONS`` 覆盖。" #: ../../content.rst:610 d2baf0b12ba148f0af9ccab86542e35f msgid "Publishing drafts" msgstr "发布草稿" #: ../../content.rst:612 2ba53426b76742e6980e6700c94d3d96 msgid "" "If you want to publish an article or a page as a draft (for friends to " "review before publishing, for example), you can add a ``Status: draft`` " "attribute to its metadata. That article will then be output to the " "``drafts`` folder and not listed on the index page nor on any category or" " tag page." msgstr "" "如果您想要以草稿的形式发布文章或页面(例如在正式发布前给朋友预览),可以添加元数据属性 ``Status: draft`` 。如此,文章就会输出到" " ``drafts`` 文件夹中,并且不会被列在首页、分类或是标签页面中。" #: ../../content.rst:617 e3a756e1580d48378a16946caeb79c8a msgid "" "If your articles should be automatically published as a draft (to not " "accidentally publish an article before it is finished), include the " "status in the ``DEFAULT_METADATA``::" msgstr "" "若您希望文章默认以草稿形式发布(可以防止在完成文章前不小心将其正式发布),可以将此status属性加在 ``DEFAULT_METADATA`` " "中:" #: ../../content.rst:625 c4b74b80b8714eb2a69d81f42f6e3e27 msgid "" "To publish a post when the default status is ``draft``, update the post's" " metadata to include ``Status: published``." msgstr "要发布当前处于 ``draft`` 状态的推文,更新推文的元数据,使其中包括 ``Status: published``。" #: ../../content.rst:629 f8baadb48b12467aaa1025f018ab6621 msgid "Hidden Posts" msgstr "隐藏推文" #: ../../content.rst:631 eb5efca86b2d4432a49703306334591a msgid "" "Like pages, posts can also be marked as ``hidden`` with the ``Status: " "hidden`` attribute. Hidden posts will be output to ``ARTICLE_SAVE_AS`` as" " expected, but are not included by default in tag, category, and author " "indexes, nor in the main article feed. This has the effect of creating an" " \"unlisted\" post." msgstr "" "和页面一样,推文也能通过 ``Status: hidden`` 标记为隐藏状态。隐藏的推文会输出到 ``ARTICLE_SAVE_AS`` " "指定的目录中,这些推文“不会被列出”,即不会在标签、分类、作者主页、feed中出现。" #: ../../content.rst:637 2d67772b24bb40748d56dc3938195ce6 msgid "Skip Posts" msgstr "忽略推文" #: ../../content.rst:639 0c97c429a7a74ba4830851491829d63e msgid "" "Posts marked with ``skip`` status are ignored entirely. They are not " "processed nor output to the ``ARTICLE_SAVE_AS`` path. Such posts will " "similarly not be included in indexes or feeds." msgstr "" "状态设为了 ``skip`` 的推文将会被完全忽略。也就是说,他们不会被处理,也不会输出到 ``ARTICLE_SAVE_AS`` " "指定的目录中。同样,被忽略的推文不会出现在索引或者订阅源中。"