From b3eb08dfd0d57b5b14dfb6730cb2ffe936bc71a4 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Tue, 17 Jan 2023 23:54:40 +0800 Subject: [PATCH] use link check --- .github/workflows/page.yml | 5 ++--- Difficult_Rocket/utils/translate.py | 1 + docs/book.toml | 12 +++++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/page.yml b/.github/workflows/page.yml index d93784f..d359cf7 100644 --- a/.github/workflows/page.yml +++ b/.github/workflows/page.yml @@ -34,13 +34,12 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v2 - #- name: install mdbook - # uses: extractions/setup-mdbook@v1 + - name: install mdbook + uses: extractions/setup-mdbook@v1 - name: setup、build mdbook shell: pwsh run: | - cargo install mdbook mdbook build ./docs/ - name: Upload artifact diff --git a/Difficult_Rocket/utils/translate.py b/Difficult_Rocket/utils/translate.py index 565417a..df44ae8 100644 --- a/Difficult_Rocket/utils/translate.py +++ b/Difficult_Rocket/utils/translate.py @@ -106,6 +106,7 @@ class Translates: try: cache_value = self.value[item] self.get_list.append((True, item)) + if self.config.always_copy: return self.copy except (KeyError, TypeError, AttributeError) as e: diff --git a/docs/book.toml b/docs/book.toml index 9c1b01e..add0e9e 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -13,7 +13,6 @@ extra-watch-dirs = [] # directories to watch for triggering builds [output.html] input-404 = "404.md" -# cname = 'hws.shenjack.top' # Required: Your repository URL used in the link. git-repository-url = "https://github.com/shenjackyuanjie/Difficult-Rocket" @@ -25,6 +24,15 @@ git-branch = "main" # The link text is marked by `[]` open-on-text = "Found a bug? [Edit this page on GitHub.]" +[output.linkcheck] +# Should we check links on the internet? Enabling this option adds a +# non-negligible performance impact +follow-web-links = false + +# Are we allowed to link to files outside of the book's root directory? This +# may help prevent linking to sensitive files (e.g. "../../../../etc/shadow") +traverse-parent-directories = true + [output.html.search] limit-results = 15 @@ -32,6 +40,8 @@ limit-results = 15 enable = true # include support for printable output page-break = true # insert page-break after each chapter +# [output.pdf] + # [output.copy-resources] # optional = true # command = 'python output.py'