{"id":16690757,"url":"https://github.com/caibingcheng/hugo-algolia2","last_synced_at":"2026-04-29T02:37:21.189Z","repository":{"id":65159188,"uuid":"410429683","full_name":"caibingcheng/hugo-algolia2","owner":"caibingcheng","description":"用于静态网站, 自动构建索引以及推送至algolia","archived":false,"fork":false,"pushed_at":"2021-11-10T12:25:59.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-20T09:03:26.280Z","etag":null,"topics":["algolia","hugo"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caibingcheng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-26T02:29:10.000Z","updated_at":"2022-09-24T04:04:39.000Z","dependencies_parsed_at":"2023-01-05T04:53:19.217Z","dependency_job_id":null,"html_url":"https://github.com/caibingcheng/hugo-algolia2","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caibingcheng%2Fhugo-algolia2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caibingcheng%2Fhugo-algolia2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caibingcheng%2Fhugo-algolia2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caibingcheng%2Fhugo-algolia2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caibingcheng","download_url":"https://codeload.github.com/caibingcheng/hugo-algolia2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243475330,"owners_count":20296714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["algolia","hugo"],"created_at":"2024-10-12T16:05:15.124Z","updated_at":"2025-12-30T03:16:07.799Z","avatar_url":"https://github.com/caibingcheng.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hugo-algolia2\n\n项目改编自[hugo-algolia](https://github.com/replicatedhq/hugo-algolia), 用于hugo静态内容的搜索.\n\n### New Features\n\n- 修复原项目的一些问题\n- 支持自定义URI格式\n- 支持按照文件后缀过滤\n- 去除无用单词\n- 添加中文分词\n\n### Installation\n\n从[npm](https://npmjs.org)安装`hugo-algolia2`\n\n```\nnpm install hugo-algolia2\n```\n\n或者\n\n```\nyarn add hugo-algolia2\n```\n\n### How does it work?\n\n默认遍历hugo项目的`/content`路径下的文件, 并且按照['html','md']后缀过滤, 并且在`/public`下生成`algolia.json`. 具体配置参数可以使用`hugo-algolia2 --help`.\n\n### Sending to Algolia\n\n在hugo项目根目录下添加配置文件`config.yaml`, 如下:\n\n```\n---\nbaseURL: /\nuri: :year:month/:slug\n\nalgolia:\n  index: \"index-name\"\n  key: \"[your API key]\"\n  appID: \"[your app id]\"\n---\n```\n\nURI是访问路径, 需要和hugo的配置相同. key需要填写Admin API Key.\n\n配置之后,\n```\nhugo-algolia2 -s\n```\n可以上传algolia配置.\n\n### Github Action\n```\nname: deploy\non:\n  push:\n  workflow_dispatch:\n\njobs:\n  generate-algolia:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: caibingcheng/hugo-algolia2@v1\n        with:\n          input: \"./posts/**\"\n          output: \"./algolia.json\"\n          index: ${{ secrets.ALGOLIA_INDEX }}\n          apikey: ${{ secrets.ALGOLIA_APIKEY }}\n          appid: ${{ secrets.ALGOLIA_APPID }}\n\n```\n\n# License\n同[hugo-algolia](https://github.com/replicatedhq/hugo-algolia), 本项目也使用ISC License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaibingcheng%2Fhugo-algolia2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaibingcheng%2Fhugo-algolia2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaibingcheng%2Fhugo-algolia2/lists"}