{"id":29154058,"url":"https://github.com/geneasy/links","last_synced_at":"2025-08-16T18:08:44.363Z","repository":{"id":44465288,"uuid":"410173728","full_name":"geneasy/links","owner":"geneasy","description":"友情链接模板 - 这是一个通用的友情链接模板，任何类型的网站都可以拿去使用。此友情链接页面是使用 GenEasy 文档生成工具 + WebStack 模板创建的静态页面，托管在 GitHub Pages 服务器上面。例子: https://discuss-cn.pipecraft.net/links/","archived":false,"fork":false,"pushed_at":"2023-02-10T11:12:54.000Z","size":19,"stargazers_count":30,"open_issues_count":7,"forks_count":30,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-01T02:04:25.542Z","etag":null,"topics":["friends-links","friendship-links","geneasy","links","ssg","templates","webstack"],"latest_commit_sha":null,"homepage":"https://geneasy.github.io/links/","language":"Handlebars","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geneasy.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":null,"security":null,"support":null}},"created_at":"2021-09-25T04:21:14.000Z","updated_at":"2025-06-09T15:24:51.000Z","dependencies_parsed_at":"2022-07-12T18:21:13.910Z","dependency_job_id":null,"html_url":"https://github.com/geneasy/links","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/geneasy/links","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geneasy%2Flinks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geneasy%2Flinks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geneasy%2Flinks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geneasy%2Flinks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geneasy","download_url":"https://codeload.github.com/geneasy/links/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geneasy%2Flinks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270749201,"owners_count":24638675,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["friends-links","friendship-links","geneasy","links","ssg","templates","webstack"],"created_at":"2025-07-01T02:04:27.087Z","updated_at":"2025-08-16T18:08:44.340Z","avatar_url":"https://github.com/geneasy.png","language":"Handlebars","readme":"# 友情链接（静态页面通用模板）\n\n\u003chttps://geneasy.github.io/links/\u003e\n\n这是一个通用的友情链接模板，任何类型的网站都可以拿去使用。\n\n此友情链接页面是使用 [GenEasy](https://github.com/geneasy/geneasy) 文档生成工具 + [WebStack](https://github.com/WebStackPage/WebStackPage.github.io) 模板创建的静态页面，托管在 GitHub Pages 服务器上面。\n\n当修改 `links.yml` 文件里的内容时，**GitHub Actions** 会自动更新 HTML 文件。不需要服务器，不需要数据库。\n\n## 如何在我的网站里加入这个友情链接页面？\n\n第一步：fork 这个项目 (注意: [gh-pages 分支一起复制](https://github.com/geneasy/links/issues/5))\n\n第二步：进入 Settings \u003e Pages, 启用 GitHub Pages 功能。分支选择 `gh-pages`。\n\n第三步：2 分钟后，访问你的 GitHub Pages 域名，看看是否正常显示。`https://你的用户名.github.io/links/` 或 `https://你的用户名.github.io/links/index.html`\n\n第四步：进入 Actions，启用 Actions 功能，进入 Settings，启用 Issues 功能。\n\n第五步：\n\n5.1 如果你的网站是托管在 GitHub Pages 上面，配置已经结束\n\n5.2 如果你的网站部署在自己的服务器，需要添加一段 proxy 代码。\n\n以下是 nginx 代码示例\n\n```nginx\nlocation /links/ {\n    proxy_pass      https://你的用户名.github.io/links/;\n    proxy_intercept_errors on;\n\n    # allow GitHub to pass caching headers instead of using our own\n    expires off;\n    proxy_set_header   Host                   你的用户名.github.io;\n    proxy_set_header   X-Host                 你的用户名.github.io;\n}\n```\n\n5.3 如果你的网站部署在自己的服务器，不能（会）配置 proxy，你可以添加一个把生成的 HTML rsync 到你的服务器的 GitHub Action。\n\n- [Burnett01/rsync-deployments](https://github.com/Burnett01/rsync-deployments)\n\n```yml\nname: Build and Deploy\non:\n  push:\n    branches:\n      - gh-pages\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - name: rsync deployments\n        uses: burnett01/rsync-deployments@5.1\n        with:\n          switches: -avzr --delete\n          path: ./\n          remote_path: /var/www/html/links/\n          remote_host: example.com\n          remote_user: debian\n          remote_key: ${{ secrets.DEPLOY_KEY }}\n```\n\n5.4 如果你的网站是托管在 Vercel, Netlify 等静态页面托管平台，需要添加部署到这些平台的 GitHub Action。(与 5.3 类似)\n\n```yml\nname: Build and Deploy\non:\n  push:\n    branches:\n      - gh-pages\njobs: ...\n```\n\n第六步：访问你的网站，确认是否成功。`https://你的域名/links/`\n\n第七步：在首页或所有页面的底部或导航位置加上这个友情链接页面的链接。\n\n## Tips\n\n### Tip: 如何修改 `links.yml`\n\n#### 方法 1\n\n把项目下载到本地，修改提交。\n\n#### 方法 2\n\n把现在 GitHub repository 的 URL 里的 `github.com` 改成 `github.dev`，会进入 web 版的 VS Code。在 web 版的 VS Code 里修改提交。\n\n#### 方法 3\n\n在 GitHub 点击 [`links.yml`](links.yml) 文件，然后点击编辑按钮。修改提交。\n\n### Tip: 如何在本地修改数据，查看效果\n\n1. clone repository 到本地\n\n```sh\ngit clone https://github.com/geneasy/links.git\n```\n\n2. 安装 `geneasy`\n\n```sh\nnpm i -g geneasy\n```\n\n3. 执行下面命令生成 `index.html`\n\n```sh\ngeneasy -t index.hbs -o public/index.html links.yml\n```\n\n`index.html` 生成在 `public` 目录下，确认生成的内容。\n\n\u003e [更多 `geneasy` 使用方法看官网](https://github.com/geneasy/geneasy)\n\n4. 启动 web 服务器，确认效果。\n\n可以使用 `http-server` 轻松完成。\n\n```sh\nnpx http-server\n```\n\n或者安装后执行\n\n```sh\nnpm i -g http-server\nhttp-server\n```\n\n访问 `http://127.0.0.1:8080` (端口看终端日志输出内容) 可以确认效果。\n\n\u003e [更多 `http-server` 使用方法看官网](https://github.com/http-party/http-server)\n\n### Tip: 可不可以不使用 GitHub 管理数据，不使用 GitHub Action 生成 HTML 和发布？\n\n可以。\n\n首先，把这个 repository clone 到你的电脑或服务器里，修改 links.yml 里的数据。\n\n然后参考上面本地修改数据，查看效果的方法，生成 HTML，放到服务器指定文件夹里。\n\n```sh\ngit clone https://github.com/geneasy/links.git\nnpm i -g geneasy\ngeneasy -t index.hbs -o /path/to/links/index.html links.yml\n```\n\n### Tip: 友情链接的 URL 可以不用 `links`，用别的吗？\n\n可以，\n\n如果是网站部署在 GitHub Pages, 修改 GitHub repository 的名字。\n\n如果是自己的服务器，修改 proxy 配置的 `location`。\n\n```nginx\nlocation /friends-links/ {\n    proxy_pass      https://你的用户名.github.io/links/;\n    proxy_intercept_errors on;\n\n    # allow GitHub to pass caching headers instead of using our own\n    expires off;\n    proxy_set_header   Host                   你的用户名.github.io;\n    proxy_set_header   X-Host                 你的用户名.github.io;\n}\n```\n\n### Tip: 有其他模板或样式吗？\n\n后续会添加，也非常欢迎你来贡献。\n\n## 需要帮助？\n\n如果遇到问题，需要帮助，请添加 [issue](https://github.com/geneasy/links/issues)。\n\n## Related\n\n- [geneasy](https://github.com/geneasy/geneasy) - A command line tool that can easily generate HTML, Markdown documents, etc.\n- [geneasy-nav](https://github.com/geneasy/nav) - 网址导航模板 - 这是一个通用的网址导航模板，任何类型的网站都可以拿去使用。\n- [webstack](https://github.com/WebStackPage/WebStackPage.github.io) - ❤️ 静态响应式网址导航网站 - webstack.cc\n\n## License\n\nCopyright (c) 2021 [Pipecraft][my-url]. Licensed under the [MIT license][license-url].\n\n## \u003e\\_\n\n[![Pipecraft](https://img.shields.io/badge/site-pipecraft-brightgreen)](https://www.pipecraft.net)\n[![DTO](https://img.shields.io/badge/site-DTO-brightgreen)](https://dto.pipecraft.net)\n[![BestXTools](https://img.shields.io/badge/site-bestxtools-brightgreen)](https://www.bestxtools.com)\n\n[my-url]: https://www.pipecraft.net\n[license-url]: LICENSE\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneasy%2Flinks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneasy%2Flinks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneasy%2Flinks/lists"}