From 5acf155c328eb10df10507c28a880e47a939de8e Mon Sep 17 00:00:00 2001 From: nkr <42086312+nkr0@users.noreply.github.com> Date: Thu, 9 Oct 2025 23:47:46 +0200 Subject: [PATCH 01/46] Fix docutils PendingDeprecationWarning --- pelican/readers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index ca1b2393..dfa76638 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -268,9 +268,11 @@ class RstReader(BaseReader): extra_params.update(user_params) pub = docutils.core.Publisher( - writer=self.writer_class(), destination_class=docutils.io.StringOutput + reader="standalone", + parser="restructuredtext", + writer=self.writer_class(), + destination_class=docutils.io.StringOutput, ) - pub.set_components("standalone", "restructuredtext", "html") pub.process_programmatic_settings(None, extra_params, None) pub.set_source(source_path=source_path) pub.publish() From 69cbd8d7920ef6103cbc348a9ee00cb8a6690cae Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Oct 2025 08:01:15 +0200 Subject: [PATCH 02/46] Require Docutils 0.22 for compatibility with #3510 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8d0fd9b9..2763908a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ requires-python = ">=3.9,<4.0" dependencies = [ "blinker>=1.7.0", - "docutils>=0.20.1", + "docutils>=0.22.2", "feedgenerator>=2.1.0", "jinja2>=3.1.2", "ordered-set>=4.1.0", From 35f7b0dd6bd376004dcd1632ac22eb37a5d4b648 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Oct 2025 08:38:09 +0200 Subject: [PATCH 03/46] Revert Docutils version change This caused a gnarly dependency resolution problem that could not be easly rectified. Perhaps a future Sphinx release will fix this. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2763908a..8d0fd9b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ requires-python = ">=3.9,<4.0" dependencies = [ "blinker>=1.7.0", - "docutils>=0.22.2", + "docutils>=0.20.1", "feedgenerator>=2.1.0", "jinja2>=3.1.2", "ordered-set>=4.1.0", From c16417fe99b18af1da9a4a2dfc5ca056e09797ea Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Oct 2025 08:49:34 +0200 Subject: [PATCH 04/46] Update Furo doc theme to version 2025.9.25 --- docs/_templates/page.html | 386 ++++++++++++++++++++------------------ pyproject.toml | 2 +- 2 files changed, 204 insertions(+), 184 deletions(-) diff --git a/docs/_templates/page.html b/docs/_templates/page.html index 0fbfdf7d..2cfb02b5 100644 --- a/docs/_templates/page.html +++ b/docs/_templates/page.html @@ -1,201 +1,221 @@ {% extends "base.html" %} {% block body -%} - {{ super() }} - {% include "partials/icons.html" %} +{{ super() }} +{% include "partials/icons.html" %} - - - - + + + + - {% if theme_announcement -%} -
- + + {%- trans -%} + Skip to content + {%- endtrans -%} + + +{% if theme_announcement -%} +
+ +
+{%- endif %} + +
+
+
+
- {%- endif %} + +
+
+ +
+ +
+
+ +
+
+
+ + + + + {% trans %}Back to top{% endtrans %} + +
+ {% if theme_top_of_page_button != "edit" -%} + {{ warning("Got configuration for 'top_of_page_button': this is deprecated.") }} + {%- endif -%} -
-
-
- -
- -
-
- -
- -
-
- -
-
-
- - - - - {% trans %}Back to top{% endtrans %} - -
- {% if theme_top_of_page_button == "edit" -%} - {%- include "components/edit-this-page.html" with context -%} - {%- elif theme_top_of_page_button != None -%} - {{ warning("Got an unsupported value for 'top_of_page_button'") }} + {%- if theme_top_of_page_buttons == "" -%} + {% if theme_top_of_page_button == None -%} + {#- We respect the old configuration of disabling all the buttons -#} + {%- set theme_top_of_page_buttons = [] -%} + {% else %} + {%- set theme_top_of_page_buttons = ["view", "edit"] -%} {%- endif -%} + {% else -%} + {% if theme_top_of_page_button != "edit" -%} + {%- set theme_top_of_page_buttons = [] -%} + {{ warning("Got configuration for both 'top_of_page_button' and 'top_of_page_buttons', ignoring both and removing all top of page buttons.") }} + {%- endif -%} + {%- endif -%} + {% for button in theme_top_of_page_buttons -%} + {% if button == "view" %} + {%- include "components/view-this-page.html" with context -%} + {% elif button == "edit" %} + {%- include "components/edit-this-page.html" with context -%} + {% else %} + {{ warning("Got an unsupported value in 'top_of_page_buttons' for theme configuration") }} + {% endif %} + {%- endfor -%} {#- Theme toggle -#} -
- -
- +
+
-
- {% block content %}{{ body }}{% endblock %} -
+
- +
+ {% block content %}{{ body }}{% endblock %} +
- + {%- endif %} + {%- if last_updated -%} +
+ {% trans last_updated=last_updated|e -%} + Last updated on {{ last_updated }} + {%- endtrans -%} +
+ {%- endif %} +
+
+ {% if theme_footer_icons or READTHEDOCS -%} +
+ {% if theme_footer_icons -%} + {% for icon_dict in theme_footer_icons -%} + + {{- icon_dict.html -}} + + {% endfor %} + {%- else -%} + {#- Show Read the Docs project -#} + {%- if READTHEDOCS and slug -%} + + + + + + {%- endif -%} + {#- Show GitHub repository home -#} + {%- if READTHEDOCS and display_github and github_user != "None" and github_repo != "None" -%} + + + + + + {%- endif -%} + {%- endif %} +
+ {%- endif %} +
+
+ {% endblock footer %} +
+
+
{%- endblock %} diff --git a/pyproject.toml b/pyproject.toml index 8d0fd9b9..ce5cd894 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,7 @@ dev = [ "typogrify>=2.1.0", "sphinx>=7.1.2", "sphinxext-opengraph>=0.9.0", - "furo==2023.9.10", + "furo==2025.9.25", "livereload>=2.6.3", "psutil>=5.9.6", "pygments>=2.16.1,<2.20.0", From 1b17a65ebb99b6f36947d86f30d87a569e45fd3f Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Oct 2025 08:56:35 +0200 Subject: [PATCH 05/46] Update `checkout` & `setup-python` GitHub Actions --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e5a877b..68e1fd30 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,9 +21,9 @@ jobs: python: "3.9" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} cache: "pip" @@ -50,7 +50,7 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: pdm-project/setup-pdm@v4 with: python-version: "3.11" @@ -68,7 +68,7 @@ jobs: name: Test build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: pdm-project/setup-pdm@v4 with: python-version: "3.11" @@ -86,9 +86,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" cache: "pip" @@ -115,12 +115,12 @@ jobs: id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: token: ${{ secrets.GH_TOKEN }} - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" From b1b06d73a016ed78012b671c23500f11f4880e32 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Oct 2025 09:02:37 +0200 Subject: [PATCH 06/46] Indent custom Furo template to mollify djLint --- docs/_templates/page.html | 410 +++++++++++++++++++------------------- 1 file changed, 205 insertions(+), 205 deletions(-) diff --git a/docs/_templates/page.html b/docs/_templates/page.html index 2cfb02b5..c0c31744 100644 --- a/docs/_templates/page.html +++ b/docs/_templates/page.html @@ -1,221 +1,221 @@ {% extends "base.html" %} {% block body -%} -{{ super() }} -{% include "partials/icons.html" %} + {{ super() }} + {% include "partials/icons.html" %} - - - - + + + + - - {%- trans -%} - Skip to content - {%- endtrans -%} - + + {%- trans -%} + Skip to content + {%- endtrans -%} + -{% if theme_announcement -%} -
- -
-{%- endif %} - -
-
-
- + {% if theme_announcement -%} +
+
- -
-
- + {%- endif %} + +
+
+
+
- -
-
- -
-
-
- - - - - {% trans %}Back to top{% endtrans %} - -
- {% if theme_top_of_page_button != "edit" -%} - {{ warning("Got configuration for 'top_of_page_button': this is deprecated.") }} - {%- endif -%} - - {%- if theme_top_of_page_buttons == "" -%} - {% if theme_top_of_page_button == None -%} - {#- We respect the old configuration of disabling all the buttons -#} - {%- set theme_top_of_page_buttons = [] -%} - {% else %} - {%- set theme_top_of_page_buttons = ["view", "edit"] -%} - {%- endif -%} - {% else -%} - {% if theme_top_of_page_button != "edit" -%} - {%- set theme_top_of_page_buttons = [] -%} - {{ warning("Got configuration for both 'top_of_page_button' and 'top_of_page_buttons', ignoring both and removing all top of page buttons.") }} - {%- endif -%} - {%- endif -%} - {% for button in theme_top_of_page_buttons -%} - {% if button == "view" %} - {%- include "components/view-this-page.html" with context -%} - {% elif button == "edit" %} - {%- include "components/edit-this-page.html" with context -%} - {% else %} - {{ warning("Got an unsupported value in 'top_of_page_buttons' for theme configuration") }} - {% endif %} - {%- endfor -%} - {#- Theme toggle -#} -
- -
- +
+
+
-
- {% block content %}{{ body }}{% endblock %} -
+
-
- {% block footer %} - -
-
- {%- if show_copyright %} - - {%- endif %} - {%- if last_updated -%} -
- {% trans last_updated=last_updated|e -%} - Last updated on {{ last_updated }} - {%- endtrans -%} -
- {%- endif %} + +
-
- +
+
+
+ + + + + {% trans %}Back to top{% endtrans %} + +
+ {% if theme_top_of_page_button != "edit" -%} + {{ warning("Got configuration for 'top_of_page_button': this is deprecated.") }} + {%- endif -%} + + {%- if theme_top_of_page_buttons == "" -%} + {% if theme_top_of_page_button == None -%} + {#- We respect the old configuration of disabling all the buttons -#} + {%- set theme_top_of_page_buttons = [] -%} + {% else %} + {%- set theme_top_of_page_buttons = ["view", "edit"] -%} + {%- endif -%} + {% else -%} + {% if theme_top_of_page_button != "edit" -%} + {%- set theme_top_of_page_buttons = [] -%} + {{ warning("Got configuration for both 'top_of_page_button' and 'top_of_page_buttons', ignoring both and removing all top of page buttons.") }} + {%- endif -%} + {%- endif -%} + {% for button in theme_top_of_page_buttons -%} + {% if button == "view" %} + {%- include "components/view-this-page.html" with context -%} + {% elif button == "edit" %} + {%- include "components/edit-this-page.html" with context -%} + {% else %} + {{ warning("Got an unsupported value in 'top_of_page_buttons' for theme configuration") }} + {% endif %} + {%- endfor -%} + {#- Theme toggle -#} +
+ +
+ +
+
+ {% block content %}{{ body }}{% endblock %} +
+
+ +
+ +
-
{%- endblock %} From b989441a6144eaec17e290912d8f02547bb60947 Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Thu, 16 Oct 2025 08:15:34 +0100 Subject: [PATCH 07/46] Don't use upload-pages-artifact (#3502) --- .github/workflows/github_pages.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 9c279ab1..86c23fa3 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -85,10 +85,28 @@ jobs: chmod -c -R +rX "${{ inputs.output-path }}" | while read line; do echo "::warning title=Invalid file permissions automatically fixed::$line" done + - name: Archive artifact + shell: sh + run: | + echo "::group::Archive artifact" + tar \ + --dereference \ + --hard-dereference \ + --directory "$OUTPUT_PATH" \ + -cvf "$RUNNER_TEMP/artifact.tar" \ + --exclude=.git \ + --exclude=.github \ + . + echo "::endgroup::" + env: + OUTPUT_PATH: ${{ inputs.output-path }} - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-artifact@v4 with: - path: ${{ inputs.output-path }} + name: github-pages + path: ${{ runner.temp }}/artifact.tar + retention-days: 1 + if-no-files-found: error deploy: concurrency: group: "pages" From af8e861d39a7dda6d0417609c8f0f03f5a7da92d Mon Sep 17 00:00:00 2001 From: joelsvensson Date: Thu, 16 Oct 2025 09:17:39 +0200 Subject: [PATCH 08/46] ci: Add Stork install option to GitHub Pages workflow (#3452) --- .github/workflows/github_pages.yml | 10 +++++++++- docs/tips.rst | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 86c23fa3..004524c4 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -42,6 +42,11 @@ on: default: true description: "Whether to deploy the site. If true then build the site and deploy it. If false then just test that the site builds successfully but don't deploy anything." type: boolean + stork: + required: false + default: false + description: "Whether to add Stork search tool. If true, it will be installed on runner." + type: boolean permissions: contents: read pages: write @@ -62,6 +67,9 @@ jobs: - name: Configure GitHub Pages id: pages uses: actions/configure-pages@v5 + - name: Install Stork + if: ${{ inputs.stork }} + run: cargo install stork-search --locked - name: Install requirements run: pip install ${{ inputs.requirements }} - name: Build Pelican site @@ -82,7 +90,7 @@ jobs: subprocess.run(cmd, shell=True, check=True) - name: Fix permissions run: | - chmod -c -R +rX "${{ inputs.output-path }}" | while read line; do + chmod -c -R +rX "${{ inputs.output-path }}" | while read -r line; do echo "::warning title=Invalid file permissions automatically fixed::$line" done - name: Archive artifact diff --git a/docs/tips.rst b/docs/tips.rst index 4df20ae3..3d228522 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -252,6 +252,10 @@ Here's the complete list of workflow inputs: | | | change to your website in a pull request | | | | | | before deploying those change. | | | +------------------+----------+--------------------------------------------+--------+---------------+ +| ``stork`` | No | This is used to determine whether Stork | bool | ``false`` | +| | | will be installed on the runner to be able | | | +| | | to build a site with Stork search enabled | | | ++------------------+----------+--------------------------------------------+--------+---------------+ Testing Your Build in a GitHub Pull Request """"""""""""""""""""""""""""""""""""""""""" From 91d55a4c8eff9a1bfa2b6b478ce68b029f397962 Mon Sep 17 00:00:00 2001 From: Elliot Simpson Date: Fri, 17 Oct 2025 20:05:08 +1300 Subject: [PATCH 09/46] Enable Ruff rule `blind-except` (#3493) --- .pre-commit-config.yaml | 2 +- pelican/__init__.py | 16 ++++++++-------- pelican/generators.py | 14 ++++++-------- pelican/tools/pelican_themes.py | 4 ++-- pelican/utils.py | 14 +++++++------- pelican/writers.py | 10 ++-------- pyproject.toml | 4 ++-- 7 files changed, 28 insertions(+), 36 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 38287df9..b5291afb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # ruff version should match the one in pyproject.toml - rev: v0.12.2 + rev: v0.12.7 hooks: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] diff --git a/pelican/__init__.py b/pelican/__init__.py index 8d916fc7..ead3fa7a 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -37,7 +37,7 @@ from pelican.writers import Writer try: __version__ = importlib.metadata.version("pelican") -except Exception: +except importlib.metadata.PackageNotFoundError: __version__ = "unknown" DEFAULT_CONFIG_NAME = "pelicanconf.py" @@ -78,11 +78,10 @@ class Pelican: try: plugin.register() self.plugins.append(plugin) - except Exception as e: - logger.error( - "Cannot register plugin `%s`\n%s", + except Exception: + logger.exception( + "Cannot register plugin `%s`", name, - e, stacklevel=2, ) if self.settings.get("DEBUG", False): @@ -258,7 +257,7 @@ class PrintSettings(argparse.Action): try: instance, settings = get_instance(namespace) except Exception as e: - logger.critical("%s: %s", e.__class__.__name__, e) + logger.critical("%s", e.__class__.__name__, exc_info=True) console.print_exception() sys.exit(getattr(e, "exitcode", 1)) @@ -621,7 +620,8 @@ def listen(server, port, output, excqueue=None): except Exception as e: if excqueue is not None: excqueue.put(traceback.format_exception_only(type(e), e)[-1]) - return + else: + logging.exception("Listening aborted unexpectedly.") except KeyboardInterrupt: httpd.socket.close() @@ -680,7 +680,7 @@ def main(argv=None): except KeyboardInterrupt: logger.warning("Keyboard interrupt received. Exiting.") except Exception as e: - logger.critical("%s: %s", e.__class__.__name__, e) + logger.critical("%s: %s", e.__class__.__name__, e, exc_info=True) if args.verbosity == logging.DEBUG: console.print_exception() diff --git a/pelican/generators.py b/pelican/generators.py index e04d1733..bf1d1cb8 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -681,11 +681,10 @@ class ArticlesGenerator(CachingGenerator): context_signal=signals.article_generator_context, context_sender=self, ) - except Exception as e: - logger.error( - "Could not process %s\n%s", + except Exception: + logger.exception( + "Could not process %s", f, - e, exc_info=self.settings.get("DEBUG", False), ) self._add_failed_source_path(f) @@ -896,11 +895,10 @@ class PagesGenerator(CachingGenerator): context_signal=signals.page_generator_context, context_sender=self, ) - except Exception as e: - logger.error( - "Could not process %s\n%s", + except Exception: + logger.exception( + "Could not process %s", f, - e, exc_info=self.settings.get("DEBUG", False), ) self._add_failed_source_path(f) diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index 1ae707e3..29fd7a30 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -241,7 +241,7 @@ def install(path, v=False, u=False): f"or directory in `{theme_path}':\n{e!s}", die=False, ) - except Exception as e: + except OSError as e: err(f"Cannot copy `{path}' to `{theme_path}':\n{e!s}") @@ -262,7 +262,7 @@ def symlink(path, v=False): print(f"Linking `{path}' to `{theme_path}' ...") try: os.symlink(path, theme_path) - except Exception as e: + except OSError as e: err(f"Cannot link `{path}' to `{theme_path}':\n{e!s}") diff --git a/pelican/utils.py b/pelican/utils.py index eb281ce9..0dd36a1f 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -378,8 +378,8 @@ def clean_output_dir(path: str, retention: Iterable[str]) -> None: if not os.path.isdir(path): try: os.remove(path) - except Exception as e: - logger.error("Unable to delete file %s; %s", path, e) + except Exception: + logger.exception("Unable to delete file %s", path) return # remove existing content from output folder unless in retention list @@ -393,14 +393,14 @@ def clean_output_dir(path: str, retention: Iterable[str]) -> None: try: shutil.rmtree(file) logger.debug("Deleted directory %s", file) - except Exception as e: - logger.error("Unable to delete directory %s; %s", file, e) + except Exception: + logger.exception("Unable to delete directory %s", file) elif os.path.isfile(file) or os.path.islink(file): try: os.remove(file) logger.debug("Deleted file/link %s", file) - except Exception as e: - logger.error("Unable to delete file %s; %s", file, e) + except Exception: + logger.exception("Unable to delete file %s", file) else: logger.error("Unable to delete %s, file type unknown", file) @@ -764,7 +764,7 @@ def order_content( try: content_list.sort(key=order_by) except Exception: - logger.error("Error sorting with function %s", order_by) + logger.exception("Error sorting with function %s", order_by) elif isinstance(order_by, str): if order_by.startswith("reversed-"): order_reversed = True diff --git a/pelican/writers.py b/pelican/writers.py index 1a99532a..009d761a 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -161,10 +161,7 @@ class Writer: if path: complete_path = sanitised_join(self.output_path, path) - try: - os.makedirs(os.path.dirname(complete_path)) - except Exception: - pass + os.makedirs(os.path.dirname(complete_path), exist_ok=True) with self._open_w(complete_path, "utf-8", override_output) as fp: feed.write(fp, "utf-8") @@ -215,10 +212,7 @@ class Writer: output = template.render(localcontext) path = sanitised_join(output_path, name) - try: - os.makedirs(os.path.dirname(path)) - except Exception: - pass + os.makedirs(os.path.dirname(path), exist_ok=True) with self._open_w(path, "utf-8", override=override) as f: f.write(output) diff --git a/pyproject.toml b/pyproject.toml index ce5cd894..efa19e24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,7 +96,7 @@ dev = [ "tox>=4.11.3", "invoke>=2.2.0", # ruff version should match the one in .pre-commit-config.yaml - "ruff==0.12.2", + "ruff==0.12.7", "tomli>=2.0.1; python_version < \"3.11\"", ] @@ -127,7 +127,7 @@ select = [ "A", # flake8-builtins "ARG", # flake8-unused-arguments "B", # flake8-bugbear - # TODO: "BLE", # flake8-blind-except + "BLE", # flake8-blind-except # TODO: Do I want "COM", # flake8-commas "C4", # flake8-comprehensions # TODO: "DJ", # flake8-django From 24e0894840c6b40fe915534db19cf2b4395461f5 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 17 Oct 2025 09:36:12 +0200 Subject: [PATCH 10/46] docs: Avoid using colons in metadata field names Fix #3486 --- docs/faq.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/faq.rst b/docs/faq.rst index dc6097c8..3c2ac972 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -112,6 +112,11 @@ If you want to include metadata in templates outside the article context (e.g., {% if article and article.modified %} +.. note:: + + Because the colon symbol (``:``) is used as a separator, be aware that + metadata field names *containing* a colon will probably not work. + How do I make my output folder structure identical to my content hierarchy? =========================================================================== From 2548bae70dfe752720129d6aa9057df267b02d17 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Oct 2025 09:26:59 +0200 Subject: [PATCH 11/46] Drop Python 3.9 support --- .github/workflows/main.yml | 3 --- pyproject.toml | 3 +-- tox.ini | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 68e1fd30..bf18fbed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,9 +16,6 @@ jobs: matrix: os: [ubuntu, macos, windows] python: ["3.10", "3.11", "3.12", "3.13"] - include: - - os: ubuntu - python: "3.9" steps: - uses: actions/checkout@v5 diff --git a/pyproject.toml b/pyproject.toml index efa19e24..b7866962 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,6 @@ classifiers = [ "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -27,7 +26,7 @@ classifiers = [ "Topic :: Text Processing :: Markup :: HTML", "Topic :: Text Processing :: Markup :: reStructuredText", ] -requires-python = ">=3.9,<4.0" +requires-python = ">=3.10,<4.0" dependencies = [ "blinker>=1.7.0", "docutils>=0.20.1", diff --git a/tox.ini b/tox.ini index 106e4580..4ab0921c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,8 @@ [tox] -envlist = py{3.9,3.10,3.11,3.12,3.13},docs +envlist = py{3.10,3.11,3.12,3.13},docs [testenv] basepython = - py3.9: python3.9 py3.10: python3.10 py3.11: python3.11 py3.12: python3.12 From 8d61c0bdf725c986eadb5856708a39fcd3ba137c Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Oct 2025 09:39:58 +0200 Subject: [PATCH 12/46] Update code for Python 3.10+ --- pelican/__init__.py | 2 +- pelican/contents.py | 22 ++++++++++------------ pelican/generators.py | 5 ++--- pelican/settings.py | 6 +++--- pelican/utils.py | 14 ++++++++++---- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index ead3fa7a..a69e574b 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -266,7 +266,7 @@ class PrintSettings(argparse.Action): for setting in values: if setting in settings: # Only add newline between setting name and value if dict - if isinstance(settings[setting], (dict, tuple, list)): + if isinstance(settings[setting], dict | tuple | list): setting_format = "\n{}:\n{}" else: setting_format = "\n{}: {}" diff --git a/pelican/contents.py b/pelican/contents.py index a06a1a6a..8494145a 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -5,7 +5,7 @@ import logging import os import re from html import unescape -from typing import Any, Optional +from typing import Any from urllib.parse import ParseResult, unquote, urljoin, urlparse, urlunparse try: @@ -45,7 +45,7 @@ class Content: """ - default_template: Optional[str] = None + default_template: str | None = None mandatory_properties: tuple[str, ...] = () @deprecated_attribute(old="filename", new="source_path", since=(3, 2, 0)) @@ -55,10 +55,10 @@ class Content: def __init__( self, content: str, - metadata: Optional[dict[str, Any]] = None, - settings: Optional[Settings] = None, - source_path: Optional[str] = None, - context: Optional[dict[Any, Any]] = None, + metadata: dict[str, Any] | None = None, + settings: Settings | None = None, + source_path: str | None = None, + context: dict[Any, Any] | None = None, ): if metadata is None: metadata = {} @@ -241,7 +241,7 @@ class Content: ) return metadata - def _expand_settings(self, key: str, klass: Optional[str] = None) -> str: + def _expand_settings(self, key: str, klass: str | None = None) -> str: if not klass: klass = self.__class__.__name__ fq_key = (f"{klass}_{key}").upper() @@ -281,10 +281,10 @@ class Content: # XXX Put this in a different location. if what in {"filename", "static", "attach"}: - def _get_linked_content(key: str, url: ParseResult) -> Optional[Content]: + def _get_linked_content(key: str, url: ParseResult) -> Content | None: nonlocal value - def _find_path(path: str) -> Optional[Content]: + def _find_path(path: str) -> Content | None: if path.startswith("/"): path = path[1:] else: @@ -494,9 +494,7 @@ class Content: else: return self.default_template - def get_relative_source_path( - self, source_path: Optional[str] = None - ) -> Optional[str]: + def get_relative_source_path(self, source_path: str | None = None) -> str | None: """Return the relative path (from the content path) to the given source_path. diff --git a/pelican/generators.py b/pelican/generators.py index bf1d1cb8..3b867dfb 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -7,7 +7,6 @@ from collections import defaultdict from functools import partial from itertools import chain, groupby from operator import attrgetter -from typing import Optional from jinja2 import ( BaseLoader, @@ -158,7 +157,7 @@ class Generator: return False def get_files( - self, paths, exclude: Optional[list[str]] = None, extensions=None + self, paths, exclude: list[str] | None = None, extensions=None ) -> set[str]: """Return a list of files to use, based on rules @@ -253,7 +252,7 @@ class Generator: # return the name of the class for logging purposes return self.__class__.__name__ - def _check_disabled_readers(self, paths, exclude: Optional[list[str]]) -> None: + def _check_disabled_readers(self, paths, exclude: list[str] | None) -> None: """Log warnings for files that would have been processed by disabled readers.""" for fil in self.get_files( paths, exclude=exclude, extensions=self.readers.disabled_extensions diff --git a/pelican/settings.py b/pelican/settings.py index 2f3f8fa1..98b1357e 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -9,7 +9,7 @@ import sys from os.path import isabs from pathlib import Path from types import ModuleType -from typing import Any, Optional +from typing import Any from pelican.log import LimitFilter from pelican.paginator import PaginationRule @@ -185,7 +185,7 @@ PYGMENTS_RST_OPTIONS = None def read_settings( - path: Optional[str] = None, override: Optional[Settings] = None + path: str | None = None, override: Settings | None = None ) -> Settings: settings = override or {} @@ -230,7 +230,7 @@ def read_settings( return settings -def get_settings_from_module(module: Optional[ModuleType] = None) -> Settings: +def get_settings_from_module(module: ModuleType | None = None) -> Settings: """Loads settings from a module, returns a dictionary.""" context = {} diff --git a/pelican/utils.py b/pelican/utils.py index 0dd36a1f..a5e08538 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -11,7 +11,14 @@ import shutil import traceback import unicodedata import urllib -from collections.abc import Collection, Generator, Hashable, Iterable, Sequence +from collections.abc import ( + Callable, + Collection, + Generator, + Hashable, + Iterable, + Sequence, +) from contextlib import contextmanager from functools import partial from html import entities @@ -21,7 +28,6 @@ from operator import attrgetter from typing import ( TYPE_CHECKING, Any, - Callable, ) import dateutil.parser @@ -234,7 +240,7 @@ def get_date(string: str) -> datetime.datetime: @contextmanager -def pelican_open(filename: str, mode: str = "r") -> Generator[str, None, None]: +def pelican_open(filename: str, mode: str = "r") -> Generator[str]: """Open a file and return its content""" # utf-8-sig will clear any BOM if present @@ -932,7 +938,7 @@ def maybe_pluralize(count: int, singular: str, plural: str) -> str: @contextmanager def temporary_locale( temp_locale: str | None = None, lc_category: int = locale.LC_ALL -) -> Generator[None, None, None]: +) -> Generator[None]: """ Enable code to run in a context with a temporary locale Resets the locale back when exiting context. From 41f7436669d7aa7aadca09bc0bab504cde4cfab6 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 17 Oct 2025 08:48:41 +0200 Subject: [PATCH 13/46] Remove upper bound on Requires-Python Rationale: https://discuss.python.org/t/requires-python-upper-limits/12663 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b7866962..fb0212a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ "Topic :: Text Processing :: Markup :: HTML", "Topic :: Text Processing :: Markup :: reStructuredText", ] -requires-python = ">=3.10,<4.0" +requires-python = ">=3.10" dependencies = [ "blinker>=1.7.0", "docutils>=0.20.1", From 098ec5b0afeafdcfa259a6fc2ccae797a10f7d5f Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 17 Oct 2025 09:53:59 +0200 Subject: [PATCH 14/46] Add support for Python 3.14 --- .github/workflows/main.yml | 2 +- pyproject.toml | 1 + tox.ini | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf18fbed..c99e6ae5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [ubuntu, macos, windows] - python: ["3.10", "3.11", "3.12", "3.13"] + python: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v5 diff --git a/pyproject.toml b/pyproject.toml index fb0212a7..66e4a77f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Content Management System", "Topic :: Internet :: WWW/HTTP :: Site Management", diff --git a/tox.ini b/tox.ini index 4ab0921c..2b91bff4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{3.10,3.11,3.12,3.13},docs +envlist = py{3.10,3.11,3.12,3.13,3.14},docs [testenv] basepython = @@ -7,6 +7,7 @@ basepython = py3.11: python3.11 py3.12: python3.12 py3.13: python3.13 + py3.14: python3.14 passenv = * usedevelop=True deps = From 2e9a6647a5c1f007c946b740c4b902d49cfb82a6 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Thu, 30 Oct 2025 04:47:33 -0600 Subject: [PATCH 15/46] Exclude Apple debugging artifacts from package builds (#3518) Co-authored-by: Justin Mayer --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 66e4a77f..09fcbdb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,6 +107,9 @@ source-includes = [ "docs/changelog.rst", "samples/", ] +excludes = [ + "pelican/build/" +] [build-system] requires = ["pdm-backend"] From 86f1f7225d99dd269dbd6d58ed0aae45867045c7 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 1 Nov 2025 10:37:20 +0100 Subject: [PATCH 16/46] Upgrade `upload-artifact` GitHub Action to v5 --- .github/workflows/github_pages.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 004524c4..4aaf922d 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -109,7 +109,7 @@ jobs: env: OUTPUT_PATH: ${{ inputs.output-path }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: github-pages path: ${{ runner.temp }}/artifact.tar diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c99e6ae5..0f59e862 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -95,7 +95,7 @@ jobs: - name: Check run: tox -e docs - name: cache the docs for inspection - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: docs path: docs/_build/html/ From 06da37fd0a1ab1b18b88f5ecbb1b889d21d6a820 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 19 Nov 2025 09:02:23 +0100 Subject: [PATCH 17/46] Encourage discussions instead of new issues Folks tend to ignore the comments in issue templates and create new issues, even when the issue template comments make it clear that we would prefer that folks create discussions for topics outside of bug reports, documentation issues, and feature requests. --- .github/ISSUE_TEMPLATE/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index a07de4ab..356d6322 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,6 +2,10 @@ # Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser blank_issues_enabled: false contact_links: +- name: '🗃️ Everything Else' + url: https://github.com/getpelican/pelican/discussions + about: | + Do you have a question/issue that does not fall into any of the other categories? - name: '💬 Pelican IRC Channel' url: https://web.libera.chat/?#pelican about: | From 1f00e226104a4d9824fadf7f815a8f54435f583e Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 19 Nov 2025 09:07:11 +0100 Subject: [PATCH 18/46] Remove "Everything Else" issue template We now direct folks directly to discussions instead. --- .github/ISSUE_TEMPLATE/---everything-else.md | 28 -------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/---everything-else.md diff --git a/.github/ISSUE_TEMPLATE/---everything-else.md b/.github/ISSUE_TEMPLATE/---everything-else.md deleted file mode 100644 index 23a3f7bd..00000000 --- a/.github/ISSUE_TEMPLATE/---everything-else.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: "\U0001F5C3 Everything Else" -about: Do you have a question/issue that does not fall into any of the other categories? -title: '' -labels: question -assignees: '' - ---- - - - - -- [ ] I have searched the [issues](https://github.com/getpelican/pelican/issues?q=is%3Aissue) (including closed ones) and believe that this is not a duplicate. -- [ ] I have searched the [documentation](https://docs.getpelican.com/) and believe that my question is not covered. -- [ ] I have carefully read the [How to Get Help](https://docs.getpelican.com/en/latest/contribute.html#how-to-get-help) section of the documentation. - -## Issue - From 782962d3ad6e1724441006d97790d99a789997eb Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 1 Dec 2025 09:09:51 +0100 Subject: [PATCH 19/46] Tell Dependabot to stop creating pull requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Perhaps the "right" way to do this is to delete the dependabot.yml file entirely ¯\_(ツ)_/¯ --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4fed5330..02edf983 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,3 +7,4 @@ updates: directory: "/" schedule: interval: "monthly" + open-pull-requests-limit: 0 From 945fd6d3b6ecef58be922807e6cbabc8d300eb11 Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Tue, 25 Nov 2025 18:30:12 +0000 Subject: [PATCH 20/46] Update GitHub Pages workflow's Python version Update the default Python version used by the GitHub Pages workflow to 3.14. --- .github/workflows/github_pages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 4aaf922d..a94a6355 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -24,8 +24,8 @@ on: type: string python: required: false - default: "3.12" - description: "The version of Python to use, for example: '3.12' (to use the most recent version of Python 3.12, this is faster) or '3.12.1' (to use an exact version, slower)" + default: "3.14" + description: "The version of Python to use, for example: '3.14' (to use the most recent version of Python 3.14, this is faster) or '3.14.0' (to use an exact version, slower)" type: string siteurl: required: false From 993d21401f3a4e2524b8fff5a86b23f193a15914 Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Tue, 25 Nov 2025 18:29:15 +0000 Subject: [PATCH 21/46] Add `theme-checkout` option to GitHub Pages workflow --- .github/workflows/github_pages.yml | 10 ++- docs/tips.rst | 108 +++++++++++++++-------------- 2 files changed, 66 insertions(+), 52 deletions(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index a94a6355..59edb733 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -22,6 +22,11 @@ on: default: "" description: "The GitHub repo URL of a custom theme to use, for example: 'https://github.com/seanh/sidecar.git'" type: string + theme-checkout: + required: false + default: "" + description: "Git ref (branch, tag or commit) of the theme repo to checkout. This can be used to pin the version of your theme. If not specified defaults to the theme repo's default branch." + type: string python: required: false default: "3.14" @@ -61,9 +66,12 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ inputs.python }} - - name: Checkout theme + - name: Clone theme if: ${{ inputs.theme }} run: git clone '${{ inputs.theme }}' .theme + - name: Checkout theme ref + if: ${{ inputs.theme && inputs.theme-checkout }} + run: git -C .theme checkout '${{ inputs.theme-checkout }}' - name: Configure GitHub Pages id: pages uses: actions/configure-pages@v5 diff --git a/docs/tips.rst b/docs/tips.rst index 3d228522..83d09a5e 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -205,57 +205,63 @@ the workflow, for example: Here's the complete list of workflow inputs: -+------------------+----------+--------------------------------------------+--------+---------------+ -| Name | Required | Description | Type | Default | -+==================+==========+============================================+========+===============+ -| ``settings`` | Yes | The path to your Pelican settings | string | | -| | | file (``pelican``'s | | | -| | | ``--settings`` option), | | | -| | | for example: ``"publishconf.py"`` | | | -+------------------+----------+--------------------------------------------+--------+---------------+ -| ``requirements`` | No | The Python requirements to | string | ``"pelican"`` | -| | | install, for example to enable | | | -| | | markdown and typogrify use: | | | -| | | ``"pelican[markdown] typogrify"`` | | | -| | | or if you have a requirements | | | -| | | file: ``"-r requirements.txt"`` | | | -+------------------+----------+--------------------------------------------+--------+---------------+ -| ``output-path`` | No | Where to output the generated | string | ``"output/"`` | -| | | files (``pelican``'s ``--output`` | | | -| | | option) | | | -+------------------+----------+--------------------------------------------+--------+---------------+ -| ``theme`` | No | The GitHub repo URL of a custom | string | ``""`` | -| | | theme to use, for example: | | | -| | | ``"https://github.com/seanh/sidecar.git"`` | | | -+------------------+----------+--------------------------------------------+--------+---------------+ -| ``python`` | No | The version of Python to use to build the | string | ``"3.12"`` | -| | | site, for example: ``"3.12"`` (to use the | | | -| | | most recent version of Python 3.12, this | | | -| | | is faster) or ``"3.12.1"`` (to use an | | | -| | | exact version, slower) | | | -+------------------+----------+--------------------------------------------+--------+---------------+ -| ``siteurl`` | No | The base URL of your web site (Pelican's | string | The URL of | -| | | ``SITEURL`` setting). If not passed this | | your GitHub | -| | | will default to the URL of your GitHub | | Pages site. | -| | | Pages site, which is correct in most | | | -| | | cases. | | | -+------------------+----------+--------------------------------------------+--------+---------------+ -| ``feed_domain`` | No | The domain to be prepended to feed URLs | string | The URL of | -| | | (Pelican's ``FEED_DOMAIN`` setting). If | | your GitHub | -| | | not passed this will default to the URL of | | Pages site. | -| | | your GitHub Pages site, which is correct | | | -| | | in most cases. | | | -+------------------+----------+--------------------------------------------+--------+---------------+ -| ``deploy`` | No | This is used to determine whether you will | bool | ``true`` | -| | | deploy the site or not to GitHub Pages. | | | -| | | This is most useful if you want to test a | | | -| | | change to your website in a pull request | | | -| | | before deploying those change. | | | -+------------------+----------+--------------------------------------------+--------+---------------+ -| ``stork`` | No | This is used to determine whether Stork | bool | ``false`` | -| | | will be installed on the runner to be able | | | -| | | to build a site with Stork search enabled | | | -+------------------+----------+--------------------------------------------+--------+---------------+ ++--------------------+----------+--------------------------------------------+--------+---------------+ +| Name | Required | Description | Type | Default | ++====================+==========+============================================+========+===============+ +| ``settings`` | Yes | The path to your Pelican settings | string | | +| | | file (``pelican``'s | | | +| | | ``--settings`` option), | | | +| | | for example: ``"publishconf.py"`` | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ +| ``requirements`` | No | The Python requirements to | string | ``"pelican"`` | +| | | install, for example to enable | | | +| | | markdown and typogrify use: | | | +| | | ``"pelican[markdown] typogrify"`` | | | +| | | or if you have a requirements | | | +| | | file: ``"-r requirements.txt"`` | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ +| ``output-path`` | No | Where to output the generated | string | ``"output/"`` | +| | | files (``pelican``'s ``--output`` | | | +| | | option) | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ +| ``theme`` | No | The GitHub repo URL of a custom | string | ``""`` | +| | | theme to use, for example: | | | +| | | ``"https://github.com/seanh/sidecar.git"`` | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ +| ``theme-checkout`` | No | Git ref (branch, tag or commit) of the | string | ``""`` | +| | | theme repo to checkout. This can be used | | | +| | | to pin the version of your theme. If not | | | +| | | specified defaults to the theme repo's | | | +| | | default branch. | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ +| ``python`` | No | The version of Python to use to build the | string | ``"3.12"`` | +| | | site, for example: ``"3.12"`` (to use the | | | +| | | most recent version of Python 3.12, this | | | +| | | is faster) or ``"3.12.1"`` (to use an | | | +| | | exact version, slower) | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ +| ``siteurl`` | No | The base URL of your web site (Pelican's | string | The URL of | +| | | ``SITEURL`` setting). If not passed this | | your GitHub | +| | | will default to the URL of your GitHub | | Pages site. | +| | | Pages site, which is correct in most | | | +| | | cases. | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ +| ``feed_domain`` | No | The domain to be prepended to feed URLs | string | The URL of | +| | | (Pelican's ``FEED_DOMAIN`` setting). If | | your GitHub | +| | | not passed this will default to the URL of | | Pages site. | +| | | your GitHub Pages site, which is correct | | | +| | | in most cases. | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ +| ``deploy`` | No | This is used to determine whether you will | bool | ``true`` | +| | | deploy the site or not to GitHub Pages. | | | +| | | This is most useful if you want to test a | | | +| | | change to your website in a pull request | | | +| | | before deploying those change. | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ +| ``stork`` | No | This is used to determine whether Stork | bool | ``false`` | +| | | will be installed on the runner to be able | | | +| | | to build a site with Stork search enabled | | | ++--------------------+----------+--------------------------------------------+--------+---------------+ Testing Your Build in a GitHub Pull Request """"""""""""""""""""""""""""""""""""""""""" From 3d3265b74c54338b8e9371c51eba4e8ef8b629c9 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 1 Dec 2025 09:27:33 +0100 Subject: [PATCH 22/46] ci: Increment `checkout` GitHub action to v6 --- .github/workflows/github_pages.yml | 2 +- .github/workflows/main.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 59edb733..c17919e9 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -61,7 +61,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0f59e862..14b8ee90 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: python: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v6 with: @@ -47,7 +47,7 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: pdm-project/setup-pdm@v4 with: python-version: "3.11" @@ -65,7 +65,7 @@ jobs: name: Test build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: pdm-project/setup-pdm@v4 with: python-version: "3.11" @@ -83,7 +83,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Python uses: actions/setup-python@v6 with: @@ -112,7 +112,7 @@ jobs: id-token: write steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: token: ${{ secrets.GH_TOKEN }} From b5e20d7f6d8520bb277c7c261eed8c33a53ae4de Mon Sep 17 00:00:00 2001 From: GeorgeHu <43069137+GeorgeHu6@users.noreply.github.com> Date: Tue, 3 Feb 2026 19:11:45 +0800 Subject: [PATCH 23/46] docs: Update Chinese translation (#3559) --- docs/locale/zh_CN/LC_MESSAGES/faq.po | 95 +++--- docs/locale/zh_CN/LC_MESSAGES/settings.po | 371 ++++++++++++---------- docs/locale/zh_CN/LC_MESSAGES/sphinx.po | 26 +- docs/locale/zh_CN/LC_MESSAGES/tips.po | 146 +++++---- 4 files changed, 354 insertions(+), 284 deletions(-) diff --git a/docs/locale/zh_CN/LC_MESSAGES/faq.po b/docs/locale/zh_CN/LC_MESSAGES/faq.po index f63513ea..f0738365 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/faq.po +++ b/docs/locale/zh_CN/LC_MESSAGES/faq.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PELICAN 4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-07 16:25+0800\n" -"PO-Revision-Date: 2024-06-27 19:00+0800\n" +"POT-Creation-Date: 2026-02-02 10:32+0800\n" +"PO-Revision-Date: 2026-02-02 10:32+0800\n" "Last-Translator: GeorgeHu \n" "Language: zh_CN\n" "Language-Team: \n" @@ -16,7 +16,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.16.0\n" +"Generated-By: Babel 2.17.0\n" #: ../../faq.rst:2 84467b3ab4b8411589855b3130e14406 msgid "Frequently Asked Questions (FAQ)" @@ -143,8 +143,9 @@ msgid "" " or add new templates, via the ``THEME_TEMPLATES_OVERRIDES`` variable. " "For example, to override the page template, you can define the location " "for your templates like this::" -msgstr "当然可以,覆盖部分模板文件或是添加一些模板文件都是可以的,使用 ``THEME_TEMPLATES_OVERRIDES`` 变量即可。" -"例如,若需要覆盖page的模板,可以向这样定义你自己的模板文件位置:" +msgstr "" +"当然可以,覆盖部分模板文件或是添加一些模板文件都是可以的,使用 ``THEME_TEMPLATES_OVERRIDES`` " +"变量即可。例如,若需要覆盖page的模板,可以向这样定义你自己的模板文件位置:" #: ../../faq.rst:77 a96870f0cad74996bec2469ea0c2e9e1 msgid "" @@ -198,51 +199,59 @@ msgid "" "(e.g., ``base.html``), the ``if`` statement should instead be::" msgstr "如果您想在其他模板(例如 ``base.html`` )中获取此元数据,则 ``if`` 语句应改为:" -#: ../../faq.rst:116 b78a678a165d40f4823fac2b19bcafc1 +#: ../../faq.rst:117 22fb499d05e041c4bea55515c5428685 +msgid "" +"Because the colon symbol (``:``) is used as a separator, be aware that " +"metadata field names *containing* a colon will probably not work." +msgstr "因为冒号 (``:``) 已经用作分隔符,字段名称包含冒号的元数据可能不会起作用。" + +#: ../../faq.rst:121 b78a678a165d40f4823fac2b19bcafc1 msgid "" "How do I make my output folder structure identical to my content " "hierarchy?" msgstr "如何使得输出目录的结构和content目录的结构保持一致?" -#: ../../faq.rst:118 851d1019c070482991667cc024063d29 +#: ../../faq.rst:123 851d1019c070482991667cc024063d29 msgid "Try these settings::" msgstr "可以尝试如下配置:" -#: ../../faq.rst:125 5195876e3f364a838d72b16c568263bc +#: ../../faq.rst:130 5195876e3f364a838d72b16c568263bc msgid "How do I assign custom templates on a per-page basis?" msgstr "如何为某个页面指定某个模板?" -#: ../../faq.rst:127 2ddd3cf1fbf048b1819bcfc9b3691a12 +#: ../../faq.rst:132 2ddd3cf1fbf048b1819bcfc9b3691a12 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 "这非常简单,在任何页面或者文章中,都可以通过多添加一行元数据来指定特定模板。例如,在reST中,使用:" -#: ../../faq.rst:133 6f5eb40b4a5e4f83ab9d1cb48fefad57 +#: ../../faq.rst:138 6f5eb40b4a5e4f83ab9d1cb48fefad57 msgid "For content in Markdown format::" msgstr "对于Markdown,则使用:" -#: ../../faq.rst:137 2e28d1bf074c437eb5017bf6f345bf71 +#: ../../faq.rst:142 2e28d1bf074c437eb5017bf6f345bf71 msgid "" "Then just make sure your theme contains the relevant template file (e.g. " "``template_name.html``). If you just want to add a new custom template to" " an existing theme, you can also provide it in a directory specified by " "``THEME_TEMPLATES_OVERRIDES`` (see :ref:`settings/themes`)." msgstr "" +"接着只要确保主题中有相对应的模板文件 (e.g. ``template_name.html``)。如果只是需要把一个自定义" +"模板加到已有主题中,可以将其放在 ``THEME_TEMPLATES_OVERRIDES`` 指定的目录中 (详见 :ref:`settings/themes`)。" -#: ../../faq.rst:142 675e77f99f3c42bb8715c84a97c7a064 +#: ../../faq.rst:147 675e77f99f3c42bb8715c84a97c7a064 msgid "How can I override the generated URL of a specific page or article?" msgstr "如何重写某一个页面或文章生成的URL?" -#: ../../faq.rst:144 7e518b99b29d4787addc732d57e94ed1 +#: ../../faq.rst:149 7e518b99b29d4787addc732d57e94ed1 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 "在任意页面或文章中都可以添加 ``url`` 和 ``save_as`` 元数据,这样就可以重写URL了。下面以reST格式为例:" -#: ../../faq.rst:153 903306ecaed3483591b4ed2dcba3d183 +#: ../../faq.rst:158 903306ecaed3483591b4ed2dcba3d183 msgid "" "With this metadata, the page will be written to " "``override/url/index.html`` and Pelican will use the URL " @@ -251,18 +260,18 @@ msgstr "" "有了这样的元数据,此页面会保存为 ``override/url/index.html`` ,Pelican会将 ``override/url/``" " 作为链接到此页面的URL。" -#: ../../faq.rst:157 d80d84fcb6844e25a8452e29c4113181 +#: ../../faq.rst:162 d80d84fcb6844e25a8452e29c4113181 msgid "How can I use a static page as my home page?" msgstr "如何使用一个静态页面作为主页?" -#: ../../faq.rst:159 e17a2e2dd9014109888bab9286ee607c +#: ../../faq.rst:164 e17a2e2dd9014109888bab9286ee607c 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 "上一个问题中提到的特性可以用于实现此需求。下面例子中的Markdown文件保存为 ``content/pages/home.md`` :" -#: ../../faq.rst:169 b99ba0ca8656416cbdc38f3fa263b7eb +#: ../../faq.rst:174 b99ba0ca8656416cbdc38f3fa263b7eb 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 " @@ -271,11 +280,11 @@ msgstr "" "如果仍需要原来的博客主页(即 ``'index'`` 直接模板),可以通过设置 ``INDEX_SAVE_AS = " "'blog_index.html'`` 将其存储在其他位置。" -#: ../../faq.rst:174 fca4725a57dd451fb3b0fb9df78f69b5 +#: ../../faq.rst:179 fca4725a57dd451fb3b0fb9df78f69b5 msgid "What if I want to disable feed generation?" msgstr "可以禁用订阅源生成吗?" -#: ../../faq.rst:176 e9c08140e2ed44f189a7a156db027a3e +#: ../../faq.rst:181 e9c08140e2ed44f189a7a156db027a3e msgid "" "To disable feed generation, all feed settings should be set to ``None``. " "All but three feed settings already default to ``None``, so if you want " @@ -285,19 +294,19 @@ msgstr "" "要禁用订阅源,所有订阅源相关的配置都应被设为 ``None`` 。其中有三项设置默认为 ``None`` " ",因此如果要彻底不生成订阅源,你只需要指定下面这些设置:" -#: ../../faq.rst:186 7820a481af4c4f44a40fb3ae80768a1d +#: ../../faq.rst:191 7820a481af4c4f44a40fb3ae80768a1d msgid "" "The word ``None`` should not be surrounded by quotes. Please note that " "``None`` and ``''`` are not the same thing." msgstr "``None`` 两侧不需要加引号。请注意 ``None`` 和 ``''`` 不是同一个东西。" -#: ../../faq.rst:190 4fa2ffbf1c274ec396a0d756762c260d +#: ../../faq.rst:195 4fa2ffbf1c274ec396a0d756762c260d msgid "" "I'm getting a warning about feeds generated without SITEURL being set " "properly" msgstr "Pelican警告说由于SITEURL设置不正确,无法正常生成订阅源" -#: ../../faq.rst:192 8d52f14f6b03476897dfb15c188a961a +#: ../../faq.rst:197 8d52f14f6b03476897dfb15c188a961a msgid "" "`RSS and Atom feeds require all URL links to be absolute " "`_. In order to " @@ -308,17 +317,17 @@ msgstr "" "`_ " "。为了使得Pelican能正确生成链接,你需要将站点的 ``SITEURL`` 设置为完整路径。" -#: ../../faq.rst:197 1412ceb735d44a30b58db3241248e7ec +#: ../../faq.rst:202 1412ceb735d44a30b58db3241248e7ec msgid "" "Feeds are still generated when this warning is displayed, but links " "within may be malformed and thus the feed may not validate." msgstr "虽然Pelican提出了警告,但是仍会生成订阅源,但其中的链接可能是无效的,这会导致订阅源不可用。" -#: ../../faq.rst:201 20cadccc527e4ebda08eac9ed34f5055 +#: ../../faq.rst:206 20cadccc527e4ebda08eac9ed34f5055 msgid "Can I force Atom feeds to show only summaries instead of article content?" msgstr "可以让Atom订阅源只显示摘要,不显示文章内容吗?" -#: ../../faq.rst:203 9c45ba2ec5c6402e86e89661b943d1ad +#: ../../faq.rst:208 9c45ba2ec5c6402e86e89661b943d1ad msgid "" "Instead of having to open a separate browser window to read articles, the" " overwhelming majority of folks who use feed readers prefer to read " @@ -335,11 +344,11 @@ msgstr "" " ``content`` " "字段,因此Pelican在发布RSS时默认只包含摘要(当然也可以设置为包含文章内容)。Pelican在订阅源生成上的如此行为就可以让用户自行选择订阅类型:包含了完整内容的Atom或是只包含摘要的RSS。" -#: ../../faq.rst:214 bf0d4ca837f74d9ab6618db6306c6a70 +#: ../../faq.rst:219 bf0d4ca837f74d9ab6618db6306c6a70 msgid "Is Pelican only suitable for blogs?" msgstr "Pelican只适合用于博客吗?" -#: ../../faq.rst:216 49697f375cfc49b08f5d0c2297d15028 +#: ../../faq.rst:221 49697f375cfc49b08f5d0c2297d15028 msgid "" "No. Pelican can be easily configured to create and maintain any type of " "static site. This may require a little customization of your theme and " @@ -349,13 +358,13 @@ msgid "" "tag-related pages via::" msgstr "不是的。Pelican可以方便地用于创建维护任何静态站点,为此你需要对主题和配置做一些定制。例如,如果要为你的产品构建一个宣传网站,即不需要使用标签特性,从主题中移除与标签相关的HTML代码即可。另外,还可以通过下面的设置来禁用标签相关页面的生成:" -#: ../../faq.rst:226 0a59dd7209554237912579b362d07788 +#: ../../faq.rst:231 0a59dd7209554237912579b362d07788 msgid "" "Why does Pelican always write all HTML files even with content caching " "enabled?" msgstr "启用内容缓存后,为什么Pelican仍会每次都写入所有HTML文件?" -#: ../../faq.rst:228 6291b82d02fc4450a79d1200b5d04f62 +#: ../../faq.rst:233 6291b82d02fc4450a79d1200b5d04f62 msgid "" "In order to reliably determine whether the HTML output is different " "before writing it, a large part of the generation environment including " @@ -368,7 +377,7 @@ msgid "" "reliable." msgstr "为了确定HTML输出确实和之前的不同,模板上下文、插件等很多生成环境都需要保存并比较某种哈希值(对于不可哈希的内容类型还需要进行一些额外处理)。另外,由于插件、分页等内容的存在,输出的HTML很可能会与之前不同。因此,考虑到处理时间和存储空间,每次都重新写入全部HTML会更快更可靠。" -#: ../../faq.rst:237 5cc5e1361f914c92b0670030f0c83f5d +#: ../../faq.rst:242 5cc5e1361f914c92b0670030f0c83f5d msgid "" "However, this means that the modification time of the files changes every" " time, so a ``rsync`` based upload will transfer them even if their " @@ -380,11 +389,11 @@ msgstr "" "上传时会把没有变化的内容也进行上传。一个简便的解决方法就是给 ``rsync`` 加上 ``--checksum`` " "选项,这会比Pelican在生成时进行校验更快。" -#: ../../faq.rst:244 b24c40be89b94f3b980cbbda38d46115 +#: ../../faq.rst:249 b24c40be89b94f3b980cbbda38d46115 msgid "How to process only a subset of all articles?" msgstr "如何只处理一部分文章?" -#: ../../faq.rst:246 fa34a90481f44ace83ee16401543ce09 +#: ../../faq.rst:251 fa34a90481f44ace83ee16401543ce09 msgid "" "It is often useful to process only e.g. 10 articles for debugging " "purposes. This can be achieved by explicitly specifying only the " @@ -395,11 +404,11 @@ msgstr "" "简便起见,在调试时可能只需要处理几篇文章。可以直接在配置项 ``ARTICLE_PATHS`` 中添加需要处理文章的文件名。可以通过像 ``cd " "content; find -name '*.md' | head -n 10`` 这样的命令获取文章文件名的列表。" -#: ../../faq.rst:252 0fa566e3aa084cb9b04e0cee32684222 +#: ../../faq.rst:257 0fa566e3aa084cb9b04e0cee32684222 msgid "My tag cloud is missing/broken since I upgraded Pelican" msgstr "在升级Pelican后,标签云消失或不可用了" -#: ../../faq.rst:254 0bd1304a12c24f048b227c68391b148c +#: ../../faq.rst:259 0bd1304a12c24f048b227c68391b148c msgid "" "In an ongoing effort to streamline Pelican, tag cloud generation has been" " moved out of Pelican core and into a separate `plugin " @@ -410,11 +419,11 @@ msgstr "" "`_ 中。查看 :ref:`plugins` " "文档获取更多关于Pelican插件系统的信息。" -#: ../../faq.rst:260 1833dfba94c74f4bb9e9f0a112ed3e0f +#: ../../faq.rst:265 1833dfba94c74f4bb9e9f0a112ed3e0f msgid "Since I upgraded Pelican my pages are no longer rendered" msgstr "升级Pelican后,一些页面没有被渲染" -#: ../../faq.rst:262 576e5c2338ba4c43a51bb562301ad0c2 +#: ../../faq.rst:267 576e5c2338ba4c43a51bb562301ad0c2 msgid "" "Pages were available to themes as lowercase ``pages`` and uppercase " "``PAGES``. To bring this inline with the :ref:`templates-variables` " @@ -426,15 +435,15 @@ msgstr "" "variables` 一节中的内容保持一致,大写的 ``PAGES`` 被删除了。只要将主题中的 ``PAGES`` 替换为 ``pages`` " ",问题即可解决。例如将原先的:" -#: ../../faq.rst:269 355512b9f6b34ece9b6baed128b2ca4d +#: ../../faq.rst:274 355512b9f6b34ece9b6baed128b2ca4d msgid "with something like::" msgstr "替换为:" -#: ../../faq.rst:274 99ef769943fe41c4a37ca951e905b2ba +#: ../../faq.rst:279 99ef769943fe41c4a37ca951e905b2ba msgid "How can I stop Pelican from trying to parse my static files as content?" -msgstr "如何避免让Pelican将我的静态文件解析为内容文件?(译者注:例如要将一个HTML文件作为静态文件)?" +msgstr "如何避免让Pelican将我的静态文件解析为内容文件?(译者注:例如要将一个HTML文件作为静态文件)" -#: ../../faq.rst:276 4efb20c5b82d41afb07151599fa189dd +#: ../../faq.rst:281 4efb20c5b82d41afb07151599fa189dd msgid "" "Pelican's article and page generators run before it's static generator. " "That means if you use a setup similar to the default configuration, where" @@ -447,7 +456,7 @@ msgstr "" "配置项中,所有以有效内容文件后缀结尾的文件( ``.html`` 、 ``.rst`` 、 ``.md`` " "等)都会被视为文章或者页面,而不是静态文件。" -#: ../../faq.rst:282 d959eb6a67fe440caa70105e1692bf93 +#: ../../faq.rst:287 d959eb6a67fe440caa70105e1692bf93 msgid "" "To circumvent this issue either use the appropriate ``*_EXCLUDES`` " "setting or disable the offending reader via ``READERS`` if you don't need" @@ -456,11 +465,11 @@ msgstr "" "为了避免这个问题,使用合适的 ``*_EXCLUDES`` 配置,在必要时还可以通过 ``READERS`` " "配置项来直接禁用产生问题的reader。" -#: ../../faq.rst:286 5e64dc4b6fad4e7ea07278f5a2529e89 +#: ../../faq.rst:291 5e64dc4b6fad4e7ea07278f5a2529e89 msgid "Why is [arbitrary Markdown syntax] not supported?" msgstr "为什么不是所有的Markdown语法都支持?" -#: ../../faq.rst:288 6872a70ec1434c41a78d465271761c69 +#: ../../faq.rst:293 6872a70ec1434c41a78d465271761c69 msgid "" "Pelican does not directly handle Markdown processing and instead " "delegates that task to the Python-Markdown_ project, the core of which " diff --git a/docs/locale/zh_CN/LC_MESSAGES/settings.po b/docs/locale/zh_CN/LC_MESSAGES/settings.po index ef07e611..ef52fc73 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/settings.po +++ b/docs/locale/zh_CN/LC_MESSAGES/settings.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PELICAN 4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-13 11:46+0800\n" -"PO-Revision-Date: 2024-06-26 19:00+0800\n" +"POT-Creation-Date: 2026-02-02 10:32+0800\n" +"PO-Revision-Date: 2026-02-02 10:32+0800\n" "Last-Translator: GeorgeHu \n" "Language: zh_CN\n" "Language-Team: \n" @@ -138,8 +138,9 @@ msgid "" "Extra configuration settings for the docutils publisher (applicable only " "to reStructuredText). See `Docutils Configuration`_ settings for more " "details. The default is ``{}`` with no extra configuration settings." -msgstr "docutils的额外配置项(只针对reStructuredText有效)。在 `Docutils 配置`_ 设置中查看更多信息。" -"默认为 ``{}`` ,即不做任何额外配置。" +msgstr "" +"docutils的额外配置项(只针对reStructuredText有效)。在 `Docutils 配置`_ 设置中查看更多信息。默认为 " +"``{}`` ,即不做任何额外配置。" #: ../../settings.rst:86 841018ef5c0c410c92bc7780acf25291 msgid "" @@ -176,8 +177,9 @@ msgid "" " also includes a list of extensions you may want to include. See `Jinja " "Environment documentation`_. The default is ``{'extensions': [], " "'trim_blocks': True, 'lstrip_blocks': True}``." -msgstr "一个字典,用于配置自定义Jinja2环境变量。这其中也包含了要使用的扩展列表。详见 `Jinja环境文档`_ 。" -"本项设置默认为 ``{'extensions': [], 'trim_blocks': True, 'lstrip_blocks': True}`` 。" +msgstr "" +"一个字典,用于配置自定义Jinja2环境变量。这其中也包含了要使用的扩展列表。详见 `Jinja环境文档`_ 。本项设置默认为 " +"``{'extensions': [], 'trim_blocks': True, 'lstrip_blocks': True}`` 。" #: ../../settings.rst:111 b0e2be83c4684482a75198372a093d96 msgid "" @@ -207,8 +209,9 @@ msgid "" "A dictionary of custom Jinja2 tests you want to use. The dictionary " "should map test names to test functions. See: `Jinja custom tests " "documentation`_. The default is ``{}``." -msgstr "一个字典,自定义了要使用的Jinja测试。字典中应该是测试名到测试函数的映射。详见: `Jinja自定义测试文档`_ 。" -"本项设置默认为 ``{}`` 。" +msgstr "" +"一个字典,自定义了要使用的Jinja测试。字典中应该是测试名到测试函数的映射。详见: `Jinja自定义测试文档`_ 。本项设置默认为 " +"``{}`` 。" #: ../../settings.rst:139 06c6769420a744ea9fc27fc3e930bfcb msgid "" @@ -245,8 +248,9 @@ msgid "" "directories, and ``['__pycache__']`` would ignore Python 3's bytecode " "caches." msgstr "" -"通配符模式的列表。匹配到其中任一个模式,或是 ``watchfiles.DefaultFilter`` 中设置了隐藏的文件和目录都会被忽略。" -"例如,默认的 ``['**/.*']`` 可以用于忽略任何隐藏文件与目录, ``['__pycache__']`` 则可以忽略Python3的字节码缓存文件。" +"通配符模式的列表。匹配到其中任一个模式,或是 ``watchfiles.DefaultFilter`` " +"中设置了隐藏的文件和目录都会被忽略。例如,默认的 ``['**/.*']`` 可以用于忽略任何隐藏文件与目录, " +"``['__pycache__']`` 则可以忽略Python3的字节码缓存文件。" #: ../../settings.rst:171 6d3691b43e9741bd97f11cf56ddd89ff msgid "" @@ -336,7 +340,9 @@ msgid "" "Controls the extension that will be used by the SourcesGenerator. " "Defaults to ``.text``. If not a valid string the default value will be " "used. The default is ``'.text'``." -msgstr "控制SourcesGenerator使用的扩展名。默认为 ``.text`` 。如果设置的值是无效的,会使用默认值。本项配置默认为 ``'.text'`` 。" +msgstr "" +"控制SourcesGenerator使用的扩展名。默认为 ``.text`` 。如果设置的值是无效的,会使用默认值。本项配置默认为 " +"``'.text'`` 。" #: ../../settings.rst:246 5763cdeffac14fb4a4403b534251e8e2 msgid "The list of plugins to load. See :ref:`plugins`. The default is ``None``." @@ -378,8 +384,10 @@ msgid "" "and in ``PAGE_PATHS`` or ``ARTICLE_PATHS``. Pelican's default settings " "include the \"images\" directory here. The default is ``['images']``." msgstr "" -"用于查找静态文件的目录列表(相对于 ``PATH`` 目录)。静态文件会原封不动地拷贝到输出目录中。文章、页面以及其他的内容源文件都会被跳过,因此一个目录可以安全地同时出现在此选项以及" -" ``PAGE_PATHS`` 或 ``ARTICLE_PATHS`` 中。Pelican默认会将 \"images\" 目录包含在此选项中。本项配置默认为 ``['images']`` 。" +"用于查找静态文件的目录列表(相对于 ``PATH`` " +"目录)。静态文件会原封不动地拷贝到输出目录中。文章、页面以及其他的内容源文件都会被跳过,因此一个目录可以安全地同时出现在此选项以及 " +"``PAGE_PATHS`` 或 ``ARTICLE_PATHS`` 中。Pelican默认会将 \"images\" " +"目录包含在此选项中。本项配置默认为 ``['images']`` 。" #: ../../settings.rst:279 562736e3c91442bbb062e85e63d6f1f9 msgid "" @@ -400,9 +408,10 @@ msgstr "" "如果此选项设为False, ``STATIC_PATHS`` " "中的内容源文件将不会被忽略,也会像静态文件一样被原封不动地拷贝。此项设置是为了给3.5版本前的Pelican进行向后兼容的。若某个目录同时出现在了" " ``STATIC_PATHS`` 和 ``ARTICLE_PATHS`` 中,或 ``STATIC_PATHS`` 和 " -"``PAGE_PATHS`` 中时才会生效。如果你是想将站点的源文件发布出去的话,请考虑使用 ``OUTPUT_SOURCES`` 。本项配置默认为 ``True`` 。" +"``PAGE_PATHS`` 中时才会生效。如果你是想将站点的源文件发布出去的话,请考虑使用 ``OUTPUT_SOURCES`` " +"。本项配置默认为 ``True`` 。" -#: ../../settings.rst:294 a4a2ef0dfd6442fb889bf9bfe33688 +#: ../../settings.rst:294 a4a2ef0dfd6442fb889bf9bfe33688ee msgid "" "Create links instead of copying files. If the content and output " "directories are on the same device, then create hard links. Falls back " @@ -431,7 +440,8 @@ msgid "" "via: ``python -m pip install typogrify``. The default is ``False``." msgstr "" "若此项设置为True,一些显示上的改进将通过 `Typogrify `_" -" 库合并到生成的HTML中。可以通过 ``python -m pip install typogrify`` 进行安装。本项配置默认为 ``False`` 。" +" 库合并到生成的HTML中。可以通过 ``python -m pip install typogrify`` 进行安装。本项配置默认为 " +"``False`` 。" #: ../../settings.rst:315 f4a976dc583346eebd71cedbbd43839c msgid "" @@ -449,9 +459,10 @@ msgid "" "default, no filter is omitted (in other words, all filters get applied). " "This setting requires that Typogrify version 2.1.0 or later is installed." " The default is ``[]``." -msgstr "要忽略的Typogrify过滤器列表。可用值包括: ``'amp'`` 、 ``'smartypants'`` 、 ``'caps'`` 、 " -"``'initial_quotes'`` 、 ``'widont'`` 。默认不忽略任何过滤器。本项配置需要2.1.0或以上版本的Typogrify。" -"本项配置默认为 ``[]`` 。" +msgstr "" +"要忽略的Typogrify过滤器列表。可用值包括: ``'amp'`` 、 ``'smartypants'`` 、 ``'caps'`` 、 " +"``'initial_quotes'`` 、 ``'widont'`` " +"。默认不忽略任何过滤器。本项配置需要2.1.0或以上版本的Typogrify。本项配置默认为 ``[]`` 。" #: ../../settings.rst:329 8b9d3479e18c407090a4aac6a1dcafdf msgid "" @@ -467,7 +478,8 @@ msgstr "" "此设置用于设置Typogrify的Smartypants过滤器,控制过滤器如何解析多个破折号/连字符/减号。单个ASCII破折号字符 " "(``-``) 始终被视为连字符。设为 ``default`` 时不处理短破折号,并会将双连字符转换为长破折号;设为 ``oldschool`` " "时会将两个 ( ``--`` ) 和三个 ( ``--`` ) 连字符分别呈现为短破折号和长破折号;设为 " -"``oldschool_inverted`` 时则会将两个连字符转换为长破折号,而将三个连字符转换为短破折号。本项配置默认为 ``'default'`` " +"``oldschool_inverted`` 时则会将两个连字符转换为长破折号,而将三个连字符转换为短破折号。本项配置默认为 " +"``'default'`` " #: ../../settings.rst:340 44489695c0bb4c75ba04e6d23b17a6b7 msgid "" @@ -508,7 +520,6 @@ msgstr "" ":ref:`reading_only_modified_content` 。本项配置默认为 ``True`` 。" #: ../../settings.rst:367 c29c4ca7127741d49a164b7dff038232 -#, python-brace-format msgid "" "Regular expression that is used to parse internal links. Default syntax " "when linking to internal files, tags, etc., is to enclose the identifier," @@ -527,24 +538,26 @@ msgid "" "blocks. See :ref:`internal_pygments_options` for a list of supported " "options. The default is ``{}``." msgstr "" -"reStructuredText代码块的默认Pygments设置列表。请参阅 " -":ref:`internal_pygments_options` 查看支持选项列表。本项配置默认为 ``{}`` 。" +"reStructuredText代码块的默认Pygments设置列表。请参阅 :ref:`internal_pygments_options` " +"查看支持选项列表。本项配置默认为 ``{}`` 。" #: ../../settings.rst:382 aa2425b88dea4351bf184f127a5965de msgid "" "If ``True``, saves content in caches. See " ":ref:`reading_only_modified_content` for details about caching. The " "default is ``False``." -msgstr "若设为 ``True`` ,会将内容保存在缓存中。有关缓存请参阅 :ref:`reading_only_modified_content` 。" -"本项配置默认为 ``False`` 。" +msgstr "" +"若设为 ``True`` ,会将内容保存在缓存中。有关缓存请参阅 :ref:`reading_only_modified_content` " +"。本项配置默认为 ``False`` 。" #: ../../settings.rst:388 fe1ca91d569e4c2584b0dd3907761f40 msgid "" "If set to ``'reader'``, save only the raw content and metadata returned " "by readers. If set to ``'generator'``, save processed content objects. " "The default is ``'reader'``." -msgstr "若设为 ``reader`` ,则只保存reader返回的原始内容和元数据。若设为 ``generator`` ,则保存处理过的内容对象。" -"本项配置默认为 ``'reader'`` 。" +msgstr "" +"若设为 ``reader`` ,则只保存reader返回的原始内容和元数据。若设为 ``generator`` " +",则保存处理过的内容对象。本项配置默认为 ``'reader'`` 。" #: ../../settings.rst:394 9fc3e0a091d0493cb1172bb1c3bde79d msgid "Directory in which to store cache files. The default is ``'cache'``." @@ -560,12 +573,12 @@ msgstr "若设为 ``True`` ,则使用gzip对缓存文件进行解压缩。本 msgid "Controls how files are checked for modifications." msgstr "调整判定文件是否修改的方式" -#: ../../settings.rst:405 ../../settings.rst:1448 +#: ../../settings.rst:405 ../../settings.rst:1445 #: 18648953d9c040c8bd0b98d212509bbf msgid "If set to ``'mtime'``, the modification time of the file is checked." msgstr "若设为 ``mtime`` ,则检查文件的修改时间。" -#: ../../settings.rst:407 ../../settings.rst:1450 +#: ../../settings.rst:407 ../../settings.rst:1447 #: e5596360b86d44ef81b01bb259b4b189 msgid "" "If set to a name of a function provided by the ``hashlib`` module, e.g. " @@ -779,8 +792,9 @@ msgid "" "The location we will save the page. This value has to be the same as " "PAGE_URL or you need to use a rewrite in your server config. The default " "is ``'pages/{slug}.html'``." -msgstr "页面的保存位置。除非在服务器上设置了重写规则,否则此项设置必须和PAGE_URL一致。" -"本项配置默认为 ``'pages/{slug}.html'`` 。" +msgstr "" +"页面的保存位置。除非在服务器上设置了重写规则,否则此项设置必须和PAGE_URL一致。本项配置默认为 " +"``'pages/{slug}.html'`` 。" #: ../../settings.rst:550 6596ed1c997349bf94a503bdaa8b9e68 #, python-brace-format @@ -985,8 +999,9 @@ msgid "" " be set to ``title`` to use the \"Title:\" metadata tag or ``basename`` " "to use the article's file name when creating the slug. The default is " "``'title'``." -msgstr "自动生成slug所依赖的内容。可以指定为元数据标签 ``title`` ,也可以使用文章源文件的文件名 ``basename`` 。" -"本项配置默认为 ``'title'`` 。" +msgstr "" +"自动生成slug所依赖的内容。可以指定为元数据标签 ``title`` ,也可以使用文章源文件的文件名 ``basename`` 。本项配置默认为" +" ``'title'`` 。" #: ../../settings.rst:698 161c36590f2b40a3a4d9dab57848fba7 msgid "" @@ -1001,8 +1016,9 @@ msgstr "" msgid "" "Preserve uppercase characters in slugs. Set ``True`` to keep uppercase " "characters from ``SLUGIFY_SOURCE`` as-is. The default is ``False``." -msgstr "指定是否保留slug中的大写字母。若设为 ``True`` ,则会原样保留 ``SLUGIFY_SOURCE`` 中的大写字母。" -"本项配置默认为 ``False`` 。" +msgstr "" +"指定是否保留slug中的大写字母。若设为 ``True`` ,则会原样保留 ``SLUGIFY_SOURCE`` 中的大写字母。本项配置默认为 " +"``False`` 。" #: ../../settings.rst:709 ea3e23a38ffe465e8fef398b69940b87 msgid "" @@ -1016,8 +1032,7 @@ msgid "" "default is::" msgstr "" "指定生成文章和页面slug时要进行的正则表达式替换。指定的是一对对 ``(from, to)`` " -"(from为要替换的内容,to为替换进去的内容),列表中的各对替换规则是按序执行且忽略大小写的。默认的替换会删除非字母非数字的字符并将内部空格替换为连字符。除此之外,slug会将所有字符转换为小写ASCII字符,并删除所有前导和末尾空格。这有利于现有URL的向后兼容。" -"本项配置默认如下:" +"(from为要替换的内容,to为替换进去的内容),列表中的各对替换规则是按序执行且忽略大小写的。默认的替换会删除非字母非数字的字符并将内部空格替换为连字符。除此之外,slug会将所有字符转换为小写ASCII字符,并删除所有前导和末尾空格。这有利于现有URL的向后兼容。本项配置默认如下:" #: ../../settings.rst:726 4ed665fd61124d7199e5d3a336a6490e msgid "" @@ -1282,75 +1297,75 @@ msgstr "" msgid "" "The domain prepended to feed URLs. Since feed URLs should always be " "absolute, it is highly recommended to define this (e.g., " -"\"https://feeds.example.com\"). If you have already explicitly defined " -"SITEURL (see above) and want to use the same domain for your feeds, you " -"can just set: ``FEED_DOMAIN = SITEURL``. The default is ``None``, which " -"uses the base URL \"/\"." +"\"https://feeds.example.com\"). The default is ``SITEURL``." msgstr "" "指定要附加到订阅源URL前面的域名。因为订阅源URL应该是绝对的,所以强烈推荐定义此设置项(例如 " -"https://feeds.example.com )。若SITEURL已经显式地定义了,并且希望使用相同地URL,就可以直接设置 " -"``FEED_DOMAIN = SITEURL`` 。本项配置默认为 ``None`` ,即使用基础URL \"/\" 。" +"https://feeds.example.com )。本项配置默认为 ``SITEURL`` 。" -#: ../../settings.rst:979 7a7143a49149452d999c2084cc0266e6 +#: ../../settings.rst:976 7a7143a49149452d999c2084cc0266e6 msgid "" "The location to save the Atom feed. The default is ``None``, for no Atom " "feed." msgstr "指定Atom订阅源的存储位置。本项配置默认为 ``None`` ,即不使用Atom订阅源。" -#: ../../settings.rst:984 2fd2426a582247f8a375940ecbd0f96a +#: ../../settings.rst:981 2fd2426a582247f8a375940ecbd0f96a msgid "" "Relative URL of the Atom feed. If not set, ``FEED_ATOM`` is used both for" " save location and URL. The default is ``None``." -msgstr "Atom订阅源的相对URL。如果未设置此项,会将 ``FEED_ATOM`` 同时用于存储位置和URL。" -"本项配置默认为 ``None`` 。" +msgstr "Atom订阅源的相对URL。如果未设置此项,会将 ``FEED_ATOM`` 同时用于存储位置和URL。本项配置默认为 ``None`` 。" -#: ../../settings.rst:989 c4758a4ce8f94850ba4567250259741d +#: ../../settings.rst:986 c4758a4ce8f94850ba4567250259741d msgid "" "The location to save the RSS feed. The default is ``None``, for no RSS " "feed." msgstr "RSS订阅源的存储位置。本项配置默认为 ``None`` ,即不使用RSS订阅源。" -#: ../../settings.rst:993 737caf1d58854aa3b86820243fc80403 +#: ../../settings.rst:990 737caf1d58854aa3b86820243fc80403 msgid "" "Relative URL of the RSS feed. If not set, ``FEED_RSS`` is used both for " "save location and URL. The default is ``None``." msgstr "RSS订阅源的相对URL。如果未设置此项,会将 ``FEED_RSS`` 同时用于存储位置和URL。本项配置默认为 ``None`` 。" -#: ../../settings.rst:998 28942938054b490c8dd5ca8367d87ea9 +#: ../../settings.rst:995 28942938054b490c8dd5ca8367d87ea9 msgid "" "The location to save the all-posts Atom feed: this feed will contain all " "posts regardless of their language. The default is " "``'feeds/all.atom.xml'``." msgstr "存储all-posts Atom订阅源的文件位置:其中会包含所有语言的帖子。本项配置默认为 ``'feeds/all.atom.xml'`` 。" -#: ../../settings.rst:1003 f4e7fbd9297743ccaadafa11c7cfb1e1 +#: ../../settings.rst:1000 f4e7fbd9297743ccaadafa11c7cfb1e1 msgid "" "Relative URL of the all-posts Atom feed. If not set, ``FEED_ALL_ATOM`` is" " used both for save location and URL. The default is ``None``." -msgstr "all-posts Atom订阅源的相对URL。如果未设置此项,会将 ``FEED_ALL_ATOM`` 同时用于存储位置和URL。" -"本项配置默认为 ``None`` 。" +msgstr "" +"all-posts Atom订阅源的相对URL。如果未设置此项,会将 ``FEED_ALL_ATOM`` 同时用于存储位置和URL。本项配置默认为" +" ``None`` 。" -#: ../../settings.rst:1008 eaacfd07bdb94dd2a9c6792a1f036807 +#: ../../settings.rst:1005 eaacfd07bdb94dd2a9c6792a1f036807 msgid "" "The location to save the the all-posts RSS feed: this feed will contain " "all posts regardless of their language. The default is ``None``, for no " "all-posts RSS feed." -msgstr "存储all-posts RSS订阅源的文件位置:其中会包含所有语言的帖子。本项配置默认为 ``None`` ,即不使用all-posts RSS订阅源。" +msgstr "" +"存储all-posts RSS订阅源的文件位置:其中会包含所有语言的帖子。本项配置默认为 ``None`` ,即不使用all-posts " +"RSS订阅源。" -#: ../../settings.rst:1014 fe17f05439064eea8fb3dad8255cd467 +#: ../../settings.rst:1011 fe17f05439064eea8fb3dad8255cd467 msgid "" "Relative URL of the all-posts RSS feed. If not set, ``FEED_ALL_RSS`` is " "used both for save location and URL. The default is ``None``." -msgstr "all-posts RSS订阅源的相对URL。如果未设置此项,会将 ``FEED_ALL_RSS`` 同时用于存储位置和URL。本项配置默认为 ``None`` 。" +msgstr "" +"all-posts RSS订阅源的相对URL。如果未设置此项,会将 ``FEED_ALL_RSS`` 同时用于存储位置和URL。本项配置默认为 " +"``None`` 。" -#: ../../settings.rst:1019 c4758a4ce8f94850ba4567250259741d +#: ../../settings.rst:1016 c4758a4ce8f94850ba4567250259741d #, python-brace-format msgid "" "The location to save the category Atom feeds. [2]_ The default is " "``'feeds/{slug}.atom.xml'``." msgstr "category Atom订阅源的存储位置。 [2]_ 本项配置默认为 ``'feeds/{slug}.atom.xml'`` 。" -#: ../../settings.rst:1024 d31bcd45f3ee47e4a316ac3f765c527d +#: ../../settings.rst:1021 d31bcd45f3ee47e4a316ac3f765c527d #, python-brace-format msgid "" "Relative URL of the category Atom feeds, including the ``{slug}`` " @@ -1360,14 +1375,14 @@ msgstr "" "category Atom订阅源的相对URL,其中包含 ``{slug}`` 。 [2]_ 如果未设置, 会将 " "``CATEGORY_FEED_ATOM`` 同时用于存储位置和URL。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1030 fabfac75a52f48029a8147f62289c252 +#: ../../settings.rst:1027 fabfac75a52f48029a8147f62289c252 #, python-brace-format msgid "" "The location to save the category RSS feeds, including the ``{slug}`` " "placeholder. [2]_ The default is ``None``, for no RSS feed." msgstr "category RSS订阅源的存储位置,其中包含 ``{slug}`` 。 [2]_ 本项配置默认为 ``None`` ,即不使用RSS订阅源。" -#: ../../settings.rst:1035 fabfac75a52f48029a8147f62289c252 +#: ../../settings.rst:1032 fabfac75a52f48029a8147f62289c252 #, python-brace-format msgid "" "Relative URL of the category RSS feeds, including the ``{slug}`` " @@ -1377,14 +1392,16 @@ msgstr "" "category RSS订阅源的相对URL,其中包含 ``{slug}`` 。 [2]_ 如果未设置, 会将 " "``CATEGORY_FEED_RSS`` 同时用于存储位置和URL。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1041 28942938054b490c8dd5ca8367d87ea9 +#: ../../settings.rst:1038 28942938054b490c8dd5ca8367d87ea9 #, python-brace-format msgid "" "The location to save the author Atom feeds. [2]_ The default is " "``'feeds/{slug}.atom.xml'``." -msgstr "author Atom订阅源的存储位置,其中包含 ``{slug}`` 。 [2]_ 本项配置默认为 ``'feeds/{slug}.atom.xml'`` 。" +msgstr "" +"author Atom订阅源的存储位置,其中包含 ``{slug}`` 。 [2]_ 本项配置默认为 " +"``'feeds/{slug}.atom.xml'`` 。" -#: ../../settings.rst:1046 fde52f62d95a4bad85a5a1b49eed6170 +#: ../../settings.rst:1043 fde52f62d95a4bad85a5a1b49eed6170 #, python-brace-format msgid "" "Relative URL of the author Atom feeds, including the ``{slug}`` " @@ -1394,14 +1411,14 @@ msgstr "" "author Atom订阅源的相对URL,其中包含 ``{slug}`` 。 [2]_ 如果未设置, 会将 " "``AUTHOR_FEED_ATOM`` 同时用于存储位置和URL。本项配置默认为 ``None`` ,即不使用。" -#: ../../settings.rst:1052 c4758a4ce8f94850ba4567250259741d +#: ../../settings.rst:1049 c4758a4ce8f94850ba4567250259741d #, python-brace-format msgid "" "The location to save the author RSS feeds. [2]_ The default is " "``'feeds/{slug}.rss.xml'``." msgstr "author RSS订阅源的存储位置。 [2]_ 本项配置默认为 ``'feeds/{slug}.rss.xml'`` 。" -#: ../../settings.rst:1057 367ef87d541c45ffaf65e8d8b1469f1a +#: ../../settings.rst:1054 367ef87d541c45ffaf65e8d8b1469f1a #, python-brace-format msgid "" "Relative URL of the author RSS feeds, including the ``{slug}`` " @@ -1411,37 +1428,38 @@ msgstr "" "author RSS订阅源的相对URL,其中包含 ``{slug}`` 。 [2]_ 如果未设置, 会将 ``AUTHOR_FEED_RSS`` " "同时用于存储位置和URL。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1063 b1159e07c8184831b6dcfd308cd23439 +#: ../../settings.rst:1060 b1159e07c8184831b6dcfd308cd23439 #, python-brace-format msgid "" "The location to save the tag Atom feed, including the ``{slug}`` " "placeholder. [2]_ The default is ``None``, for no tag feed." msgstr "tag Atom订阅源的存储位置,其中包含 ``{slug}`` 。 [2]_ 本项配置默认为 ``None`` ,即不使用tag feed。" -#: ../../settings.rst:1068 d744ca82b48d4e9298f2ca19252aedec +#: ../../settings.rst:1065 d744ca82b48d4e9298f2ca19252aedec #, python-brace-format msgid "" "Relative URL of the tag Atom feed, including the ``{slug}`` placeholder. " "[2]_ The default is ``None``." msgstr "tag Atom订阅源的相对URL,其中包含 ``{slug}`` 。 [2]_ 本项配置默认为 ``None`` 。" -#: ../../settings.rst:1073 b1159e07c8184831b6dcfd308cd23439 +#: ../../settings.rst:1070 b1159e07c8184831b6dcfd308cd23439 #, python-brace-format msgid "" "Relative URL to output the tag RSS feed, including the ``{slug}`` " "placeholder. If not set, ``TAG_FEED_RSS`` is used both for save location " "and URL. The default is ``None``, for no tag feed." -msgstr "tag RSS订阅源的相对URL,其中包含 ``{slug}`` 。如果未设置,会将 ``TAG_FEED_RSS`` 同时用于存储位置和URL。" -"本项配置默认为 ``None`` ,即不使用tag feed。" +msgstr "" +"tag RSS订阅源的相对URL,其中包含 ``{slug}`` 。如果未设置,会将 ``TAG_FEED_RSS`` " +"同时用于存储位置和URL。本项配置默认为 ``None`` ,即不使用tag feed。" -#: ../../settings.rst:1079 c8f29653c4f3423b8dec9905fa1de6f2 +#: ../../settings.rst:1076 c8f29653c4f3423b8dec9905fa1de6f2 msgid "" "Maximum number of items allowed in a feed. Setting to ``None`` will cause" " the feed to contains every article. 100 if not specified. The default is" " ``100``." msgstr "单个订阅源中允许包含的最多元素数量。若设为 ``None`` 表示不做上限;若不指定,默认上限为100。" -#: ../../settings.rst:1084 27393055cbb846bba21699d9a59502c2 +#: ../../settings.rst:1081 27393055cbb846bba21699d9a59502c2 msgid "" "Only include item summaries in the ``description`` tag of RSS feeds. If " "set to ``False``, the full content will be included instead. This setting" @@ -1450,28 +1468,28 @@ msgstr "" "仅在RSS订阅源的 ``description`` 标签中包含项目摘要。若设为 ``False`` ,则将包含完整内容。此项设置不会影响Atom " "feed,只针对RSS feed。本项配置默认为 ``True`` 。" -#: ../../settings.rst:1090 2c53416e07e34cc9998718fc5e82cc12 +#: ../../settings.rst:1087 2c53416e07e34cc9998718fc5e82cc12 msgid "" "If set to ``True``, ``?ref=feed`` will be appended to links in generated " "feeds for the purpose of referrer tracking. The default is ``False``." msgstr "若设为 ``True`` ,会将 ``?ref=feed`` 附到生成的链接中,以便追踪引用。本项配置默认为 ``False`` 。" -#: ../../settings.rst:1093 7f647c4c65494b93bb6d1c3ef4b39af6 +#: ../../settings.rst:1090 7f647c4c65494b93bb6d1c3ef4b39af6 msgid "" "If you don't want to generate some or any of these feeds, set the above " "variables to ``None``." msgstr "若你不想要生成某些订阅源,将对应变量设为 ``None`` 即可。" -#: ../../settings.rst:1096 372a88d4b1044ba491c1547e90014c73 +#: ../../settings.rst:1093 372a88d4b1044ba491c1547e90014c73 #, python-brace-format msgid "``{slug}`` is replaced by name of the category / author / tag." msgstr "``{slug}`` 会分别用分类名/作者名/标签名来替换。" -#: ../../settings.rst:1100 9913cc3370754eda888a2594a73ce4da +#: ../../settings.rst:1097 9913cc3370754eda888a2594a73ce4da msgid "Pagination" msgstr "分页" -#: ../../settings.rst:1102 caf94bfd47344208a34f6b10225646a1 +#: ../../settings.rst:1099 caf94bfd47344208a34f6b10225646a1 msgid "" "The default behaviour of Pelican is to list all the article titles along " "with a short description on the index page. While this works well for " @@ -1479,46 +1497,50 @@ msgid "" "probably benefit from paginating this list." msgstr "默认情况下,Pelican会把所有文章以简短描述的形式展示在首页上。虽然这对中小型网站效果不错,但对于拥有大量文章的网站来说可能需要将此列表进行分页。" -#: ../../settings.rst:1107 2667020362fe4d23a84b1d25b24863c3 +#: ../../settings.rst:1104 2667020362fe4d23a84b1d25b24863c3 msgid "You can use the following settings to configure the pagination." msgstr "你可以使用下面的设置来配置分页。" -#: ../../settings.rst:1111 656911c7bc2145b0bd1ff10d5373d7dc +#: ../../settings.rst:1108 656911c7bc2145b0bd1ff10d5373d7dc msgid "" "The minimum number of articles allowed on the last page. Use this when " "you don't want the last page to only contain a handful of articles. The " "default is ``0``." -msgstr "最后一页允许的最小文章数。当不希望最后一页仅包含少数文章时,请使用此选项。(译者注:当最后一页达不到此最小文章数时,会被合并到前一页)" -"本项配置默认为 ``0`` 。" +msgstr "" +"最后一页允许的最小文章数。当不希望最后一页仅包含少数文章时,请使用此选项。(译者注:当最后一页达不到此最小文章数时,会被合并到前一页)本项配置默认为" +" ``0`` 。" -#: ../../settings.rst:1117 030af02515a84a13925108ab06457c0b +#: ../../settings.rst:1114 030af02515a84a13925108ab06457c0b msgid "" "The maximum number of articles to include on a page, not including " "orphans. False to disable pagination. The default is ``False``." -msgstr "一个页面上包含的最大文章数,不包括孤立文章(译者注:当发生上一条设置选项中提到的合并时,最后一页显然会超过此最大文章数)。设为False会禁用分页。" -"本项配置默认为 ``False`` 。" +msgstr "" +"一个页面上包含的最大文章数,不包括孤立文章(译者注:当发生上一条设置选项中提到的合并时,最后一页显然会超过此最大文章数)。设为False会禁用分页。本项配置默认为" +" ``False`` 。" -#: ../../settings.rst:1122 478c5db91b16485b81ea4523ae70b6f1 +#: ../../settings.rst:1119 478c5db91b16485b81ea4523ae70b6f1 #, python-brace-format msgid "" "The templates to use pagination with, and the number of articles to " "include on a page. If this value is ``None``, it defaults to " "``DEFAULT_PAGINATION``. The default is ``{'index': None, 'tag': None, " "'category': None, 'author': None}``." -msgstr "指定哪些模板需要启用分页,以及对应的单页面文章数量。若设为 ``None`` ,则默认值为 ``DEFAULT_PAGINATION`` 。" -"本项配置默认为 ``{'index': None, 'tag': None, 'category': None, 'author': None}`` 。" +msgstr "" +"指定哪些模板需要启用分页,以及对应的单页面文章数量。若设为 ``None`` ,则默认值为 ``DEFAULT_PAGINATION`` " +"。本项配置默认为 ``{'index': None, 'tag': None, 'category': None, 'author': " +"None}`` 。" -#: ../../settings.rst:1128 631c92f55fca4dd4acff9348397bdead +#: ../../settings.rst:1125 631c92f55fca4dd4acff9348397bdead msgid "" "A set of patterns that are used to determine advanced pagination output. " "The default is::" msgstr "一组匹配模式,用于高级分页输出。本项配置默认如下:" -#: ../../settings.rst:1138 319e228179c2404dace7b1374e30a558 +#: ../../settings.rst:1135 319e228179c2404dace7b1374e30a558 msgid "Using Pagination Patterns" msgstr "使用分页模式" -#: ../../settings.rst:1140 7c7876166cba4db0bc8ca7c6ceb1f828 +#: ../../settings.rst:1137 7c7876166cba4db0bc8ca7c6ceb1f828 msgid "" "By default, pages subsequent to ``.../foo.html`` are created as " "``.../foo2.html``, etc. The ``PAGINATION_PATTERNS`` setting can be used " @@ -1528,7 +1550,7 @@ msgstr "" "默认情况下,连续页面的URL会如此编码:第一页为 ``.../foo.html`` ,后一页为 ``.../foo2.html`` " "。``PAGINATION_PATTERNS`` 就是用于修改这个编页规则的,其中是一些三元组:" -#: ../../settings.rst:1146 b96115cbd30a454e98427c2f568c9d9f +#: ../../settings.rst:1143 b96115cbd30a454e98427c2f568c9d9f #, python-brace-format msgid "" "For ``page_url`` and ``page_save_as``, you may use a number of variables." @@ -1546,7 +1568,7 @@ msgstr "" "相同,只不过会截去末尾的 ``/index`` (如果有的话)。 ``{number}`` 则等于页码。(译者注: " "``minimum_page`` 意味到达该页面数后开始使用此条规则)" -#: ../../settings.rst:1153 0513d4b59b6443a592d6c47abf6ffd13 +#: ../../settings.rst:1150 0513d4b59b6443a592d6c47abf6ffd13 msgid "" "For example, if you want to leave the first page unchanged, but place " "subsequent pages at ``.../page/2/`` etc, you could set " @@ -1555,52 +1577,54 @@ msgstr "" "举个例子,如果你想要保持第一面保持不变,但后续页面都以 ``.../page/2/`` 的形式出现,你可以如此设置 " "``PAGINATION_PATTERNS`` :" -#: ../../settings.rst:1163 a7e53284e5344eb5bab04206293349e4 +#: ../../settings.rst:1160 a7e53284e5344eb5bab04206293349e4 msgid "" "If you want a pattern to apply to the last page in the list, use ``-1`` " "as the ``minimum_page`` value::" msgstr "如果你想指定最后一面制定规则,将 ``minimum_page`` 的值设为 ``-1`` 即可:" -#: ../../settings.rst:1169 ee7ce86e8f1749e686233ec4a999dcc9 +#: ../../settings.rst:1166 ee7ce86e8f1749e686233ec4a999dcc9 msgid "Translations" msgstr "翻译" -#: ../../settings.rst:1171 66ba1c80957b4e84a265bbf1cfac36e5 +#: ../../settings.rst:1168 66ba1c80957b4e84a265bbf1cfac36e5 msgid "" "Pelican offers a way to translate articles. See the :doc:`Content " "` section for more information." msgstr "Pelican为文章翻译提供了展示方法。详见 :doc:`创作内容 ` 。" -#: ../../settings.rst:1176 27cab75cf2344a8c8d1573700e1f35ca +#: ../../settings.rst:1173 27cab75cf2344a8c8d1573700e1f35ca msgid "The default language to use. The default is ``'en'``." msgstr "指定默认语言。本项配置默认为 ``'en'`` 。" -#: ../../settings.rst:1180 2db269f9350e48098e8e06643b77a107 +#: ../../settings.rst:1177 2db269f9350e48098e8e06643b77a107 msgid "" "The metadata attribute(s) used to identify which articles are " "translations of one another. May be a string or a collection of strings. " "Set to ``None`` or ``False`` to disable the identification of " "translations. The default is ``'slug'``." -msgstr "指定用于标识不同翻译是同一篇文章的元数据。可以是一个或多个字符串。要禁用对文章翻译的识别,将此项设为 ``None`` 或 ``False`` 。" -"本项配置默认为 ``'slug'`` 。" +msgstr "" +"指定用于标识不同翻译是同一篇文章的元数据。可以是一个或多个字符串。要禁用对文章翻译的识别,将此项设为 ``None`` 或 ``False`` " +"。本项配置默认为 ``'slug'`` 。" -#: ../../settings.rst:1187 bfa4d3e17c6f42ac9ddeb79fd2131943 +#: ../../settings.rst:1184 bfa4d3e17c6f42ac9ddeb79fd2131943 msgid "" "The metadata attribute(s) used to identify which pages are translations " "of one another. May be a string or a collection of strings. Set to " "``None`` or ``False`` to disable the identification of translations. The " "default is ``'slug'``." -msgstr "指定用于标识不同翻译是同一个页面的元数据。可以是一个或多个字符串。要禁用对页面翻译的识别,将此项设为 ``None`` 或 ``False`` 。" -"本项配置默认为 ``'slug'`` 。" +msgstr "" +"指定用于标识不同翻译是同一个页面的元数据。可以是一个或多个字符串。要禁用对页面翻译的识别,将此项设为 ``None`` 或 ``False`` " +"。本项配置默认为 ``'slug'`` 。" -#: ../../settings.rst:1194 2ae8d30c65cb460194294c5a5de14f02 +#: ../../settings.rst:1191 2ae8d30c65cb460194294c5a5de14f02 #, python-brace-format msgid "" "The location to save the Atom feed for translations. [3]_ The default is " "``'feeds/all-{lang}.atom.xml'``." msgstr "指定各翻译Atom订阅源的存储位置。 [3]_ 本项配置默认为 ``'feeds/all-{lang}.atom.xml'`` 。" -#: ../../settings.rst:1199 bc09f3717a8a497680abc66b70745d0f +#: ../../settings.rst:1196 bc09f3717a8a497680abc66b70745d0f #, python-brace-format msgid "" "Relative URL of the Atom feed for translations, including the ``{lang}`` " @@ -1610,13 +1634,13 @@ msgstr "" "指定各翻译Atom feed的含有 ``{lang}`` 的相对URL。 [3]_ " "若未设置此项,``TRANSLATION_FEED_ATOM`` 会同时用于存储位置和URL。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1205 1049b8c5e754466684e120afb2f7d281 +#: ../../settings.rst:1202 1049b8c5e754466684e120afb2f7d281 msgid "" "Where to put the RSS feed for translations. The default is ``None``, " "meaning no RSS feed." msgstr "指定各翻译RSS订阅源的存储位置。本项配置默认为 ``None`` ,即无RSS feed。" -#: ../../settings.rst:1210 625b105c73764fce865b2504e811e055 +#: ../../settings.rst:1207 625b105c73764fce865b2504e811e055 #, python-brace-format msgid "" "Relative URL of the RSS feed for translations, including the ``{lang}`` " @@ -1626,28 +1650,28 @@ msgstr "" "文章或页面不同翻译在RSS订阅源中的相对路径,其中含有 ``{lang}``。 [3]_ " "若未设置此项,``TRANSLATION_FEED_RSS`` 会同时用于存储位置和URL。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1214 088e79d226f0487fafc14494179cabcf +#: ../../settings.rst:1211 088e79d226f0487fafc14494179cabcf #, python-brace-format msgid "{lang} is the language code" msgstr "{lang} 为语言代码" -#: ../../settings.rst:1217 4376232e5a294aca906df56af2f49303 +#: ../../settings.rst:1214 4376232e5a294aca906df56af2f49303 msgid "Ordering content" msgstr "内容的排列顺序" -#: ../../settings.rst:1221 41cf2c63929d4eeeae7bfdee85e8d084 +#: ../../settings.rst:1218 41cf2c63929d4eeeae7bfdee85e8d084 msgid "" "Order archives by newest first by date. (False: orders by date with older" " articles first.) The default is ``True``." msgstr "若设为True,日期较新的会排在前面;若设为False,则日期较旧的会排在前面。本项配置默认为 ``True`` 。" -#: ../../settings.rst:1226 3f3709e077b3416f8c3640dfc4432e38 +#: ../../settings.rst:1223 3f3709e077b3416f8c3640dfc4432e38 msgid "" "Reverse the category order. (True: lists by reverse alphabetical order; " "default lists alphabetically.) The default is ``False``." msgstr "若设为True,分类会按字典序逆序排列;若设为False,则按字典序顺序排列。本项配置默认为 ``False`` 。" -#: ../../settings.rst:1231 ff8d745b1884450185d26b1f7d645a5f +#: ../../settings.rst:1228 ff8d745b1884450185d26b1f7d645a5f msgid "" "Defines how the articles (``articles_page.object_list`` in the template) " "are sorted. Valid options are: metadata as a string (use ``reversed-`` " @@ -1658,32 +1682,33 @@ msgid "" "``'reversed-date'``, will sort articles by date in reverse order (i.e., " "newest article comes first). The default is ``'reversed-date'``." msgstr "" -"定义文章(模板中的 ``articles_page.object_list`` " -")的排序方式。有效选项包括:字符串形式的元数据(使用前缀 ``reversed-`` 来指定逆序)、特殊选项 ``'basename'`` " +"定义文章(模板中的 ``articles_page.object_list`` )的排序方式。有效选项包括:字符串形式的元数据(使用前缀 " +"``reversed-`` 来指定逆序)、特殊选项 ``'basename'`` " "(不带路径的文件名)、或是一个可以从文章中提取排序键的自定义函数。例如,将选项值设为 ``'date'`` ,文章就会以时间顺序排列文章。默认值为" " ``'reversed-date'`` ,即以日期逆序排列,即新文章在前、旧文章在后。本项配置默认为 ``'reversed-date'`` 。" -#: ../../settings.rst:1242 c2de8ca998954143a3a21d52f57a4e17 +#: ../../settings.rst:1239 c2de8ca998954143a3a21d52f57a4e17 msgid "" "Defines how the pages (``pages`` variable in the template) are sorted. " "Options are same as ``ARTICLE_ORDER_BY``. The default value, " "``'basename'`` will sort pages by their basename. The default is " "``'basename'``." msgstr "" -"定义页面(模板中的 ``pages`` 变量)的排序顺序。有效选项和 ``ARTICLE_ORDER_BY`` 中的相同。本项配置默认为 ``'basename'`` 。" +"定义页面(模板中的 ``pages`` 变量)的排序顺序。有效选项和 ``ARTICLE_ORDER_BY`` 中的相同。本项配置默认为 " +"``'basename'`` 。" -#: ../../settings.rst:1250 6a345fb283734251b7acad72b7c4cf51 +#: ../../settings.rst:1247 6a345fb283734251b7acad72b7c4cf51 msgid "Themes" msgstr "主题" -#: ../../settings.rst:1252 6498842c51bb40548a640a7d419909bf +#: ../../settings.rst:1249 6498842c51bb40548a640a7d419909bf msgid "" "Creating Pelican themes is addressed in a dedicated section (see :ref" ":`theming-pelican`). However, here are the settings that are related to " "themes." msgstr "创建Pelican主题在单独的一节中讲解(参见 :ref:`theming-pelican` )。此处讲解和主题有关的配置项。" -#: ../../settings.rst:1258 bb35f8335e4142f5b69a61115ab790e5 +#: ../../settings.rst:1255 bb35f8335e4142f5b69a61115ab790e5 msgid "" "Theme to use to produce the output. Can be a relative or absolute path to" " a theme folder, or the name of a default theme or a theme installed via " @@ -1692,16 +1717,16 @@ msgstr "" "用于产生输出的主题。可以是到达要使用主题的文件夹的相对或绝对路径,或是主题的名称(默认主题或通过 :doc:`pelican-themes` " "安装的主题)。默认主题为 \"notmyidea\" 。" -#: ../../settings.rst:1264 3d47fbf73e7a4188a877619ef4cbed77 +#: ../../settings.rst:1261 3d47fbf73e7a4188a877619ef4cbed77 msgid "" "Destination directory in the output path where Pelican will place the " "files collected from `THEME_STATIC_PATHS`. Default is `theme`. The " "default is ``'theme'``." msgstr "" -"Pelican从 `THEME_STATIC_PATHS` 中发现主题要使用的静态文件,此设置项指定这些静态文件在输出路径中的目录。" -"本项配置默认为 ``'theme'`` 。" +"Pelican从 `THEME_STATIC_PATHS` 中发现主题要使用的静态文件,此设置项指定这些静态文件在输出路径中的目录。本项配置默认为" +" ``'theme'`` 。" -#: ../../settings.rst:1270 c0b9021df19241fab6b6f90983248f9c +#: ../../settings.rst:1267 c0b9021df19241fab6b6f90983248f9c msgid "" "Static theme paths you want to copy. Default value is `static`, but if " "your theme has other static paths, you can put them here. If files or " @@ -1710,10 +1735,10 @@ msgid "" "``['static']``." msgstr "" "要复制的静态主题路径。默认值为 `static` " -",但如果你的主题有其他静态路径,也可以将其放在此处。此项设置中若包含了相同名称的文件或目录,前面的会被后面的覆盖。" -"本项配置默认为 ``['static']`` 。" +",但如果你的主题有其他静态路径,也可以将其放在此处。此项设置中若包含了相同名称的文件或目录,前面的会被后面的覆盖。本项配置默认为 " +"``['static']`` 。" -#: ../../settings.rst:1277 117f2d4711394bf39c50303d6b24c06b +#: ../../settings.rst:1274 117f2d4711394bf39c50303d6b24c06b msgid "" "A list of paths you want Jinja2 to search for templates before searching " "the theme's ``templates/`` directory. Allows for overriding individual " @@ -1722,11 +1747,11 @@ msgid "" "first, then the theme's ``templates/``. The default is ``[]``." msgstr "" "在搜索主题的 ``templates/`` " -"目录前,Jinja2会先搜索此设置项中的路径。可以使用此设置项覆盖主题中的某些模板文件,以尽量避免修改现有主题。" -"Jinja2会先搜索 ``THEME_TEMPLATES_OVERRIDES`` 配置的文件,再搜索主题中的 ``templates/`` 目录。" -"本项配置默认为 ``[]`` 。" +"目录前,Jinja2会先搜索此设置项中的路径。可以使用此设置项覆盖主题中的某些模板文件,以尽量避免修改现有主题。Jinja2会先搜索 " +"``THEME_TEMPLATES_OVERRIDES`` 配置的文件,再搜索主题中的 ``templates/`` 目录。本项配置默认为 " +"``[]`` 。" -#: ../../settings.rst:1283 3f686a923ffa4a468df172f04146e388 +#: ../../settings.rst:1280 3f686a923ffa4a468df172f04146e388 #, python-brace-format, python-format msgid "" "You can also extend templates from the theme using the ``{% extends %}`` " @@ -1734,26 +1759,26 @@ msgid "" "example:" msgstr "利用 ``{% extends %}`` 指令中的 ``!theme`` 前缀也可以用于从主题扩展模板,如下例所示:" -#: ../../settings.rst:1292 35121540d2254f698cbf9538d00cf5bd +#: ../../settings.rst:1289 35121540d2254f698cbf9538d00cf5bd msgid "Specify the CSS file you want to load. The default is ``'main.css'``." msgstr "指定需要加载的CSS文件。本项配置默认为 ``'main.css'`` 。" -#: ../../settings.rst:1294 533f2b3f18864e7ca68bfcb5d6961fe1 +#: ../../settings.rst:1291 533f2b3f18864e7ca68bfcb5d6961fe1 msgid "" "By default, two themes are available. You can specify them using the " "``THEME`` setting or by passing the ``-t`` option to the ``pelican`` " "command:" msgstr "默认情况下,有两个主题可供选择。可以使用 ``THEME`` 选项指定,或是在 ``pelican`` 命令中使用 ``-t`` 选项的参数传入。" -#: ../../settings.rst:1297 f1ea5d4700ca4f1091d6ee798596cff7 +#: ../../settings.rst:1294 f1ea5d4700ca4f1091d6ee798596cff7 msgid "notmyidea" msgstr "notmyidea(默认值)" -#: ../../settings.rst:1298 9b7be83a91ab4de7bd6d7a30dbcef939 +#: ../../settings.rst:1295 9b7be83a91ab4de7bd6d7a30dbcef939 msgid "simple (a synonym for \"plain text\" :)" msgstr "simple(即“plain text”)" -#: ../../settings.rst:1300 3ac1546ab1144586825809c12f4abc78 +#: ../../settings.rst:1297 3ac1546ab1144586825809c12f4abc78 msgid "" "There are a number of other themes available at " "https://github.com/getpelican/pelican-themes. Pelican comes with :doc" @@ -1762,107 +1787,107 @@ msgstr "" "还有很多主题可以在 https://github.com/getpelican/pelican-themes 上下载。Pelican使用一个称为 " ":doc:`pelican-themes` 的小脚本来管理主题。" -#: ../../settings.rst:1304 f1b29806557540ddaefe6bc035a48459 +#: ../../settings.rst:1301 f1b29806557540ddaefe6bc035a48459 msgid "" "You can define your own theme, either by starting from scratch or by " "duplicating and modifying a pre-existing theme. Here is :doc:`a guide on " "how to create your theme `." msgstr "你还可以创建自己的主题,可以从头开始,也可以在已有主题的基础上修改。请参看 :doc:`主题 ` 文档。" -#: ../../settings.rst:1308 47a8dd97888b440aabbea22aee72630a +#: ../../settings.rst:1305 47a8dd97888b440aabbea22aee72630a msgid "Following are example ways to specify your preferred theme::" msgstr "下面是几个指定某个主题的例子:" -#: ../../settings.rst:1319 3f51b49bed124af39ae67bf60c8384f8 +#: ../../settings.rst:1316 3f51b49bed124af39ae67bf60c8384f8 msgid "" "The built-in ``simple`` theme can be customized using the following " "settings." msgstr "内置的 ``simple`` 主题可以使用以下设置项进行自定义。" -#: ../../settings.rst:1323 08d86196410f482e803c69d85078652a +#: ../../settings.rst:1320 08d86196410f482e803c69d85078652a msgid "The URL of the stylesheet to use. The default is ``None``." msgstr "要使用的样式表的URL。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1325 369beaeb61fd4e4f843d8174b666c0a7 +#: ../../settings.rst:1322 369beaeb61fd4e4f843d8174b666c0a7 msgid "" "The built-in ``notmyidea`` theme can make good use of the following " "settings. Feel free to use them in your themes as well." msgstr "下面的一下选项可以很好地作用于内置的 ``notmyidea`` 主题。当然在其他主题中你也可以尽情尝试这些选项。" -#: ../../settings.rst:1330 7f647c4c65494b93bb6d1c3ef4b39af6 +#: ../../settings.rst:1327 7f647c4c65494b93bb6d1c3ef4b39af6 msgid "A subtitle to appear in the header. The default is ``None``." msgstr "页面顶部要显示的副标题。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1334 49eda3f428d7490bb78e081bbc941e64 +#: ../../settings.rst:1331 49eda3f428d7490bb78e081bbc941e64 msgid "" "Pelican can handle Disqus comments. Specify the Disqus sitename " "identifier here. The default is ``None``." msgstr "可以在Pelican中使用Disqus的评论系统,此设置项用于设置Disqus的站点标识符。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1339 a52590c6150e459495608626cf47cbc8 +#: ../../settings.rst:1336 a52590c6150e459495608626cf47cbc8 msgid "" "Your GitHub URL (if you have one). It will then use this information to " "create a GitHub ribbon. The default is ``None``." msgstr "指定你的GitHub URL(如果有的话),此信息将被用于创建GitHub标记。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1344 7a1fab7bd7d248aca77d6cebb71415fb +#: ../../settings.rst:1341 7a1fab7bd7d248aca77d6cebb71415fb msgid "" "Put any desired analytics scripts in this setting in ``publishconf.py``. " "Example:" msgstr "在 ``publishconf.py`` 中设置此项,用于指定想要使用的统计分析脚本。如下例:" -#: ../../settings.rst:1356 f0fd9392aa0544248ae3ecfa505cbd50 +#: ../../settings.rst:1353 f0fd9392aa0544248ae3ecfa505cbd50 msgid "The default is ``None``." msgstr "默认为 ``None``" -#: ../../settings.rst:1360 5f3cf76b56694fa88318f38e06dfb9d9 +#: ../../settings.rst:1357 5f3cf76b56694fa88318f38e06dfb9d9 msgid "" "A list of tuples (Title, URL) for additional menu items to appear at the " "beginning of the main menu. The default is ``None``." msgstr "指定 (标题, URL) 元组的列表,用于指定额外的菜单项,会添加在菜单栏的开头。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1365 23402de55a8d4b9a99f81aa3cbfd334f +#: ../../settings.rst:1362 23402de55a8d4b9a99f81aa3cbfd334f msgid "" "A list of tuples (Title, URL) for links to appear on the header. The " "default is ``None``." msgstr "指定 (标题, URL) 元组的列表,用于指定要展示在顶部的链接。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1370 55e5a965cc1f45eea43a064d8c93c758 +#: ../../settings.rst:1367 55e5a965cc1f45eea43a064d8c93c758 msgid "" "A list of tuples (Title, URL) to appear in the \"social\" section. The " "default is ``None``." msgstr "指定 (标题, URL) 元组的列表,用于指定要展示在“social”部分的内容。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1375 2b60264917b1429b9252029724038ed9 +#: ../../settings.rst:1372 2b60264917b1429b9252029724038ed9 msgid "" "Allows for adding a button to articles to encourage others to tweet about" " them. Add your Twitter username if you want this button to appear. The " "default is ``None``." msgstr "允许在文章中添加按钮,以便其他人在tweet上引用。如果希望显示此按钮,在此项中设置你的Twitter用户名。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1381 f625d19e9cfc481f90ba05c050829ef3 +#: ../../settings.rst:1378 f625d19e9cfc481f90ba05c050829ef3 msgid "" "Allows override of the name of the links widget. If not specified, " "defaults to \"links\". The default is ``None``." msgstr "指定用于覆盖“links”部分的名称,若不指定,默认设为 “links”。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1386 54cd361f2d6c44ec8b8838f2364f9c7f +#: ../../settings.rst:1383 54cd361f2d6c44ec8b8838f2364f9c7f msgid "" "Allows override of the name of the \"social\" widget. If not specified, " "defaults to \"social\". The default is ``None``." msgstr "指定用于覆盖“social”部分的名称。若不指定,默认设为 “social”。本项配置默认为 ``None`` 。" -#: ../../settings.rst:1389 16874b8a80b149578efba9c45a78a9c7 +#: ../../settings.rst:1386 16874b8a80b149578efba9c45a78a9c7 msgid "" "In addition, you can use the \"wide\" version of the ``notmyidea`` theme " "by adding the following to your configuration::" msgstr "另外,你可以使用 ``notmyidea`` 主题的“宽屏”版本,在配置文件中添加下面这行配置即可:" -#: ../../settings.rst:1396 9d24e75fc67d4b98a06bbe832f7cd947 +#: ../../settings.rst:1393 9d24e75fc67d4b98a06bbe832f7cd947 msgid "Logging" msgstr "日志" -#: ../../settings.rst:1398 9ddaf0c25b314e609b7de6873b2cfbcf +#: ../../settings.rst:1395 9ddaf0c25b314e609b7de6873b2cfbcf msgid "" "Sometimes, a long list of warnings may appear during site generation. " "Finding the **meaningful** error message in the middle of tons of " @@ -1872,7 +1897,7 @@ msgstr "" "在站点生成过程中有时可能会出现一堆警告信息。在这一大堆日志输出中寻找 **有意义** " "的错误消息是非常棘手的。为了过滤掉多余的日志消息,可以在Pelican中指定 ``LOG_FILTER`` 设置。" -#: ../../settings.rst:1403 4c3ea89d86e846f3b38f146060f19c53 +#: ../../settings.rst:1400 4c3ea89d86e846f3b38f146060f19c53 msgid "" "``LOG_FILTER`` should be a list of tuples ``(level, msg)``, each of them " "being composed of the logging level (up to ``warning``) and the message " @@ -1882,43 +1907,43 @@ msgstr "" "``LOG_FILTER`` 是元组 ``(level, msg)`` ,level指定日志记录等级(最高为 ``warning`` " "),msg指定要忽略的消息。将想要隐藏的日志消息添加到此列表中就可以将他们过滤掉。" -#: ../../settings.rst:1408 ../../settings.rst:1416 +#: ../../settings.rst:1405 ../../settings.rst:1413 #: b62320cd110548f08cdc2b9ff52953d5 msgid "For example::" msgstr "例如:" -#: ../../settings.rst:1413 8a81ee82a14e4571852d1b955568028a +#: ../../settings.rst:1410 8a81ee82a14e4571852d1b955568028a msgid "" "It is possible to filter out messages by a template. Check out source " "code to obtain a template." msgstr "用模板字符串指定要过滤的消息也是可以的。具体的消息种类请查看源码。" -#: ../../settings.rst:1423 880baed291ff4f63836986b7c9082825 +#: ../../settings.rst:1420 880baed291ff4f63836986b7c9082825 msgid "" "Silencing messages by templates is a dangerous feature. It is possible to" " unintentionally filter out multiple message types with the same template" " (including messages from future Pelican versions). Proceed with caution." msgstr "通过模板过滤忽略消息是一个危险的功能。 使用同一模板可能会无意中过滤掉多种消息类型(包括来自新版本Pelican的消息),请谨慎行事。" -#: ../../settings.rst:1429 988048d34b0340beb22f11922ce0959a +#: ../../settings.rst:1426 988048d34b0340beb22f11922ce0959a msgid "This option does nothing if ``--debug`` is passed." msgstr "当使用了 ``--debug`` 参数,此项设置就不会起作用。" -#: ../../settings.rst:1435 e1b3e06d5d29428ba28f2842124a7dcc +#: ../../settings.rst:1432 e1b3e06d5d29428ba28f2842124a7dcc msgid "Reading only modified content" msgstr "只读取修改过的内容" -#: ../../settings.rst:1437 ff9209b75d1645c8b5af8941525fead0 +#: ../../settings.rst:1434 ff9209b75d1645c8b5af8941525fead0 msgid "" "To speed up the build process, Pelican can optionally read only articles " "and pages with modified content." msgstr "为了加速网站构建过程,Pelican能够只读取修改过内容的文章和页面。" -#: ../../settings.rst:1440 5aee5c450b2047bea84e436894c179ef +#: ../../settings.rst:1437 5aee5c450b2047bea84e436894c179ef msgid "When Pelican is about to read some content source file:" msgstr "当Pelican准备读取内容源文件时,会执行下面的规则:" -#: ../../settings.rst:1442 0aca4765447b49308b5a52b22a74d16a +#: ../../settings.rst:1439 0aca4765447b49308b5a52b22a74d16a msgid "" "The hash or modification time information for the file from a previous " "build are loaded from a cache file if ``LOAD_CONTENT_CACHE`` is ``True``." @@ -1929,24 +1954,24 @@ msgstr "" ",则从缓存文件中加载上一次构建时文件的哈希值或修改时间。这些缓存的文件存储在 ``CACHE_PATH`` " "所指定的目录中。若文件是新的,在缓存文件中没有记录,则照常读取。" -#: ../../settings.rst:1446 b8bb9d616a2d41b484ec5440fa09e57a +#: ../../settings.rst:1443 b8bb9d616a2d41b484ec5440fa09e57a msgid "The file is checked according to ``CHECK_MODIFIED_METHOD``:" msgstr "文件会以 ``CHECK_MODIFIED_METHOD`` 设置的方式检查:" -#: ../../settings.rst:1452 fb6105f54c80491c80f99b8b447c5a4b +#: ../../settings.rst:1449 fb6105f54c80491c80f99b8b447c5a4b msgid "" "If set to anything else or the necessary information about the file " "cannot be found in the cache file, the content is read as usual." msgstr "如果设置为其他任何值或在缓存文件中无法找到有关该文件的必要信息,则将照常读取内容。" -#: ../../settings.rst:1455 c46fe5fc65a44157b02b9e26befcefc6 +#: ../../settings.rst:1452 c46fe5fc65a44157b02b9e26befcefc6 msgid "" "If the file is considered unchanged, the content data saved in a previous" " build corresponding to the file is loaded from the cache, and the file " "is not read." msgstr "如果Pelican认为文件没有更改过,会直接从上一次构建的对应文件中加载内容,源文件就不会被读取。" -#: ../../settings.rst:1458 0d597148978d4d228fc55b546d77ba97 +#: ../../settings.rst:1455 0d597148978d4d228fc55b546d77ba97 msgid "" "If the file is considered changed, the file is read and the new " "modification information and the content data are saved to the cache if " @@ -1955,7 +1980,7 @@ msgstr "" "若Pelican认为文件更改过了,则会读取源文件;若 ``CACHE_CONTENT`` 设为了 ``True`` " ",Pelican还会将修改后的信息以及内容数据存入缓存。" -#: ../../settings.rst:1462 e1c91fa9ecf84419a4e34e3fa0951b56 +#: ../../settings.rst:1459 e1c91fa9ecf84419a4e34e3fa0951b56 msgid "" "If ``CONTENT_CACHING_LAYER`` is set to ``'reader'`` (the default), the " "raw content and metadata returned by a reader are cached. If this setting" @@ -1970,7 +1995,7 @@ msgstr "" ",则缓存处理过后的内容对象。缓存已处理的内容对象可能会和插件(因为可能会跳过一些与读取相关的信号)与 ``WITH_FUTURE_DATES`` " "的功能(因为已处理内容对象的 ``draft`` 状态不会改变)冲突。" -#: ../../settings.rst:1470 d46b39637a86497eb38667c8ecf9bf66 +#: ../../settings.rst:1467 d46b39637a86497eb38667c8ecf9bf66 msgid "" "Checking modification times is faster than comparing file hashes, but it " "is not as reliable because ``mtime`` information can be lost, e.g., when " @@ -1982,7 +2007,7 @@ msgstr "" "``rsync`` 命令时没有开启 ``mtime`` 保留模式。(rsync可以通过指定 ``--archive`` 标志启用 " "``mtime`` 保留模式)" -#: ../../settings.rst:1476 3ef54978b60c4fcb9f2b0dc625797b74 +#: ../../settings.rst:1473 3ef54978b60c4fcb9f2b0dc625797b74 msgid "" "The cache files are Python pickles, so they may not be readable by " "different versions of Python as the pickle format often changes. If such " @@ -1994,7 +2019,7 @@ msgstr "" "pickles,因此不同版本的Python由于pickle文件格式变化可能无法读取缓存。如果遇到此类错误,会自动以新格式重新构建缓存。另外,当 " "``GZIP_CACHE`` 设置发生变化后,缓存也会自动重建。" -#: ../../settings.rst:1482 40fb13c9fe444d109c9014ce4f294f92 +#: ../../settings.rst:1479 40fb13c9fe444d109c9014ce4f294f92 msgid "" "The ``--ignore-cache`` command-line option is useful when the whole cache" " needs to be regenerated, such as when making modifications to the " @@ -2007,7 +2032,7 @@ msgstr "" "命令行选项,例如当需要修改会影响缓存内容的设置项时,或是调试时,都可以使用 ``--ignore-cache`` 。若 " "``AUTORELOAD_IGNORE_CACHE`` 设为了 ``True`` ,修改设置文件时会自动忽略缓存。" -#: ../../settings.rst:1488 05ea098bd1b34660878cc598cf9c639c +#: ../../settings.rst:1485 05ea098bd1b34660878cc598cf9c639c msgid "" "Note that even when using cached content, all output is always written, " "so the modification times of the generated ``*.html`` files will always " @@ -2017,7 +2042,7 @@ msgstr "" "需要注意的是,即使使用了缓存的内容,最终的输出文件也始终会进行重新写入,因此生成的 ``*.html`` 文件的修改时间始终会变化。所以,基于 " "``rsync`` 进行上传时,可以考虑使用 ``--checksum`` 选项。" -#: ../../settings.rst:1495 358bf9edd2594e2fa3db87aae3703994 +#: ../../settings.rst:1492 358bf9edd2594e2fa3db87aae3703994 msgid "Example settings" msgstr "配置示例" diff --git a/docs/locale/zh_CN/LC_MESSAGES/sphinx.po b/docs/locale/zh_CN/LC_MESSAGES/sphinx.po index 860cbcb2..320d41f2 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/sphinx.po +++ b/docs/locale/zh_CN/LC_MESSAGES/sphinx.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PELICAN 4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-24 19:06+0800\n" -"PO-Revision-Date: 2024-06-27 19:00+0800\n" +"POT-Creation-Date: 2026-02-02 10:32+0800\n" +"PO-Revision-Date: 2026-02-02 10:32+0800\n" "Last-Translator: GeorgeHu \n" "Language: zh_CN\n" "Language-Team: \n" @@ -16,30 +16,34 @@ msgstr "" "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" +"Generated-By: Babel 2.17.0\n" -#: ../../_templates/page.html:68 697aead398874e06aa15cfd74d134745 +#: ../../_templates/page.html:13 d28434a1f790406f866556f17fe43bea +msgid "Skip to content" +msgstr "" + +#: ../../_templates/page.html:68 11a1e7e70c0542dcb853ce6d667b4b13 msgid "Back to top" msgstr "返回顶部" -#: ../../_templates/page.html:101 f91a64e54aae49c2bd09a944ea693193 +#: ../../_templates/page.html:121 b65dfb48967147f688c1d2166a0d3e60 msgid "Next" msgstr "下一节" -#: ../../_templates/page.html:113 6c3ad069077b4e2cb6e1f77cc2962881 +#: ../../_templates/page.html:133 44ccbbca34f24a5fb1083bcda42d2399 msgid "Previous" msgstr "前一节" -#: ../../_templates/page.html:116 e83e03d0b50c4065a9f87db25a23b3ee +#: ../../_templates/page.html:136 fd17897083a54a929cff164a233bd4d7 msgid "Home" msgstr "首页" -#: ../../_templates/page.html:129 1d0fdb4c0b4e420283101ba5c21ac985 +#: ../../_templates/page.html:149 17589e72a0364f6b8532d40aea593ad7 #, python-format msgid "Copyright © %(copyright)s" msgstr "Copyright © %(copyright)s" -#: ../../_templates/page.html:133 0a35c662e6574da48f7ac5c6b2c82874 +#: ../../_templates/page.html:153 6603e5fc982d4b8b8ba3145dcf098be9 #, python-format msgid "" "Copyright © %(copyright)s, Justin Mayer, Alexis Metaireau, and " "contributors" -#: ../../_templates/page.html:141 07b89372db484251bfcd3b54e0845bf0 +#: ../../_templates/page.html:161 757352d714c74c48ad540604822a210e #, python-format msgid "Last updated on %(last_updated)s" msgstr "最后更新于 %(last_updated)s" -#: ../../_templates/page.html:187 2eb9f1b479a7405290a91d8e1962f265 +#: ../../_templates/page.html:207 6b07f3b7330d47a3976e765b14da9ad1 msgid "On this page" msgstr "本页目录" diff --git a/docs/locale/zh_CN/LC_MESSAGES/tips.po b/docs/locale/zh_CN/LC_MESSAGES/tips.po index a65edf13..2b59a8bd 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/tips.po +++ b/docs/locale/zh_CN/LC_MESSAGES/tips.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PELICAN 4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-07 16:25+0800\n" -"PO-Revision-Date: 2024-06-27 19:00+0800\n" +"POT-Creation-Date: 2026-02-02 10:32+0800\n" +"PO-Revision-Date: 2026-02-02 10:32+0800\n" "Last-Translator: GeorgeHu \n" "Language: zh_CN\n" "Language-Team: zh_CN \n" @@ -16,7 +16,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.16.0\n" +"Generated-By: Babel 2.17.0\n" #: ../../tips.rst:2 9c4618aaecd44b0d93537cb760e227fa msgid "Tips" @@ -26,7 +26,7 @@ msgstr "小技巧" msgid "Here are some tips about Pelican that you might find useful." msgstr "以下是一些实用的小技巧。" -#: ../../tips.rst:7 ../../tips.rst:309 95bea35d0347495bb551fe9486bcd29d +#: ../../tips.rst:7 ../../tips.rst:319 95bea35d0347495bb551fe9486bcd29d #: b64b7ed713b64f588ea7488c6d0b0441 msgid "Custom 404 Pages" msgstr "自定义404页面" @@ -373,11 +373,11 @@ msgstr "" "``\"publishconf.py\"`` 。" #: ../../tips.rst:211 ../../tips.rst:216 ../../tips.rst:223 ../../tips.rst:227 -#: ../../tips.rst:231 ../../tips.rst:237 ../../tips.rst:243 -#: 073e18d8ae29406eb05040d4e3a9ae60 7d43e6cfb091410ebec7464da05b61b4 -#: 8837cc8935f148fb80f05cc5d3d53629 b2da1f7640f948039230cd835c49accd -#: bfe3d052cdc443bb81fed82e77acf3c1 c93816e00a254ef69c69f05833e8762b -#: ee35302c7e034070af1d234ab919c32a +#: ../../tips.rst:231 ../../tips.rst:237 ../../tips.rst:243 ../../tips.rst:249 +#: 073e18d8ae29406eb05040d4e3a9ae60 6932c9139d4f4da7a34601a9d78ee622 +#: 7d43e6cfb091410ebec7464da05b61b4 8837cc8935f148fb80f05cc5d3d53629 +#: b2da1f7640f948039230cd835c49accd bfe3d052cdc443bb81fed82e77acf3c1 +#: c93816e00a254ef69c69f05833e8762b ee35302c7e034070af1d234ab919c32a msgid "string" msgstr "string" @@ -386,11 +386,12 @@ msgid "``requirements``" msgstr "``requirements``" #: ../../tips.rst:216 ../../tips.rst:223 ../../tips.rst:227 ../../tips.rst:231 -#: ../../tips.rst:237 ../../tips.rst:243 ../../tips.rst:249 -#: 197d6ee11fce4a50996a0c458cfdbdad 2086d667b9b1475cb0f002924cdfde12 -#: 25e940621f5b48c9af487d898d7f93cf 5664232c9fdd46c7b8278b8ecef8e3b1 +#: ../../tips.rst:237 ../../tips.rst:243 ../../tips.rst:249 ../../tips.rst:255 +#: ../../tips.rst:261 197d6ee11fce4a50996a0c458cfdbdad +#: 2086d667b9b1475cb0f002924cdfde12 25e940621f5b48c9af487d898d7f93cf +#: 3052432fbf5d420d8f6adbadb908e6f0 5664232c9fdd46c7b8278b8ecef8e3b1 #: 6693126a0da74c61b67e14ca8e535ec3 7f8a93a2048140748fa73537bfae2a54 -#: 85fd40a29f31490bb23b20f05e574aaa +#: 85fd40a29f31490bb23b20f05e574aaa 9d02d6e4689b4b55bdf832e18b0ed4bb msgid "No" msgstr "否" @@ -429,46 +430,60 @@ msgid "" "``\"https://github.com/seanh/sidecar.git\"``" msgstr "要使用的自定义主题的GitHub仓库URL,例如: ``\"https://github.com/seanh/sidecar.git\"``" -#: ../../tips.rst:227 d94f331173334fb2a84b1caadffb72df +#: ../../tips.rst:227 ../../tips.rst:231 919c0e36e8ff40bcbcc4480081b49ce5 +#: d94f331173334fb2a84b1caadffb72df msgid "``\"\"``" msgstr "``\"\"``" -#: ../../tips.rst:231 44ceb2743481486b95c1c739d543f15d +#: ../../tips.rst:231 921a2ae610a84349a5654e204ba6b034 +msgid "``theme-checkout``" +msgstr "``theme-checkout``" + +#: ../../tips.rst:231 7815b328b5f94ca496107881f5bb8aab +msgid "" +"Git ref (branch, tag or commit) of the theme repo to checkout. This can " +"be used to pin the version of your theme. If not specified defaults to " +"the theme repo's default branch." +msgstr "" +"主题仓库要checkout的Git引用 (branch, tag 或 commit)。这可以用于固定主题的版本。若未指定," +"使用仓库的默认branch。" + +#: ../../tips.rst:237 44ceb2743481486b95c1c739d543f15d msgid "``python``" msgstr "``python``" -#: ../../tips.rst:231 4b5cddab44d24c7c8560e16991b784c7 +#: ../../tips.rst:237 4b5cddab44d24c7c8560e16991b784c7 msgid "" "The version of Python to use to build the site, for example: ``\"3.12\"``" " (to use the most recent version of Python 3.12, this is faster) or " "``\"3.12.1\"`` (to use an exact version, slower)" msgstr "构建站点时使用的Python版本,例如: ``\"3.12\"`` 或 ``\"3.12.1\"``" -#: ../../tips.rst:231 919c0e36e8ff40bcbcc4480081b49ce5 +#: ../../tips.rst:237 919c0e36e8ff40bcbcc4480081b49ce5 msgid "``\"3.12\"``" msgstr "``\"3.12\"``" -#: ../../tips.rst:237 842af56c539f4a74a97c7a5b1525eb35 +#: ../../tips.rst:243 842af56c539f4a74a97c7a5b1525eb35 msgid "``siteurl``" msgstr "``siteurl``" -#: ../../tips.rst:237 7fc0777d6e174d6f8d757926a61aa3c8 +#: ../../tips.rst:243 7fc0777d6e174d6f8d757926a61aa3c8 msgid "" "The base URL of your web site (Pelican's ``SITEURL`` setting). If not " "passed this will default to the URL of your GitHub Pages site, which is " "correct in most cases." msgstr "站点的基URL,会用于配置项 ``SITEURL`` 。若未指定,默认值为GitHub Pages站点的URL,这适用于大部分情况。" -#: ../../tips.rst:237 ../../tips.rst:243 082f65333e224d71817b82b1e4f515c4 +#: ../../tips.rst:243 ../../tips.rst:249 082f65333e224d71817b82b1e4f515c4 #: 3d786e828a4745db849bdb8f47738db8 msgid "The URL of your GitHub Pages site." msgstr "GitHub Pages站点的URL" -#: ../../tips.rst:243 e5adb69f985547b7b3cc2bd3f31d4cc3 +#: ../../tips.rst:249 e5adb69f985547b7b3cc2bd3f31d4cc3 msgid "``feed_domain``" msgstr "``feed_domain``" -#: ../../tips.rst:243 c88f037c9f1f4148bef6347228257f7d +#: ../../tips.rst:249 c88f037c9f1f4148bef6347228257f7d msgid "" "The domain to be prepended to feed URLs (Pelican's ``FEED_DOMAIN`` " "setting). If not passed this will default to the URL of your GitHub Pages" @@ -477,72 +492,89 @@ msgstr "" "订阅源URL前要附加的域名,会用于配置项 ``FEED_DOMAIN`` 。若未指定,默认值为GitHub " "Pages站点的URL,这适用于大部分情况。" -#: ../../tips.rst:249 358c5aa434cd4ad09beab02df88413d5 +#: ../../tips.rst:255 358c5aa434cd4ad09beab02df88413d5 msgid "``deploy``" msgstr "``deploy``" -#: ../../tips.rst:249 b8748aeace5a448d9382e225be98f90c +#: ../../tips.rst:255 b8748aeace5a448d9382e225be98f90c msgid "" "This is used to determine whether you will deploy the site or not to " "GitHub Pages. This is most useful if you want to test a change to your " "website in a pull request before deploying those change." msgstr "此项配置用于表示是否要将站点部署至GitHub Pages。当对站点做了更改,并且在正式部署前进行测试,就可以用到此项。" -#: ../../tips.rst:249 034006b9b71b4cb486f230b8aad873ce +#: ../../tips.rst:255 ../../tips.rst:261 034006b9b71b4cb486f230b8aad873ce msgid "bool" msgstr "bool" -#: ../../tips.rst:249 078ac613a8b74703af98c75bb5a007c1 +#: ../../tips.rst:255 078ac613a8b74703af98c75bb5a007c1 msgid "``true``" msgstr "``true``" -#: ../../tips.rst:257 e63cf881e3204be8b52ee5d8635ba4cf +#: ../../tips.rst:261 842af56c539f4a74a97c7a5b1525eb35 +msgid "``stork``" +msgstr "``stork``" + +#: ../../tips.rst:261 b8748aeace5a448d9382e225be98f90c +msgid "" +"This is used to determine whether Stork will be installed on the runner " +"to be able to build a site with Stork search enabled" +msgstr "" +"此配置项用于指定是否要在runner中安装Stork搜索。" + +#: ../../tips.rst:261 358c5aa434cd4ad09beab02df88413d5 +msgid "``false``" +msgstr "``false``" + +#: ../../tips.rst:267 e63cf881e3204be8b52ee5d8635ba4cf msgid "Testing Your Build in a GitHub Pull Request" msgstr "在Github拉取请求时进行测试" -#: ../../tips.rst:259 a2f6bd3420eb46a08f54efda35a6eaf4 +#: ../../tips.rst:269 a2f6bd3420eb46a08f54efda35a6eaf4 msgid "" "If you want to test your build in a pull request before deploying to " "GitHub, your workflow might look something like this:" msgstr "如果想在正式部署到 GitHub 前在PR中进行测试,下面是一个可用的 workflow 示例" -#: ../../tips.rst:288 84393693279741efa82c5ee6b27cbd28 +#: ../../tips.rst:298 84393693279741efa82c5ee6b27cbd28 msgid "" "The ``on`` section of the workflow defines the events that will trigger " "the workflow. In this example, the workflow will run on pushes to the " "main branch, pull requests to the main branch, and manual runs of the " "workflow." -msgstr "工作流的 ``on`` 部分定义了工作流的触发器。在此示例中,工作流将在main分支收到push、有PR提起到主分支以及" -"手动运行工作流时执行。" +msgstr "工作流的 ``on`` 部分定义了工作流的触发器。在此示例中,工作流将在main分支收到push、有PR提起到主分支以及手动运行工作流时执行。" -#: ../../tips.rst:290 cd3c13b2af974a32aa4291d07fc11e9c +#: ../../tips.rst:300 cd3c13b2af974a32aa4291d07fc11e9c msgid "" "``workflow_dispatch`` defines the deploy boolean to be true by default. " "This means that if you run the workflow manually, it will deploy the " "site." msgstr "``workflow_dispatch`` 将 deploy 的默认值设为 true。也就是说当手动运行工作流时,更改的内容就会正式部署。" -#: ../../tips.rst:292 5402cd211d5b4aa8a244c916bb381a5b +#: ../../tips.rst:302 5402cd211d5b4aa8a244c916bb381a5b msgid "" "The ``deploy`` input for the job is using a set of standard GitHub " "workflow variables to control when ``deploy`` will either be true or " "false (you can customize this to your needs)." -msgstr "job中的 ``deploy`` 使用了一些 GitHub workflow 变量来计算 ``deploy`` 值为 true 还是 false(您可以根据需要自定义)。" +msgstr "" +"job中的 ``deploy`` 使用了一些 GitHub workflow 变量来计算 ``deploy`` 值为 true 还是 " +"false(您可以根据需要自定义)。" -#: ../../tips.rst:294 d084908e3a0749f0b802b43626cfe2c4 +#: ../../tips.rst:304 d084908e3a0749f0b802b43626cfe2c4 msgid "" "In this example, the ``deploy`` will be true if the event is a push to " "the main branch (or merging into main from a PR) or a manual run of the " "workflow. If the event is a pull request, the ``deploy`` will be false " "and it will only build an artifact for the site." -msgstr "在此示例中,如果触发事件是推送到主分支(或从 PR 合并到主分支)或手动运行工作流,则 deploy 将为 true;" -"如果触发事件只是Pull Request,则 ``deploy`` 将为 false,并且此时只会为站点构建一个artifact。" +msgstr "" +"在此示例中,如果触发事件是推送到主分支(或从 PR 合并到主分支)或手动运行工作流,则 deploy 将为 true;如果触发事件只是Pull " +"Request,则 ``deploy`` 将为 false,并且此时只会为站点构建一个artifact。" -#: ../../tips.rst:297 85e70fc3faa04208979f7bbe92b025ef +#: ../../tips.rst:307 85e70fc3faa04208979f7bbe92b025ef msgid "\"Insecure content\" warnings from browsers" msgstr "浏览器报“不安全的内容(Insecure content)”警告" -#: ../../tips.rst:299 34f7075cf31f416da2aeb529c616d97d +#: ../../tips.rst:309 34f7075cf31f416da2aeb529c616d97d msgid "" "If your site uses ``https://`` and is broken because the browser is " "blocking network requests (for example for CSS files) due to \"insecure " @@ -553,7 +585,7 @@ msgstr "" "时,可能会损坏,无法正常显示,这是由于浏览器阻拦了一些对“不安全内容”的网络请求。可能的原因之一是GitHub Pages给你的站点生成了 " "``http://`` URL。" -#: ../../tips.rst:303 47271df82577424c8e2c31a9e76a553a +#: ../../tips.rst:313 47271df82577424c8e2c31a9e76a553a msgid "" "To fix this go into your site repo's settings and enable the **Enforce " "HTTPS** setting: go to **Settings → Pages** and check **Enforce HTTPS**. " @@ -564,7 +596,7 @@ msgstr "" "**Enforce HTTPS** ,接着再重新执行工作流以重新部署站点。也可以尝试通过配置 ``siteurl`` 与 " "``feed_domain`` 解决问题。" -#: ../../tips.rst:311 e69189ef4a8440fb8940d8012b4f19d6 +#: ../../tips.rst:321 e69189ef4a8440fb8940d8012b4f19d6 msgid "" "GitHub Pages will display the custom 404 page described above, as noted " "in the relevant `GitHub docs " @@ -573,11 +605,11 @@ msgstr "" "如果按前述进行配置,GitHub Pages是能够正确显示自定义的404页面的,相关内容在 `GitHub的文档中 " "`_ 也有提到。" -#: ../../tips.rst:315 1b8c2457f44a4d61a033363830b8bd90 +#: ../../tips.rst:325 1b8c2457f44a4d61a033363830b8bd90 msgid "Update your site on each commit" msgstr "在每次commit后都更新站点" -#: ../../tips.rst:317 476dbdb670924c02a962e78d6a7854c1 +#: ../../tips.rst:327 476dbdb670924c02a962e78d6a7854c1 msgid "" "To automatically update your Pelican site on each commit, you can create " "a post-commit hook. For example, you can add the following to " @@ -586,11 +618,11 @@ msgstr "" "要想在每次commit后自动更新Pelican站点,你可以创建一个post-commit钩子。例如,可以将下面的内容保存为 " "``.git/hooks/post-commit`` :" -#: ../../tips.rst:324 36dc5f05eaf84573acada36c59d8d2fc +#: ../../tips.rst:334 36dc5f05eaf84573acada36c59d8d2fc msgid "Copy static files to the root of your site" msgstr "将静态文件拷贝到站点根目录" -#: ../../tips.rst:326 4a0722ad68e944ee80e6378259cc1dd6 +#: ../../tips.rst:336 4a0722ad68e944ee80e6378259cc1dd6 msgid "" "To use a `custom domain `_ with GitHub Pages, you need to put the " @@ -605,11 +637,11 @@ msgstr "" ")添加到站点根目录的 ``CNAME`` 文件中。为此,请创建 ``content/extra/`` 目录,并在里面添加一个 ``CNAME`` " "文件。然后使用Pelican的 ``STATIC_PATHS`` 来告诉Pelican将此文件复制到输出目录:" -#: ../../tips.rst:337 8ad906848762400d9e2462034d151a16 +#: ../../tips.rst:347 8ad906848762400d9e2462034d151a16 msgid "Note: use forward slashes, ``/``, even on Windows." msgstr "请注意:务必使用正斜杠 ``/`` ,在Windows上也是。" -#: ../../tips.rst:339 7b109f4944064382babc9158567c8e82 +#: ../../tips.rst:349 7b109f4944064382babc9158567c8e82 msgid "" "You can also use the ``EXTRA_PATH_METADATA`` mechanism to place a " "``favicon.ico`` or ``robots.txt`` at the root of any site." @@ -617,17 +649,17 @@ msgstr "" "利用 ``EXTRA_PATH_METADATA`` 机制,你可以将 ``favicon.ico`` 或 ``robots.txt`` " "也拷贝到站点的根目录下。" -#: ../../tips.rst:343 678eea0644b5400496ad9173d05368d5 +#: ../../tips.rst:353 678eea0644b5400496ad9173d05368d5 msgid "How to add YouTube or Vimeo Videos" msgstr "如何添加YouTube或Vimeo视频" -#: ../../tips.rst:345 ca57b327dd6b432d82cdc91193bde6bb +#: ../../tips.rst:355 ca57b327dd6b432d82cdc91193bde6bb msgid "" "The easiest way is to paste the embed code of the video from these sites " "directly into your source content." msgstr "最简单的方法是将这些网站的视频嵌入代码直接粘贴到您的源内容文件中。" -#: ../../tips.rst:348 0a4f27e2edbe494ab52f73595646986e +#: ../../tips.rst:358 0a4f27e2edbe494ab52f73595646986e msgid "" "Alternatively, you can also use Pelican plugins like ``liquid_tags``, " "``pelican_youtube``, or ``pelican_vimeo`` to embed videos in your " @@ -636,7 +668,7 @@ msgstr "" "或者,您还可以使用例如 ``liquid_tags`` 、``pelican_youtube`` 或 ``pelican_vimeo`` " "等Pelican插件将视频嵌入。" -#: ../../tips.rst:351 e73517b72da347738421784b776b1f1c +#: ../../tips.rst:361 e73517b72da347738421784b776b1f1c msgid "" "Moreover, markup languages like reST and Markdown have plugins that let " "you embed videos in the markup. You can use `reST video directive " @@ -647,31 +679,31 @@ msgstr "" "`_ 或者 `Markdown的mdx_video插件 " "`_ 。" -#: ../../tips.rst:358 b9d27cda716048b2ab7c13646d7faf09 +#: ../../tips.rst:368 b9d27cda716048b2ab7c13646d7faf09 msgid "Develop Locally Using SSL" msgstr "在本地使用SSL进行开发" -#: ../../tips.rst:360 50df9ec072aa47eabbae132fd8f5cb68 +#: ../../tips.rst:370 50df9ec072aa47eabbae132fd8f5cb68 msgid "Here's how you can set up your local pelican server to support SSL." msgstr "以下描述了如何在本地Pelican服务器上配置SSL。" -#: ../../tips.rst:362 9b5045375a874c4d9c29f7109f05c539 +#: ../../tips.rst:372 9b5045375a874c4d9c29f7109f05c539 msgid "" "First, create a self-signed certificate and key using ``openssl`` (this " "creates ``cert.pem`` and ``key.pem``)::" msgstr "首先,通过 ``openssl`` 创建自签名的证书和密钥,这会生成 ``cert.pem`` 和 ``key.pem`` 文件:" -#: ../../tips.rst:366 2f1cfa536fc540f69d671f8a118769d7 +#: ../../tips.rst:376 2f1cfa536fc540f69d671f8a118769d7 msgid "" "And use this command to launch the server (the server starts within your " "``output`` directory)::" msgstr "接着使用下面的命令来开启服务器(此服务器会在 ``output`` 目录下开启):" -#: ../../tips.rst:370 029ea2b0e4fe4b0f814158ae33e3a8ff +#: ../../tips.rst:380 029ea2b0e4fe4b0f814158ae33e3a8ff msgid "If you are using ``develop-server.sh``, add this to the top::" msgstr "如果你使用的是 ``develop-server.sh`` 脚本,在脚本的开头添加:" -#: ../../tips.rst:375 c2784fdd9fdb433799d57f903d0e49d8 +#: ../../tips.rst:385 c2784fdd9fdb433799d57f903d0e49d8 msgid "and modify the ``pelican.server`` line as follows::" msgstr "然后修改按照下述修改 ``pelican.server`` 一行:" From 8b4d7475ea9ee7f998f482ce6fc1f5267e12a73d Mon Sep 17 00:00:00 2001 From: Chris Rose Date: Wed, 31 Dec 2025 08:45:17 -0800 Subject: [PATCH 24/46] dev: Switch from PDM to standard dev-dependencies PDM supports this specification (per https://pdm-project.org/latest/usage/dependency/#add-development-only-dependencies) and this lets other frontends (uv, baby!) make use of the same dependencies. --- pyproject.toml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 09fcbdb6..f6cb125b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,24 +59,7 @@ pelican-plugins = "pelican.plugins._utils:list_plugins" pelican-quickstart = "pelican.tools.pelican_quickstart:main" pelican-themes = "pelican.tools.pelican_themes:main" -[tool.autopub] -project-name = "Pelican" -git-username = "botpub" -git-email = "52496925+botpub@users.noreply.github.com" -changelog-file = "docs/changelog.rst" -changelog-header = "###############" -version-header = "=" - -[tool.pdm] -ignore_package_warnings = ["sphinx"] - -[tool.pdm.scripts] -docbuild = "invoke docbuild" -docserve = "invoke docserve" -lint = "invoke lint" -test = "invoke tests" - -[tool.pdm.dev-dependencies] +[dependency-groups] dev = [ "BeautifulSoup4>=4.13.3", "jinja2>=3.1.2", @@ -100,6 +83,23 @@ dev = [ "tomli>=2.0.1; python_version < \"3.11\"", ] +[tool.autopub] +project-name = "Pelican" +git-username = "botpub" +git-email = "52496925+botpub@users.noreply.github.com" +changelog-file = "docs/changelog.rst" +changelog-header = "###############" +version-header = "=" + +[tool.pdm] +ignore_package_warnings = ["sphinx"] + +[tool.pdm.scripts] +docbuild = "invoke docbuild" +docserve = "invoke docserve" +lint = "invoke lint" +test = "invoke tests" + [tool.pdm.build] source-includes = [ "CONTRIBUTING.rst", From 4444f99c179e44984eef905617e9cfd34b639df0 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Thu, 19 Feb 2026 22:58:11 +0000 Subject: [PATCH 25/46] Don't render 'By' if no authors --- pelican/themes/simple/templates/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pelican/themes/simple/templates/index.html b/pelican/themes/simple/templates/index.html index 97caac6a..5eabc244 100644 --- a/pelican/themes/simple/templates/index.html +++ b/pelican/themes/simple/templates/index.html @@ -11,11 +11,13 @@
{{ article.summary }}

Published:

+ {%- if article.authors %}
By {% for author in article.authors %} {{ author }} {% endfor %}
+ {%- endif %}
{% endfor %} From d9b76ac0e7c348c198d0a1ff00ab467624f812c0 Mon Sep 17 00:00:00 2001 From: nkr <42086312+nkr0@users.noreply.github.com> Date: Tue, 7 Oct 2025 03:06:13 +0200 Subject: [PATCH 26/46] Use a city closer to the equator and that does not use daylight savings in tests --- pelican/tests/test_utils.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 95bf197a..2d370c64 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -64,8 +64,13 @@ class TestUtils(LoggedTestCase): date_hour_z = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11, tzinfo=timezone.utc ) - date_hour_est = utils.SafeDatetime( - year=2012, month=11, day=22, hour=22, minute=11, tzinfo=ZoneInfo("EST") + date_hour_wib = utils.SafeDatetime( + year=2012, + month=11, + day=22, + hour=22, + minute=11, + tzinfo=ZoneInfo("Asia/Jakarta"), ) date_hour_sec = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11, second=10 @@ -79,14 +84,14 @@ class TestUtils(LoggedTestCase): second=10, tzinfo=timezone.utc, ) - date_hour_sec_est = utils.SafeDatetime( + date_hour_sec_wib = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11, second=10, - tzinfo=ZoneInfo("EST"), + tzinfo=ZoneInfo("Asia/Jakarta"), ) date_hour_sec_frac_z = utils.SafeDatetime( year=2012, @@ -108,10 +113,10 @@ class TestUtils(LoggedTestCase): "22.11.2012": date, "22.11.2012 22:11": date_hour, "2012-11-22T22:11Z": date_hour_z, - "2012-11-22T22:11-0500": date_hour_est, + "2012-11-22T22:11+0700": date_hour_wib, "2012-11-22 22:11:10": date_hour_sec, "2012-11-22T22:11:10Z": date_hour_sec_z, - "2012-11-22T22:11:10-0500": date_hour_sec_est, + "2012-11-22T22:11:10+0700": date_hour_sec_wib, "2012-11-22T22:11:10.123Z": date_hour_sec_frac_z, } From e78a555fff7e3474a759fdcf40df6debc1788f62 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 30 Mar 2026 10:59:20 +0200 Subject: [PATCH 27/46] fix: Appease linter --- pelican/themes/simple/templates/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pelican/themes/simple/templates/index.html b/pelican/themes/simple/templates/index.html index 5eabc244..100a7200 100644 --- a/pelican/themes/simple/templates/index.html +++ b/pelican/themes/simple/templates/index.html @@ -12,11 +12,11 @@

Published:

{%- if article.authors %} -
By - {% for author in article.authors %} - {{ author }} - {% endfor %} -
+
By + {% for author in article.authors %} + {{ author }} + {% endfor %} +
{%- endif %}
From c495634138bba98d0e64cfcea0ad7b60ec74dbfe Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 30 Mar 2026 11:03:31 +0200 Subject: [PATCH 28/46] Add `SSH_PORT` to `sftp_upload` in Makefile template --- pelican/tools/templates/Makefile.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/templates/Makefile.jinja2 b/pelican/tools/templates/Makefile.jinja2 index 67571b47..467b1976 100644 --- a/pelican/tools/templates/Makefile.jinja2 +++ b/pelican/tools/templates/Makefile.jinja2 @@ -128,7 +128,7 @@ ssh_upload: publish {% set upload = upload + ["sftp_upload"] %} sftp_upload: publish - printf 'put -r $(OUTPUTDIR)/*' | sftp $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) + printf 'put -r $(OUTPUTDIR)/*' | sftp -P $(SSH_PORT) $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) {% set upload = upload + ["rsync_upload"] %} rsync_upload: publish From 862ac78310d45532f582ee76c2210d26e734e194 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 30 Mar 2026 12:04:55 +0100 Subject: [PATCH 29/46] Add `page_content` block for better template inheritance --- pelican/themes/simple/templates/page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/themes/simple/templates/page.html b/pelican/themes/simple/templates/page.html index 0eefc7e3..4096e7a4 100644 --- a/pelican/themes/simple/templates/page.html +++ b/pelican/themes/simple/templates/page.html @@ -20,7 +20,7 @@ {% import 'translations.html' as translations with context %} {{ translations.translations_for(page) }} - {{ page.content }} + {% block page_content %}{{ page.content }}{% endblock page_content %} {% if page.modified %}