Debian Codegraph @

docs/locale/zh_CN/LC_MESSAGES/tips.po

raw
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-11-07 16:25+0800\n"
11 "PO-Revision-Date: 2024-06-27 19:00+0800\n"
12 "Last-Translator: GeorgeHu <[email protected]>\n"
13 "Language: zh_CN\n"
14 "Language-Team: zh_CN <[email protected]>\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.16.0\n"
20
21 #: ../../tips.rst:2 9c4618aaecd44b0d93537cb760e227fa
22 msgid "Tips"
23 msgstr "小技巧"
24
25 #: ../../tips.rst:4 f49ab5e1ef034ca29140bac3832e8e1c
26 msgid "Here are some tips about Pelican that you might find useful."
27 msgstr "以下是一些实用的小技巧。"
28
29 #: ../../tips.rst:7 ../../tips.rst:309 95bea35d0347495bb551fe9486bcd29d
30 #: b64b7ed713b64f588ea7488c6d0b0441
31 msgid "Custom 404 Pages"
32 msgstr "自定义404页面"
33
34 #: ../../tips.rst:9 d59dc30de5954aa1abc7c46fbac596c6
35 msgid ""
36 "When a browser requests a resource that the web server cannot find, the "
37 "web server usually displays a generic \"File not found\" (404) error page"
38 " that can be stark and unsightly. One way to provide an error page that "
39 "matches the theme of your site is to create a custom 404 page (*not* an "
40 "article), such as this Markdown-formatted example stored in "
41 "``content/pages/404.md``::"
42 msgstr ""
43 "当浏览器请求的资源无法在服务器中找到时,web服务器常常会显示一个通用的“File not found "
44 "404”的错误页面,这可能会不太美观。为了能使用一个与站点主题相匹配的404页面(注意是页面而 **不是** "
45 "文章),例如下面这个Markdown格式的例子,将此文件存为了 ``content/pages/404.md`` :"
46
47 #: ../../tips.rst:22 416f9b3eeaac4af8bdc9f32b7cdcba39
48 msgid ""
49 "The next step is to configure your web server to display this custom page"
50 " instead of its default 404 page. For Nginx, add the following to your "
51 "configuration file's ``location`` block::"
52 msgstr ""
53 "接下来就是要配置web服务器,使其显示此自定义页面而不是默认的404页面。例如对于Nginx,在配置文件的 ``location`` "
54 "块中添加下面的命令:"
55
56 #: ../../tips.rst:28 5d52fbcc9d9d4603b3f9d97360face10
57 msgid "For Apache::"
58 msgstr "对于Apache:"
59
60 #: ../../tips.rst:32 5413c6bcff6a41688ffcede94b9955e4
61 msgid ""
62 "For Amazon S3, first navigate to the ``Static Site Hosting`` menu in the "
63 "bucket settings on your AWS console. From there::"
64 msgstr "对于Amazon S3实例,先在控制台的设置中找到 ``Static Site Hosting`` ,并添加:"
65
66 #: ../../tips.rst:38 9b02aa39367a4c33918bddef02d1788d
67 msgid "Publishing to GitHub Pages"
68 msgstr "发布到GitHub Pages"
69
70 #: ../../tips.rst:40 ca3f1deb69a04d40a89576f580d63781
71 msgid ""
72 "If you use `GitHub <https://github.com/>`_ for your Pelican site you can "
73 "publish your site to `GitHub Pages <https://pages.github.com/>`_ for "
74 "free. Your site will be published to ``https://<username>.github.io`` if "
75 "it's a user or organization site or to "
76 "``https://<username>.github.io/<repository>`` if it's a project site. "
77 "It's also possible to `use a custom domain with GitHub Pages "
78 "<https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-"
79 "github-pages-site>`_."
80 msgstr ""
81 "如果将Pelican站点放在了 `GitHub <https://github.com/>`_ 上,那么你就可以将站点免费发布在 `GitHub "
82 "Pages <https://pages.github.com/>`_ 上。如果是用户或组织的站点,发布的地址为 "
83 "``https://<username>.github.io`` ;如果是某个项目的站点,发布的地址则为 "
84 "``https://<username>.github.io/<repository>`` 。当然也可以 `在GitHub "
85 "Pages上使用自定义域名 <https://docs.github.com/en/pages/configuring-a-custom-"
86 "domain-for-your-github-pages-site>`_ 。"
87
88 #: ../../tips.rst:46 5962c3cb4a0b41289d6b08b9edd2fdee
89 msgid ""
90 "There are `two ways to publish a site to GitHub Pages "
91 "<https://docs.github.com/en/pages/getting-started-with-github-"
92 "pages/configuring-a-publishing-source-for-your-github-pages-site>`_:"
93 msgstr ""
94 "总的来说,有 `两种将站点发布到GitHub Pages的方法 <https://docs.github.com/en/pages"
95 "/getting-started-with-github-pages/configuring-a-publishing-source-for-"
96 "your-github-pages-site>`_ :"
97
98 #: ../../tips.rst:48 ad6f071b3cdc4529a41776f799347da0
99 msgid ""
100 "**Publishing from a branch:** run ``pelican`` locally and push the output"
101 " directory to a special branch of your GitHub repo. GitHub will then "
102 "publish the contents of this branch to your GitHub Pages site."
103 msgstr ""
104 "**从某一分支发布:** 在本地运行 ``pelican`` "
105 "后将输出文件夹push到GitHub仓库的某一分支。GitHub就会将该分支的内容发布到GitHub Pages上。"
106
107 #: ../../tips.rst:51 6237e147cf4142d9b172588964ec00d2
108 msgid ""
109 "**Publishing with a custom GitHub Actions workflow:** just push the "
110 "source files of your Pelican site to your GitHub repo's default branch "
111 "and have a custom GitHub Actions workflow run ``pelican`` for you to "
112 "generate the output directory and publish it to your GitHub Pages site. "
113 "This way you don't need to run ``pelican`` locally. You can even edit "
114 "your site's source files using GitHub's web interface and any changes "
115 "that you commit will be published."
116 msgstr ""
117 "**从自定义GitHub Actions工作流发布:** 将内容源文件推送到GitHub仓库的默认分支,然后在GitHub "
118 "Actions工作流中执行 ``pelican`` 以生成输出文件夹,最后将其发布到你的GitHub Pages站点。此种方法下就无需在本地执行 "
119 "``pelican`` 命令了。甚至可以直接在GitHub的网页中在线修改站点内容源文件。"
120
121 #: ../../tips.rst:60 f2655b8ab23147e58fd68e2385a7624a
122 msgid "Publishing a Project Site to GitHub Pages from a Branch"
123 msgstr "从某一分支发布项目站点到GitHub Pages"
124
125 #: ../../tips.rst:62 1a156c5a8019400d86a33ce306b521ac
126 msgid ""
127 "To publish a Pelican site as a Project Page you need to *push* the "
128 "content of the ``output`` dir generated by Pelican to a repository's "
129 "``gh-pages`` branch on GitHub."
130 msgstr ""
131 "要将Pelican站点发布为项目页面,你需要将Pelican生成的 ``output`` 目录 **push** 到GitHub仓库的 ``gh-"
132 "pages`` 分支。"
133
134 #: ../../tips.rst:66 22caeeba90b24dbe9f0305370de074fc
135 msgid ""
136 "The excellent `ghp-import <https://github.com/davisp/ghp-import>`_, which"
137 " can be installed with ``pip``, makes this process really easy."
138 msgstr ""
139 "可通过 ``pip`` 安装的 `ghp-import <https://github.com/davisp/ghp-import>`_ "
140 "使这一步变得非常简单。"
141
142 #: ../../tips.rst:69 6ea08af050644b58ae5255dafb4f4d8b
143 msgid ""
144 "For example, if the source of your Pelican site is contained in a GitHub "
145 "repository, and if you want to publish that Pelican site in the form of "
146 "Project Pages to this repository, you can then use the following::"
147 msgstr "例如,当Pelican站点的源文件已经包含在GitHub仓库中时,可以将其作为此仓库的项目页面:"
148
149 #: ../../tips.rst:77 355b81e8a2194cf9b91bee0f4ee6dca9
150 msgid ""
151 "The ``ghp-import output`` command updates the local ``gh-pages`` branch "
152 "with the content of the ``output`` directory (creating the branch if it "
153 "doesn't already exist). The ``git push origin gh-pages`` command updates "
154 "the remote ``gh-pages`` branch, effectively publishing the Pelican site."
155 msgstr ""
156 "``ghp-import output`` 命令会用 ``output`` 目录下的内容更新本地的 ``gh-pages`` "
157 "分支(如果此分支不存在则会先创建)。接着再用 ``git push origin gh-pages`` 命令更新远程分支 ``gh-"
158 "pages`` ,如此就能够发布Pelican站点了。"
159
160 #: ../../tips.rst:84 8a3fd725eba44fa99541376722601cce
161 msgid ""
162 "The ``github`` target of the Makefile (and the ``gh_pages`` task of "
163 "``tasks.py``) created by the ``pelican-quickstart`` command publishes the"
164 " Pelican site as Project Pages, as described above."
165 msgstr ""
166 "``pelican-quickstart`` 在Makefile文件中所生成的 ``github`` 目标(以及为 ``gh_pages`` "
167 "任务生成的 ``tasks.py`` )使得Pelican站点能像上面描述的那样被发布为项目页面。"
168
169 #: ../../tips.rst:89 e8ebf23099ed45e7a65d23b9a7e4ccbd
170 msgid "Publishing a User Site to GitHub Pages from a Branch"
171 msgstr "从某一分支发布用户站点到GitHub Pages"
172
173 #: ../../tips.rst:91 7dc8ae1992b7411d9d6db7cc4a0127cb
174 msgid ""
175 "To publish a Pelican site in the form of User Pages, you need to *push* "
176 "the content of the ``output`` dir generated by Pelican to the ``main`` "
177 "branch of your ``<username>.github.io`` repository on GitHub."
178 msgstr ""
179 "要以用户页面形式发布Pelican站点,你需要将Pelican生成的 ``output`` 目录内容 **push** 到 "
180 "``<username>.github.io`` 仓库的 ``master`` 分支上。"
181
182 #: ../../tips.rst:95 da706340ef5f4d18bfb183596a4196c9
183 msgid "Again, you can take advantage of ``ghp-import``::"
184 msgstr "同样的,此处也可以使用 ``ghp-import`` :"
185
186 #: ../../tips.rst:101 61aa6f0d9fdf407682d3f781ae5475c6
187 msgid ""
188 "The ``git push`` command pushes the local ``gh-pages`` branch (freshly "
189 "updated by the ``ghp-import`` command) to the ``elemoine.github.io`` "
190 "repository's ``main`` branch on GitHub."
191 msgstr ""
192 "``git push`` 命令将本地的 ``gh-pages`` 分支(此分支在刚刚通过 ``ghp-import`` "
193 "命令进行了更新)push到了GitHub仓库 ``elemoine.github.io`` 的 ``master`` 分支。"
194
195 #: ../../tips.rst:107 f74afbf668a1472d901fe0a16472ab98
196 msgid ""
197 "To publish your Pelican site as User Pages, feel free to adjust the "
198 "``github`` target of the Makefile."
199 msgstr "要将Pelican站点发布为用户页面,可以根据需要修改Makefile中的 ``github`` 目标。"
200
201 #: ../../tips.rst:110 d69dcdb58a4b4b38aa8b8bf8e4fd733a
202 msgid ""
203 "Another option for publishing to User Pages is to generate the output "
204 "files in the root directory of the project."
205 msgstr "发布用户页面的另一种方法就是将输出文件生成在项目的根目录下。"
206
207 #: ../../tips.rst:113 4991892f24df40b982faf01ddb292175
208 msgid ""
209 "For example, your main project folder is ``<username>.github.io`` and you"
210 " can create the Pelican project in a subdirectory called ``Pelican``. "
211 "Then from inside the ``Pelican`` folder you can run::"
212 msgstr ""
213 "例如,项目的主文件夹是 ``<username>.github.io`` ,你可以在子目录 ``Pelican`` "
214 "中创建一个Pelican项目。然后你可以在这个 ``Pelican`` 文件夹中执行下面的命令:"
215
216 #: ../../tips.rst:119 ca5939f8c58b44b69ebfb2f953a4a73b
217 msgid ""
218 "Now you can push the whole project ``<username>.github.io`` to the main "
219 "branch of your GitHub repository::"
220 msgstr "接着可以将整个项目 ``<username>.github.io`` push到GitHub仓库的master分支中:"
221
222 #: ../../tips.rst:124 54962439805d47abb121ca9454e7a4cc
223 msgid "(assuming origin is set to your remote repository)."
224 msgstr "(此处假设远程仓库命名为origin)。"
225
226 #: ../../tips.rst:127 b3fe320a90904fbda8c7ed8c7bddbd6e
227 msgid "Publishing to GitHub Pages Using a Custom GitHub Actions Workflow"
228 msgstr "使用自定义GitHub Actions工作流将站点发布GitHub Pages中"
229
230 #: ../../tips.rst:129 3b368bc0a307473dae560671fd9527be
231 msgid ""
232 "Pelican-powered sites can be published to GitHub Pages via a `custom "
233 "workflow "
234 "<https://github.com/getpelican/pelican/blob/main/.github/workflows/github_pages.yml>`_."
235 " To use it:"
236 msgstr ""
237 "Pelican已经给你准备了一份 `自定义工作流 "
238 "<https://github.com/getpelican/pelican/blob/main/.github/workflows/github_pages.yml>`_"
239 " ,你可以直接使用此工作流发布站点:"
240
241 #: ../../tips.rst:133 a7b1be522b694d9a8beb186b4603a7aa
242 msgid ""
243 "Enable GitHub Pages in your repo: go to **Settings → Pages** and choose "
244 "**GitHub Actions** for the **Source** setting."
245 msgstr ""
246 "首先为仓库开启GitHub Pages: **Settings → Pages** 中有个 **Source** 设置项,将其选择为 "
247 "**GitHub Actions** 。"
248
249 #: ../../tips.rst:136 9cc114d8a6b44ff49fa7fecbdbcd012f
250 msgid ""
251 "Commit a ``.github/workflows/pelican.yml`` file to your repo with these "
252 "contents:"
253 msgstr "往你的仓库中commit一个 ``.github/workflows/pelican.yml`` 文件,文件内容如下:"
254
255 #: ../../tips.rst:155 f7d029425d7047deae43e9506c7f4779
256 msgid ""
257 "You may want to replace the ``@main`` with the ID of a specific commit in"
258 " this repo in order to pin the version of the reusable workflow that "
259 "you're using: ``uses: "
260 "getpelican/pelican/.github/workflows/github_pages.yml@<COMMIT_ID>``. If "
261 "you do this you might want to get Dependabot to send you automated pull "
262 "requests to update that commit ID whenever new versions of this workflow "
263 "are published, like so:"
264 msgstr ""
265 "你可能想要将 ``@main`` 替换为这个仓库中某个特定commit的ID,以便将你使用的可重用工作流的版本固定下来,此时,可以使用 "
266 "``uses: "
267 "getpelican/pelican/.github/workflows/github_pages.yml@<COMMIT_ID>`` "
268 "。在这种情况下,你可能想让Dependabot自动向你发送PR,以便在发布新版本的工作流时更新commit ID,如下所示:"
269
270 #: ../../tips.rst:172 fd060b5d5d824ab8825b384d37872894
271 msgid ""
272 "See `GitHub's docs about using Dependabot to keep your actions up to date"
273 " <https://docs.github.com/en/code-security/dependabot/working-with-"
274 "dependabot/keeping-your-actions-up-to-date-with-dependabot>`_."
275 msgstr ""
276 "请参阅 `GitHub文档 <https://docs.github.com/en/code-security/dependabot"
277 "/working-with-dependabot/keeping-your-actions-up-to-date-with-"
278 "dependabot>`_ ,了解如何使用Dependabot使您的action保持最新。"
279
280 #: ../../tips.rst:174 1b862876e15c4fcd898c4d9b3ba616c5
281 msgid ""
282 "Go to the **Actions** tab in your repo "
283 "(``https://github.com/<username>/<repository>/actions``) and you should "
284 "see a **Deploy to GitHub Pages** action running."
285 msgstr ""
286 "选中仓库的 **Actions** 标签栏( "
287 "``https://github.com/<username>/<repository>/actions`` ),此时你应该会看到已经有一个名为 "
288 "**Deploy to GitHub Pages** 的action正在运行。"
289
290 #: ../../tips.rst:178 f8413793636140f9b017abad379b3429
291 msgid ""
292 "Once the action completes you should see your Pelican site deployed at "
293 "your repo's GitHub Pages URL: ``https://<username>.github.io`` for a user"
294 " or organization site or ``https://<username>.github.io/<repository>>`` "
295 "for a project site."
296 msgstr ""
297 "当此action执行完成,就能够通过仓库的GitHub Pages地址 ``https://<username>.github.io`` "
298 "看到部署好了的用户或组织站点了,对于项目站点,可通过 ``https://<username>.github.io/<repository>`` "
299 "访问。"
300
301 #: ../../tips.rst:183 d792bb046c474f70aa98b2c16a5b1254
302 msgid "Notes:"
303 msgstr "注意事项:"
304
305 #: ../../tips.rst:185 89472d2b7231439faf9e51eda07d8323
306 msgid ""
307 "You don't need to set ``SITEURL`` or ``FEED_DOMAIN`` in your Pelican "
308 "settings: the workflow will set them correctly for you"
309 msgstr "无需在Pelican配置文件中设置 ``SITEURL`` ,工作流会帮你进行设置。"
310
311 #: ../../tips.rst:188 ea2b632160804a6e9bf1b4cecb7de716
312 msgid ""
313 "You don't need to commit your ``--output`` / ``OUTPUT_PATH`` directory "
314 "(``output/``) to git: the workflow will run ``pelican`` to build the "
315 "output directory for you on GitHub Actions"
316 msgstr ""
317 "无需commit ``--output`` 或 ``OUTPUT_PATH`` 所指定的目录( ``output/`` ):工作流会自己执行 "
318 "``pelican`` 命令来构建输出目录。"
319
320 #: ../../tips.rst:192 fd9fb772fba844f099cac781f2b0642f
321 msgid ""
322 "See `GitHub's docs about reusable workflows "
323 "<https://docs.github.com/en/actions/using-workflows/reusing-workflows>`_ "
324 "for more information."
325 msgstr ""
326 "更多信息请参阅 `GitHub可重用工作流文档 <https://docs.github.com/en/actions/using-"
327 "workflows/reusing-workflows>`_ 。"
328
329 #: ../../tips.rst:195 f9c527704af24f6da0b4229b7882a25b
330 msgid ""
331 "A number of optional inputs can be added to the ``with:`` block when "
332 "calling the workflow, for example:"
333 msgstr "有一些可选输入可以添加到工作流的 ``with:`` 块中:"
334
335 #: ../../tips.rst:206 956f5bae1fc64096acd2a2540a29004c
336 msgid "Here's the complete list of workflow inputs:"
337 msgstr "下面是工作流可用输入参数的完整列表:"
338
339 #: ../../tips.rst:209 eb37c894d7bc4278ab1a92e3b82c5603
340 msgid "Name"
341 msgstr "名称"
342
343 #: ../../tips.rst:209 446faf9e7d544e6aa47d4a1eca506c01
344 msgid "Required"
345 msgstr "是否必需"
346
347 #: ../../tips.rst:209 de96e4f5cd09488296f97f569fe1fb90
348 msgid "Description"
349 msgstr "描述"
350
351 #: ../../tips.rst:209 181bbfff09144f5b9c241b2fc79c989d
352 msgid "Type"
353 msgstr "值的类型"
354
355 #: ../../tips.rst:209 c3d44d1e7be6421a83bae2f5dc6e578f
356 msgid "Default"
357 msgstr "默认值"
358
359 #: ../../tips.rst:211 305d9d73681b4c6c80161cc906d60bbd
360 msgid "``settings``"
361 msgstr "``settings``"
362
363 #: ../../tips.rst:211 dbe6210f19914ae3b11e4caec7a945f0
364 msgid "Yes"
365 msgstr "是"
366
367 #: ../../tips.rst:211 bbd2306b324d4b5eae513cb7a7683286
368 msgid ""
369 "The path to your Pelican settings file (``pelican``'s ``--settings`` "
370 "option), for example: ``\"publishconf.py\"``"
371 msgstr ""
372 "Pelican配置文件的路径(会被用于 ``pelican`` 命令的 ``--settings`` 选项),例如 "
373 "``\"publishconf.py\"`` 。"
374
375 #: ../../tips.rst:211 ../../tips.rst:216 ../../tips.rst:223 ../../tips.rst:227
376 #: ../../tips.rst:231 ../../tips.rst:237 ../../tips.rst:243
377 #: 073e18d8ae29406eb05040d4e3a9ae60 7d43e6cfb091410ebec7464da05b61b4
378 #: 8837cc8935f148fb80f05cc5d3d53629 b2da1f7640f948039230cd835c49accd
379 #: bfe3d052cdc443bb81fed82e77acf3c1 c93816e00a254ef69c69f05833e8762b
380 #: ee35302c7e034070af1d234ab919c32a
381 msgid "string"
382 msgstr "string"
383
384 #: ../../tips.rst:216 4eab6faa96244f13a09754112a783f2f
385 msgid "``requirements``"
386 msgstr "``requirements``"
387
388 #: ../../tips.rst:216 ../../tips.rst:223 ../../tips.rst:227 ../../tips.rst:231
389 #: ../../tips.rst:237 ../../tips.rst:243 ../../tips.rst:249
390 #: 197d6ee11fce4a50996a0c458cfdbdad 2086d667b9b1475cb0f002924cdfde12
391 #: 25e940621f5b48c9af487d898d7f93cf 5664232c9fdd46c7b8278b8ecef8e3b1
392 #: 6693126a0da74c61b67e14ca8e535ec3 7f8a93a2048140748fa73537bfae2a54
393 #: 85fd40a29f31490bb23b20f05e574aaa
394 msgid "No"
395 msgstr "否"
396
397 #: ../../tips.rst:216 9d5bdd70e7da4794805180cc758ebe37
398 msgid ""
399 "The Python requirements to install, for example to enable markdown and "
400 "typogrify use: ``\"pelican[markdown] typogrify\"`` or if you have a "
401 "requirements file: ``\"-r requirements.txt\"``"
402 msgstr ""
403 "需要安装的Python模块,例如要开启markdown和typogrify,可指定 ``\"pelican[markdown] "
404 "typogrify\"`` ,或者可以指定一个requirements文件: ``\"-r requirements.txt\"`` "
405
406 #: ../../tips.rst:216 03ad0b322a714032bcce9f56ce66318d
407 msgid "``\"pelican\"``"
408 msgstr "``\"pelican\"``"
409
410 #: ../../tips.rst:223 e568553782b443dbacecaa7ded4c391c
411 msgid "``output-path``"
412 msgstr "``output-path``"
413
414 #: ../../tips.rst:223 2920ae9de5a64ae1ad82bd2287fa7c1e
415 msgid "Where to output the generated files (``pelican``'s ``--output`` option)"
416 msgstr "生成文件的输出位置(会被用于 ``pelican`` 命令的 ``--output`` 选项)"
417
418 #: ../../tips.rst:223 41b90747f0954a5799c8baf4a59d99fd
419 msgid "``\"output/\"``"
420 msgstr "``\"output/\"``"
421
422 #: ../../tips.rst:227 e2cc62185182463abc5140244a808e6d
423 msgid "``theme``"
424 msgstr "``theme``"
425
426 #: ../../tips.rst:227 cd3b78d03dcd4554a8ce10a873f5ff9f
427 msgid ""
428 "The GitHub repo URL of a custom theme to use, for example: "
429 "``\"https://github.com/seanh/sidecar.git\"``"
430 msgstr "要使用的自定义主题的GitHub仓库URL,例如: ``\"https://github.com/seanh/sidecar.git\"``"
431
432 #: ../../tips.rst:227 d94f331173334fb2a84b1caadffb72df
433 msgid "``\"\"``"
434 msgstr "``\"\"``"
435
436 #: ../../tips.rst:231 44ceb2743481486b95c1c739d543f15d
437 msgid "``python``"
438 msgstr "``python``"
439
440 #: ../../tips.rst:231 4b5cddab44d24c7c8560e16991b784c7
441 msgid ""
442 "The version of Python to use to build the site, for example: ``\"3.12\"``"
443 " (to use the most recent version of Python 3.12, this is faster) or "
444 "``\"3.12.1\"`` (to use an exact version, slower)"
445 msgstr "构建站点时使用的Python版本,例如: ``\"3.12\"`` 或 ``\"3.12.1\"``"
446
447 #: ../../tips.rst:231 919c0e36e8ff40bcbcc4480081b49ce5
448 msgid "``\"3.12\"``"
449 msgstr "``\"3.12\"``"
450
451 #: ../../tips.rst:237 842af56c539f4a74a97c7a5b1525eb35
452 msgid "``siteurl``"
453 msgstr "``siteurl``"
454
455 #: ../../tips.rst:237 7fc0777d6e174d6f8d757926a61aa3c8
456 msgid ""
457 "The base URL of your web site (Pelican's ``SITEURL`` setting). If not "
458 "passed this will default to the URL of your GitHub Pages site, which is "
459 "correct in most cases."
460 msgstr "站点的基URL,会用于配置项 ``SITEURL`` 。若未指定,默认值为GitHub Pages站点的URL,这适用于大部分情况。"
461
462 #: ../../tips.rst:237 ../../tips.rst:243 082f65333e224d71817b82b1e4f515c4
463 #: 3d786e828a4745db849bdb8f47738db8
464 msgid "The URL of your GitHub Pages site."
465 msgstr "GitHub Pages站点的URL"
466
467 #: ../../tips.rst:243 e5adb69f985547b7b3cc2bd3f31d4cc3
468 msgid "``feed_domain``"
469 msgstr "``feed_domain``"
470
471 #: ../../tips.rst:243 c88f037c9f1f4148bef6347228257f7d
472 msgid ""
473 "The domain to be prepended to feed URLs (Pelican's ``FEED_DOMAIN`` "
474 "setting). If not passed this will default to the URL of your GitHub Pages"
475 " site, which is correct in most cases."
476 msgstr ""
477 "订阅源URL前要附加的域名,会用于配置项 ``FEED_DOMAIN`` 。若未指定,默认值为GitHub "
478 "Pages站点的URL,这适用于大部分情况。"
479
480 #: ../../tips.rst:249 358c5aa434cd4ad09beab02df88413d5
481 msgid "``deploy``"
482 msgstr "``deploy``"
483
484 #: ../../tips.rst:249 b8748aeace5a448d9382e225be98f90c
485 msgid ""
486 "This is used to determine whether you will deploy the site or not to "
487 "GitHub Pages. This is most useful if you want to test a change to your "
488 "website in a pull request before deploying those change."
489 msgstr "此项配置用于表示是否要将站点部署至GitHub Pages。当对站点做了更改,并且在正式部署前进行测试,就可以用到此项。"
490
491 #: ../../tips.rst:249 034006b9b71b4cb486f230b8aad873ce
492 msgid "bool"
493 msgstr "bool"
494
495 #: ../../tips.rst:249 078ac613a8b74703af98c75bb5a007c1
496 msgid "``true``"
497 msgstr "``true``"
498
499 #: ../../tips.rst:257 e63cf881e3204be8b52ee5d8635ba4cf
500 msgid "Testing Your Build in a GitHub Pull Request"
501 msgstr "在Github拉取请求时进行测试"
502
503 #: ../../tips.rst:259 a2f6bd3420eb46a08f54efda35a6eaf4
504 msgid ""
505 "If you want to test your build in a pull request before deploying to "
506 "GitHub, your workflow might look something like this:"
507 msgstr "如果想在正式部署到 GitHub 前在PR中进行测试,下面是一个可用的 workflow 示例"
508
509 #: ../../tips.rst:288 84393693279741efa82c5ee6b27cbd28
510 msgid ""
511 "The ``on`` section of the workflow defines the events that will trigger "
512 "the workflow. In this example, the workflow will run on pushes to the "
513 "main branch, pull requests to the main branch, and manual runs of the "
514 "workflow."
515 msgstr "工作流的 ``on`` 部分定义了工作流的触发器。在此示例中,工作流将在main分支收到push、有PR提起到主分支以及"
516 "手动运行工作流时执行。"
517
518 #: ../../tips.rst:290 cd3c13b2af974a32aa4291d07fc11e9c
519 msgid ""
520 "``workflow_dispatch`` defines the deploy boolean to be true by default. "
521 "This means that if you run the workflow manually, it will deploy the "
522 "site."
523 msgstr "``workflow_dispatch`` 将 deploy 的默认值设为 true。也就是说当手动运行工作流时,更改的内容就会正式部署。"
524
525 #: ../../tips.rst:292 5402cd211d5b4aa8a244c916bb381a5b
526 msgid ""
527 "The ``deploy`` input for the job is using a set of standard GitHub "
528 "workflow variables to control when ``deploy`` will either be true or "
529 "false (you can customize this to your needs)."
530 msgstr "job中的 ``deploy`` 使用了一些 GitHub workflow 变量来计算 ``deploy`` 值为 true 还是 false(您可以根据需要自定义)。"
531
532 #: ../../tips.rst:294 d084908e3a0749f0b802b43626cfe2c4
533 msgid ""
534 "In this example, the ``deploy`` will be true if the event is a push to "
535 "the main branch (or merging into main from a PR) or a manual run of the "
536 "workflow. If the event is a pull request, the ``deploy`` will be false "
537 "and it will only build an artifact for the site."
538 msgstr "在此示例中,如果触发事件是推送到主分支(或从 PR 合并到主分支)或手动运行工作流,则 deploy 将为 true;"
539 "如果触发事件只是Pull Request,则 ``deploy`` 将为 false,并且此时只会为站点构建一个artifact。"
540
541 #: ../../tips.rst:297 85e70fc3faa04208979f7bbe92b025ef
542 msgid "\"Insecure content\" warnings from browsers"
543 msgstr "浏览器报“不安全的内容(Insecure content)”警告"
544
545 #: ../../tips.rst:299 34f7075cf31f416da2aeb529c616d97d
546 msgid ""
547 "If your site uses ``https://`` and is broken because the browser is "
548 "blocking network requests (for example for CSS files) due to \"insecure "
549 "content\" this may be because GitHub Pages is generating ``http://`` URLs"
550 " for your site."
551 msgstr ""
552 "当站点使用 ``https://`` "
553 "时,可能会损坏,无法正常显示,这是由于浏览器阻拦了一些对“不安全内容”的网络请求。可能的原因之一是GitHub Pages给你的站点生成了 "
554 "``http://`` URL。"
555
556 #: ../../tips.rst:303 47271df82577424c8e2c31a9e76a553a
557 msgid ""
558 "To fix this go into your site repo's settings and enable the **Enforce "
559 "HTTPS** setting: go to **Settings → Pages** and check **Enforce HTTPS**. "
560 "Then re-run the workflow to re-deploy your site. Alternatively, you can "
561 "use the workflow's ``siteurl`` and ``feed_domain`` settings."
562 msgstr ""
563 "要想解决这一问题,需要为站点所在仓库开启 **强制使用HTTPS** :点击 **Settings → Pages** 并在其中勾选 "
564 "**Enforce HTTPS** ,接着再重新执行工作流以重新部署站点。也可以尝试通过配置 ``siteurl`` 与 "
565 "``feed_domain`` 解决问题。"
566
567 #: ../../tips.rst:311 e69189ef4a8440fb8940d8012b4f19d6
568 msgid ""
569 "GitHub Pages will display the custom 404 page described above, as noted "
570 "in the relevant `GitHub docs "
571 "<https://help.github.com/articles/custom-404-pages/>`_."
572 msgstr ""
573 "如果按前述进行配置,GitHub Pages是能够正确显示自定义的404页面的,相关内容在 `GitHub的文档中 "
574 "<https://help.github.com/articles/custom-404-pages/>`_ 也有提到。"
575
576 #: ../../tips.rst:315 1b8c2457f44a4d61a033363830b8bd90
577 msgid "Update your site on each commit"
578 msgstr "在每次commit后都更新站点"
579
580 #: ../../tips.rst:317 476dbdb670924c02a962e78d6a7854c1
581 msgid ""
582 "To automatically update your Pelican site on each commit, you can create "
583 "a post-commit hook. For example, you can add the following to "
584 "``.git/hooks/post-commit``::"
585 msgstr ""
586 "要想在每次commit后自动更新Pelican站点,你可以创建一个post-commit钩子。例如,可以将下面的内容保存为 "
587 "``.git/hooks/post-commit`` :"
588
589 #: ../../tips.rst:324 36dc5f05eaf84573acada36c59d8d2fc
590 msgid "Copy static files to the root of your site"
591 msgstr "将静态文件拷贝到站点根目录"
592
593 #: ../../tips.rst:326 4a0722ad68e944ee80e6378259cc1dd6
594 msgid ""
595 "To use a `custom domain <https://help.github.com/articles/setting-up-a"
596 "-custom-domain-with-pages>`_ with GitHub Pages, you need to put the "
597 "domain of your site (e.g., ``blog.example.com``) inside a ``CNAME`` file "
598 "at the root of your site. To do this, create the ``content/extra/`` "
599 "directory and add a ``CNAME`` file to it. Then use the ``STATIC_PATHS`` "
600 "setting to tell Pelican to copy this file to your output directory. For "
601 "example::"
602 msgstr ""
603 "要将 `自定义域名 <https://help.github.com/articles/setting-up-a-custom-domain-"
604 "with-pages>`_ 与GitHub Pages一起使用,需要将站点的域名(例如 ``blog.example.com`` "
605 ")添加到站点根目录的 ``CNAME`` 文件中。为此,请创建 ``content/extra/`` 目录,并在里面添加一个 ``CNAME`` "
606 "文件。然后使用Pelican的 ``STATIC_PATHS`` 来告诉Pelican将此文件复制到输出目录:"
607
608 #: ../../tips.rst:337 8ad906848762400d9e2462034d151a16
609 msgid "Note: use forward slashes, ``/``, even on Windows."
610 msgstr "请注意:务必使用正斜杠 ``/`` ,在Windows上也是。"
611
612 #: ../../tips.rst:339 7b109f4944064382babc9158567c8e82
613 msgid ""
614 "You can also use the ``EXTRA_PATH_METADATA`` mechanism to place a "
615 "``favicon.ico`` or ``robots.txt`` at the root of any site."
616 msgstr ""
617 "利用 ``EXTRA_PATH_METADATA`` 机制,你可以将 ``favicon.ico`` 或 ``robots.txt`` "
618 "也拷贝到站点的根目录下。"
619
620 #: ../../tips.rst:343 678eea0644b5400496ad9173d05368d5
621 msgid "How to add YouTube or Vimeo Videos"
622 msgstr "如何添加YouTube或Vimeo视频"
623
624 #: ../../tips.rst:345 ca57b327dd6b432d82cdc91193bde6bb
625 msgid ""
626 "The easiest way is to paste the embed code of the video from these sites "
627 "directly into your source content."
628 msgstr "最简单的方法是将这些网站的视频嵌入代码直接粘贴到您的源内容文件中。"
629
630 #: ../../tips.rst:348 0a4f27e2edbe494ab52f73595646986e
631 msgid ""
632 "Alternatively, you can also use Pelican plugins like ``liquid_tags``, "
633 "``pelican_youtube``, or ``pelican_vimeo`` to embed videos in your "
634 "content."
635 msgstr ""
636 "或者,您还可以使用例如 ``liquid_tags`` 、``pelican_youtube`` 或 ``pelican_vimeo`` "
637 "等Pelican插件将视频嵌入。"
638
639 #: ../../tips.rst:351 e73517b72da347738421784b776b1f1c
640 msgid ""
641 "Moreover, markup languages like reST and Markdown have plugins that let "
642 "you embed videos in the markup. You can use `reST video directive "
643 "<https://gist.github.com/dbrgn/2922648>`_ for reST or `mdx_video plugin "
644 "<https://github.com/italomaia/mdx-video>`_ for Markdown."
645 msgstr ""
646 "此外,像reST和 Markdown这样的标记语言都有对应插件可以让你在其中嵌入视频。可以使用 `reST的视频指令 "
647 "<https://gist.github.com/dbrgn/2922648>`_ 或者 `Markdown的mdx_video插件 "
648 "<https://github.com/italomaia/mdx-video>`_ 。"
649
650 #: ../../tips.rst:358 b9d27cda716048b2ab7c13646d7faf09
651 msgid "Develop Locally Using SSL"
652 msgstr "在本地使用SSL进行开发"
653
654 #: ../../tips.rst:360 50df9ec072aa47eabbae132fd8f5cb68
655 msgid "Here's how you can set up your local pelican server to support SSL."
656 msgstr "以下描述了如何在本地Pelican服务器上配置SSL。"
657
658 #: ../../tips.rst:362 9b5045375a874c4d9c29f7109f05c539
659 msgid ""
660 "First, create a self-signed certificate and key using ``openssl`` (this "
661 "creates ``cert.pem`` and ``key.pem``)::"
662 msgstr "首先,通过 ``openssl`` 创建自签名的证书和密钥,这会生成 ``cert.pem`` 和 ``key.pem`` 文件:"
663
664 #: ../../tips.rst:366 2f1cfa536fc540f69d671f8a118769d7
665 msgid ""
666 "And use this command to launch the server (the server starts within your "
667 "``output`` directory)::"
668 msgstr "接着使用下面的命令来开启服务器(此服务器会在 ``output`` 目录下开启):"
669
670 #: ../../tips.rst:370 029ea2b0e4fe4b0f814158ae33e3a8ff
671 msgid "If you are using ``develop-server.sh``, add this to the top::"
672 msgstr "如果你使用的是 ``develop-server.sh`` 脚本,在脚本的开头添加:"
673
674 #: ../../tips.rst:375 c2784fdd9fdb433799d57f903d0e49d8
675 msgid "and modify the ``pelican.server`` line as follows::"
676 msgstr "然后修改按照下述修改 ``pelican.server`` 一行:"
677
678 #~ msgid ""
679 #~ "To publish a Pelican site in the"
680 #~ " form of User Pages, you need "
681 #~ "to *push* the content of the "
682 #~ "``output`` dir generated by Pelican to"
683 #~ " the ``master`` branch of your "
684 #~ "``<username>.github.io`` repository on GitHub."
685 #~ msgstr ""
686
687 #~ msgid ""
688 #~ "The ``git push`` command pushes the "
689 #~ "local ``gh-pages`` branch (freshly "
690 #~ "updated by the ``ghp-import`` command)"
691 #~ " to the ``elemoine.github.io`` repository's "
692 #~ "``master`` branch on GitHub."
693 #~ msgstr ""
694
695 #~ msgid ""
696 #~ "Now you can push the whole project"
697 #~ " ``<username>.github.io`` to the master "
698 #~ "branch of your GitHub repository::"
699 #~ msgstr ""
700
701 #~ msgid ""
702 #~ "Pelican-powered sites can be published"
703 #~ " to GitHub Pages via a `custom "
704 #~ "workflow "
705 #~ "<https://github.com/getpelican/pelican/blob/master/.github/workflows/github_pages.yml>`_."
706 #~ " To use it:"
707 #~ msgstr ""
708
709 #~ msgid ""
710 #~ "You may want to replace the "
711 #~ "``@master`` with the ID of a "
712 #~ "specific commit in this repo in "
713 #~ "order to pin the version of the"
714 #~ " reusable workflow that you're using: "
715 #~ "``uses: "
716 #~ "getpelican/pelican/.github/workflows/github_pages.yml@<COMMIT_ID>``."
717 #~ " If you do this you might want"
718 #~ " to get Dependabot to send you "
719 #~ "automated pull requests to update that"
720 #~ " commit ID whenever new versions of"
721 #~ " this workflow are published, like "
722 #~ "so:"
723 #~ msgstr ""