{"id":24506616,"url":"https://github.com/duckduckstudio/sitemap_creator","last_synced_at":"2026-01-16T12:43:25.391Z","repository":{"id":271840309,"uuid":"914725448","full_name":"DuckDuckStudio/Sitemap_Creator","owner":"DuckDuckStudio","description":"GitHub Action 🚀 for creating and updating sitemap in your repository. / 用于在您的仓库中更新网站地图的 GitHub Action 🚀","archived":false,"fork":false,"pushed_at":"2026-01-14T19:38:15.000Z","size":172,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-14T22:46:14.579Z","etag":null,"topics":["github-actions","sitemap","sitemap-builder","sitemap-generator","sitemap-xml","xml"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DuckDuckStudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-10T07:17:31.000Z","updated_at":"2026-01-14T19:32:39.000Z","dependencies_parsed_at":"2025-01-10T08:32:31.801Z","dependency_job_id":"8987ce74-7e73-4974-8181-1074fd0f677c","html_url":"https://github.com/DuckDuckStudio/Sitemap_Creator","commit_stats":null,"previous_names":["duckduckstudio/sitemap_creator"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/DuckDuckStudio/Sitemap_Creator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuckDuckStudio%2FSitemap_Creator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuckDuckStudio%2FSitemap_Creator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuckDuckStudio%2FSitemap_Creator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuckDuckStudio%2FSitemap_Creator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DuckDuckStudio","download_url":"https://codeload.github.com/DuckDuckStudio/Sitemap_Creator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuckDuckStudio%2FSitemap_Creator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","sitemap","sitemap-builder","sitemap-generator","sitemap-xml","xml"],"created_at":"2025-01-21T23:38:54.181Z","updated_at":"2026-01-16T12:43:25.377Z","avatar_url":"https://github.com/DuckDuckStudio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sitemap Creator\n用 GitHub Action 🚀 在你的仓库中创建和更新网站地图。  \n\n[![GitHub Release](https://img.shields.io/github/release/DuckDuckStudio/Sitemap_Creator?style=flat)](https://github.com/DuckDuckStudio/Sitemap_Creator/releases/latest)  \n[反馈Bug🐛](https://github.com/DuckDuckStudio/Sitemap_Creator/issues) | [使用示例🚀](#6-使用示例)  \n\n## 为什么选择 Sitemap Creator 🏆\n| | Sitemap | Creator |  |\n|-----|-----|----|----|\n| 无需本地操作 | ✅ | 稳定更新 | ✅ |\n| 完全免费 | ✅ | 修改时区\u003csup\u003e[5](#5-设置时区)\u003c/sup\u003e | ✅ |\n| 指定更新/创建方式 | ✅ | 不遗漏页面 | ✅ |\n| 忽略页面 | ✅ | 指定网站地图存放位置 | ✅ |\n| 指定页面文件类型 | ✅ | 中文文档+输出 | ✅ |\n| 更多 | 优点 | ... | ✅ |\n\n## 可用参数\n\n\u003e [!TIP]\n\u003e 所有参数名使用单数形式  \n\n| 参数 | 描述 | 默认值 | 是否必须 | 备注 |\n|-----|-----|-----|-----|-----|\n| `location` | 网站地图的存放位置 (例如 `docs/sitemap.xml`) | `./sitemap.xml` (即仓库根目录) | 否 | / |\n| `token` | 用于创建更新网站地图的拉取请求的 Token | `${{ github.token }}` | 否 | 您的 Token 至少应该具有 `repo` 权限来推送修改，如果使用默认的 Action Token 则需要在仓库设置中给 GitHub Action 写入权限\u003csup\u003e[1](#1-如何允许-github-action-创建拉取请求--推送修改)\u003c/sup\u003e |\n| `timezone` | 设置生成时使用的时区 | `Asia/Shanghai` (上海，UTC+8，CST，Ubuntu/Macos格式) | 否 | 请依据您的 Runner 设置该参数\u003csup\u003e[5](#5-设置时区)\u003c/sup\u003e |\n| `basic_link` | 指向你网站的基础链接 | `https://${{ github.event.repository.owner.login }}.github.io/${{ github.event.repository.name }}` | 否 | / |\n| `file_type` | 网页文件的类型 (例如使用 docsify 部署的就是 md，可指定多个类型) | `html,md` | 否 | 不带`.`，`md`类型会自动去掉后缀名 |\n| `ignore_file` | 指定哪些文件不包含在网站地图中 | `啥都没有` | 否 | `,`间隔 |\n| `website_path` | 你的网站内容的位置 (例如 `./` (根目录) 或 `docs`) | `./` (根目录) | **是** | / |\n| `base_branch` | 仓库主分支 (`main`，`master` 等) | `main` | 否 | / |\n| `label` | 创建拉取请求时添加的标签 | / | 否 | 会自动移除`'`、`\"`、\u003ccode\u003e\\`\u003c/code\u003e，可以设置`debug: true`来查看运行情况，标签间用`,`分隔 |\n| `reviewer` | 创建拉取请求时指定的审查者 | / | 否 | 会自动鉴权，如果指定的审查者不是仓库的协作者则无法添加 |\n| `author_name` | 更新提交的撰写者名 | `github-actions[bot]` | 否 | 这里指定的是提交的撰写者的名称，不是拉取请求的创建者的名称。拉取请求的创建者为 Token 所有者 |\n| `author_email` | 更新提交的撰写者邮箱 | `41898282+github-actions[bot]@users.noreply.github.com` (不知道从哪找来的 GitHub Action [bot] 的邮箱) | 否 | 这里指定的是提交的撰写者的邮箱，不是拉取请求的创建者的邮箱。拉取请求的创建者为 Token 所有者 |\n| `auto_merge` | 启用自动合并的方式 (不指定则不启用自动合并) | / | 否 | [可用的自动合并方式](#3-可用的自动合并方式)，[什么是自动合并](https://docs.github.com/zh/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request) |\n| `update` | 指定更新网站地图的方式 (直接提交或拉取请求) | `拉取请求` | 否 | [可用的参数值](#4-可用的修改网站地图的方式) |\n| `debug` | 控制调试输出的开关 | `false` | 否 | 你用`true`还是`1`随便，js里真值\u003csup\u003e[2](#2-java-script-中有哪些可用真值)\u003c/sup\u003e的都行 |\n\n## 帮助\n### 1. 如何允许 GitHub Action 创建拉取请求 / 推送修改\n打开仓库 Settings (上方栏) \u003e Code and automation (左侧栏) \u003e Actions (左侧栏子类别) \u003e General (子类别) \u003e Workflow permissions (划到最下面):  \n\n![记得按 Save 保存](docs/imgs/README/1.png)  \n\n如果你希望进行更精细的访问控制，你可以在你的工作流中添加以下内容:  \n```yml\n# 相关文档: https://docs.github.com/zh/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token\npermissions:\n  contents: write # 允许修改仓库内容，例如提交、发行版等\n  pull-requests: write # 允许创建和修改 PR，如果您使用更新方式“提交”可以不给这个权限\n```\n(如果需要拉取请求的话**设置中用于创建拉取请求的那个权限还是要勾下**)  \n\n### 2. Java Script 中有哪些可用真值\n请见[真值 - MDN Web 文档术语表：Web 相关术语的定义 | MDN](https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy)。  \n\n### 3. 可用的自动合并方式\n处理时会自动去除`'`、`\"`、\u003ccode\u003e\\`\u003c/code\u003e、`-`。  \n| 接收的输入 (去除特殊字符后) | 自动合并方式 |\n|-----|-----|\n| `s`、`squash`、`压缩`、`压缩合并`、`压缩自动合并` | [压缩合并](https://docs.github.com/zh/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits) |\n| `m`、`merge`、`合并`、`合并提交`、`提交` | [合并提交](https://docs.github.com/zh/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#merge-your-commits) |\n| `r`、`rebase`、`变基`、`变基合并`、`变基自动合并` | [变基合并](https://docs.github.com/zh/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#rebase-and-merge-your-commits) |\n| 空字符串 | 不启用自动合并 |\n| 其他任意值 | 视作错误返回 `1` |\n\n### 4. 可用的修改网站地图的方式\n处理时会自动去除`'`、`\"`、\u003ccode\u003e\\`\u003c/code\u003e、`-`、` `。  \n| 接收的输入 (去除特殊字符后) | 修改方式 |\n|-----|-----|\n| `pr`、`pullrequest`、`pullrequests`、`prs`、`拉取请求` | 创建拉取请求 (默认) |\n| `commit`、`提交`、`直接提交`、`directcommit`、`commitdirectly` | 直接提交到主分支 |\n\n### 5. 设置时区\n请按照您的工作流使用的 Runner 来设置时区。  \n#### 查看可用时区\n| Runner OS | 查看方式 | 是否支持默认时区 |\n|-----|-----|-----|\n| Windows | `TZUTIL /l` | ✅ |\n| Linux | `timedatectl list-timezones` | ✅ |\n| MacOS | `systemsetup -gettimezone` | ✅ |\n\n\u003e 注: 在 Windows Runner 上，默认的 `Asia/Shanghai` (亚洲/上海) 会被转为 `China Standard Time` (中国标准时间 CST) 。\n\n### 6. 使用示例\n```yml\nname: 生成 Sitemap\n\n# GitHub Action DuckDuckStudio/Sitemap_Creator 示例工作流\n# https://github.com/marketplace/actions/sitemap-creator-stable\n# Under the [GNU Affero General Public License v3.0](https://github.com/DuckDuckStudio/Sitemap_Creator/blob/main/LICENSE)\n\non:\n  push:\n    branches:\n      - main\n      # 当 main 分支上有新推送且以下文件被更改时\n    paths:\n      - '**/*.html'\n      - '**/*.md'\n  workflow_dispatch: # 手动运行\n\njobs:\n  generate_sitemap:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: 更新网站地图\n        uses: DuckDuckStudio/Sitemap_Creator@1.0.12\n        with:\n          location: \"docs/sitemap.xml\"\n          basic_link: \"https://duckduckstudio.github.io/Articles/#\"\n          ignore_file: \"_Footer.md,404.html,某鸭的文章页面模板.html,营销号\"\n          website_path: \"docs\"\n          labels: \"DEV-已启用自动合并,工作流,DEV-开发分支合并\"\n          auto_merge: \"压缩合并\"\n          debug: true # 启用调试输出\n          # 其他参数默认\n          # base_branch: \"main\"\n          # file_type: \"html,md\"\n          # token: ${{ github.token }}\n          # timezone: \"Asia/Shanghai\"\n          # update: \"拉取请求\"\n          # author_name: \"github-actions[bot]\"\n          # author_email: \"41898282+github-actions[bot]@users.noreply.github.com\"\n```\n\n## 星星 🌟\n如果您认为本项目对您有帮助，还请给本项目一个小小的 Star 。  \n[![星标历史](https://api.star-history.com/svg?repos=DuckDuckStudio/Sitemap_Creator\u0026type=Date)](https://star-history.com/#DuckDuckStudio/Sitemap_Creator\u0026Date)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduckduckstudio%2Fsitemap_creator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduckduckstudio%2Fsitemap_creator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduckduckstudio%2Fsitemap_creator/lists"}