{"id":15147174,"url":"https://github.com/yeungkc/hakuba","last_synced_at":"2025-04-05T04:10:22.944Z","repository":{"id":44324466,"uuid":"511854453","full_name":"YeungKC/Hakuba","owner":"YeungKC","description":"A fast blog starter that reads data off GitHub Discussions.","archived":false,"fork":false,"pushed_at":"2025-04-04T21:09:59.000Z","size":2135,"stargazers_count":141,"open_issues_count":25,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T22:42:26.134Z","etag":null,"topics":["blog","discussions","giscus","svelte","tailwindcss"],"latest_commit_sha":null,"homepage":"https://hakuba.yeungkc.com/","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YeungKC.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-08T10:25:55.000Z","updated_at":"2025-02-11T10:45:52.000Z","dependencies_parsed_at":"2024-06-20T20:51:53.812Z","dependency_job_id":"267c1f38-a59f-46df-a38b-a6d59ab850c1","html_url":"https://github.com/YeungKC/Hakuba","commit_stats":{"total_commits":495,"total_committers":3,"mean_commits":165.0,"dds":"0.12323232323232325","last_synced_commit":"dbd256ae08399b1028117c33095331fe003cb057"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YeungKC%2FHakuba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YeungKC%2FHakuba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YeungKC%2FHakuba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YeungKC%2FHakuba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YeungKC","download_url":"https://codeload.github.com/YeungKC/Hakuba/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284949,"owners_count":20913704,"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":["blog","discussions","giscus","svelte","tailwindcss"],"created_at":"2024-09-26T12:23:10.515Z","updated_at":"2025-04-05T04:10:22.906Z","avatar_url":"https://github.com/YeungKC.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Hakuba screenshots](./screenshots.png 'Hakuba screenshots')](https://hakuba.yeungkc.com/)\n\n# Hakuba\n\n[中文版介绍](https://yeungkc.com/post/3)\n\n\u003e Hakuba (白馬村 , Hakuba-mura) is a village located in Nagano Prefecture, Japan.\n\u003e If you enjoy hiking or climbing, skiing or other activities, this would be a great place to go (btw I haven't been there yet...)\n\nA **fast** blog starter that reads data off GitHub Discussions.\n\n\u003e _[See how fast it is in action!!](https://pagespeed.web.dev/report?url=https%3A%2F%2Fhakuba.yeungkc.com%2F)_\n\nPlease star and [fork](https://github.com/YeungKC/Hakuba/fork) if you like it!\n\n## How Does It Work\n\nHakuba fetches the contents on GitHub Discussions with [GitHub GraphQL API](https://docs.github.com/en/graphql) and webhooks.\nThen renders the actual blog pages from them.\n\n## Quick Start\n\nRecommended hosting services:\n\n\u003e The output directory named `build`.\n\n- [Vercel](https://vercel.com/)\n- [Netlify](https://app.netlify.com/)\n- [Cloudflare Pages](https://pages.cloudflare.com/)\n\nDeploy with Vercel:  \n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FYeungKC%2FHakuba\u0026env=GITHUB_TOKEN,REPOSITORY\u0026envDescription=Configure%20token%20and%20repository%20name%2C%20see%20https%3A%2F%2Fgithub.com%2FYeungKC%2FHakuba\u0026project-name=blog\u0026repo-name=blog\u0026demo-title=Hakuba\u0026demo-description=A%20fast%20blog%20starter%20driven%20by%20Github%20discussions%20for%20all%20data.\u0026demo-url=https%3A%2F%2Fhakuba.yeungkc.com%2F\u0026demo-image=https%3A%2F%2Fgithub.com%2FYeungKC%2FHakuba%2Fraw%2Fmaster%2Fscreenshots.png)\n\n... or continue scrolling for guide about [manual deployment](#manual-deployment)\n\n\u003e Hakuba just a blog starter，data and code are completely separated，so you can create a empty repository to write posts and pages discussion， and write a script to clone this repository and build.\n\u003e\n\u003e The advantage of this is that you can easily deploy your blog and don't need to worry about code updates.\n\n### Configuration\n\nThere are various ways to configure it, you can choose to configure it all using environment variables, or partly through discussion.\n\n\u003e If configured blog through discussion, title must be `index`, category must be `CONFIG_CATEGORY`, Here is an [example](https://github.com/YeungKC/Hakuba/discussions/categories/config).\n\n| Name                                               | Description                                                                                                                                       | Required | env | configured through discussion |\n| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --- | ----------------------------- |\n| [GITHUB_TOKEN](https://github.com/settings/tokens) | Require a access token with permissions in the `public_repo` scope for public repositories, or the `repo` scope for private ones.                 | ✅       | ✅  | ❌                            |\n| REPOSITORY                                         | The target repository                                                                                                                             | ✅       | ✅  | ❌                            |\n| CONFIG_CATEGORY                                    | Category name of posts for configuration purposes on GitHub Discussion. `Config` at default.                                                      | ❌       | ✅  | ❌                            |\n| POST_CATEGORY                                      | Category name of actual posts on GitHub Discussion. `Post` at default.                                                                            | ❌       | ✅  | ❌                            |\n| PAGE_CATEGORY                                      | Category name of posts for dedicated pages on GitHub Discussion. `Page` at default.                                                               | ❌       | ✅  | ❌                            |\n| PAGE_SIZE                                          | Number Category name of posts for configuration purposes in GitHub Discussion.kof posts per page, 10 at default.                                  | ❌       | ✅  | ✅                            |\n| BLOG_NAME                                          | Name of the blog, Hakuba fetches it from GitHub profile if left blank.                                                                            | ❌       | ✅  | ✅                            |\n| BIO                                                | Biography of the block, Hakuba fetches it from GitHub profile if left blank.                                                                      | ❌       | ✅  | ✅                            |\n| EMAIL                                              | Email for contact in the about section                                                                                                            | ❌       | ✅  | ✅                            |\n| TWITTER                                            | Twitter handle without the leading `@` (e.g. SvelteJS)                                                                                            | ❌       | ✅  | ✅                            |\n| DOMAIN                                             | Domain of the blog. RSS feed will be disabled if left blank.                                                                                      | ❌       | ✅  | ✅                            |\n| DESCRIPTION                                        | Description of the blog in SEO metadata.                                                                                                          | ❌       | ✅  | ✅                            |\n| KEYWORDS                                           | Keywords for SEO metadata.                                                                                                                        | ❌       | ✅  | ✅                            |\n| COMMENT                                            | Whether to enable comments, `true` at default.                                                                                                    | ❌       | ✅  | ✅                            |\n| LANGUAGE                                           | Language of the block in form of [HTML language code](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). `en` at default. | ❌       | ✅  | ✅                            |\n| TIMEZONE                                           | Timezone of `Date.prototype.toLocaleDateString(locals, options)`, `GMT` at default.                                                               | ❌       | ✅  | ✅                            |\n\n### Setup GitHub Discussions\n\nCreate discussions categories for configurations, posts, and pages. Then Set their format to **Announcement**.\n\n\u003e Hakuba supports mdx and HTML `script` tags for pages and posts, so don't make them public-editable❗❗❗\n\nOnly the page named `index` will be used as the main configuration. Here is an [example](https://github.com/YeungKC/Hakuba/discussions/3).\n\n### Setup Webhooks\n\nIf you deployed Hakuba using [vercel](https://vercel.com/), [netlify](https://app.netlify.com/) or [Cloudflare Pages](https://pages.cloudflare.com/), update of the contents could be automated with webhooks when discussions are modified.\n\n- Create a new Deploy Hook.\n- Go to the repository settings page to set up the webhook. Select Discussion events.\n\n### Manual Deployment\n\nClone the repository with `git`:\n\n```bash\ngit clone git@github.com:YeungKC/Hakuba.git\n```\n\nThen, generate the pages:\n\n```bash\n# Run any one of them\n\nyarn build\nnpm run build\npnpm build\n```\n\nFinally, upload the `build` directory to your web server.\n\n#### Update code\n\nIf you are using a fork or clone, you need to run the following command:\n\n```bash\ngit remote add upstream https://github.com/YeungKC/Hakuba.git\ngit fetch upstream/master\ngit merge upstream/master\ngit push origin master\n```\n\n## Additional Settings for Pages and Posts\n\nPages and posts support Markdown front matter for metadata and configuration overrides.\n\n### Front matter for pages\n\nAdded page will be displayed in navigation.\n\n\u003e If you added page title is `__error`, it will be replaced the error page.\n\nHere is an [example](https://github.com/YeungKC/Hakuba/discussions/58)\n\n| name     | desc                                                        |\n| -------- | ----------------------------------------------------------- |\n| lang     | Language of the post in the form of html language attribute |\n| comment  | Whether to enable comments                                  |\n| priority | Priority for indexing                                       |\n| path     | Path to the page, use all lowercase title by default        |\n| excerpt  | Excerpt of the page for SEO metadata                        |\n\n### Post front matter\n\nHere is an [example](https://github.com/YeungKC/Hakuba/discussions/58)\n\n| name      | desc                                                                                            |\n| --------- | ----------------------------------------------------------------------------------------------- |\n| lang      | Language of the post in the form of html language tag                                           |\n| comment   | Whether to enable comments                                                                      |\n| path      | Path to the post, use discussion number by default                                              |\n| excerpt   | Excerpt of the page for SEO metadata                                                            |\n| title     | Title of the post. Hakuba uses the title of the discussion post at default.                     |\n| published | Date published. Hakuba uses the date of the discussion post at default.                         |\n| updated   | Date updated. Hakuba uses the latest date of modification of the discussion post at default.    |\n| timezone  | Timezone of `Date.prototype.toLocaleDateString(locals, options)`, `config.TIMEZONE` at default. |\n\n#### Limitations\n\nBecause use [Mdsvex](https://mdsvex.com/) to preprocess the markdown, the following limitations apply:\n\n\u003e In markdown you can begin a code block by indenting 4 spaces. This doesn’t work in mdsvex as indentation is common with XML-based languages. Indenting 4 spaces will do nothing.\n\nsee also: \u003chttps://mdsvex.com/docs#limitations\u003e\n\n## Dependabot Auto Merge\n\nThis project uses [action-dependabot-auto-merge](https://github.com/ahmadnassri/action-dependabot-auto-merge#token-scope) for updating dependencies automatically. If there is a CI failure, try to configure Dependabot secrets.\n\n## Migrate\n\nClone this repository, configure `GITHUB_TOKEN` and `REPOSITORY` environment variables, install dependencies with package manager and run:\n\n```bash\n# Run any one of them\n\nnpm run generateData\nyarn generateData\npnpm generateData\n```\n\nThe post path is `src/routes/post/_source/[discussion number].md` and the page path is `src/routes/_page/[title].md`.\n\n## Roadmap\n\n- [ ] Design a logo.\n- [ ] Page transitions.\n- [ ] Pre-download resources.\n- [ ] Lazy load images.\n- [ ] Dark mode.\n\n## Credits\n\n- [hexo-theme-cactus](https://github.com/probberechts/hexo-theme-cactus), I have used this theme for a long time, it has inspired the current theme of Hakuba.\n\n## License\n\nGPL-3.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeungkc%2Fhakuba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeungkc%2Fhakuba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeungkc%2Fhakuba/lists"}