{"id":14006909,"url":"https://github.com/yusukebe/r2-blog","last_synced_at":"2025-04-19T09:46:25.027Z","repository":{"id":210183872,"uuid":"725871851","full_name":"yusukebe/r2-blog","owner":"yusukebe","description":"Experimental blogging system using Cloudflare R2","archived":false,"fork":false,"pushed_at":"2023-12-01T12:09:17.000Z","size":8,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-08T17:32:30.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://r2-blog.pages.dev","language":"TypeScript","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/yusukebe.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-01T03:29:16.000Z","updated_at":"2024-02-15T23:04:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce8ecab0-fed9-422e-a2cc-d5809e3ab502","html_url":"https://github.com/yusukebe/r2-blog","commit_stats":null,"previous_names":["yusukebe/r2-blog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fr2-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fr2-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fr2-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fr2-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yusukebe","download_url":"https://codeload.github.com/yusukebe/r2-blog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233562780,"owners_count":18694711,"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":[],"created_at":"2024-08-10T10:01:42.596Z","updated_at":"2025-01-12T03:31:10.359Z","avatar_url":"https://github.com/yusukebe.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# R2 Blog\n\nR2 Blog is an experimental blogging system that uses Cloudflare R2 as its backend file system for storing Markdown files.\n\n## Stack\n\n- Cloudflare Pages\n- Cloudflare R2\n- Hono\n- Vite\n\n## Motivation\n\nFor Cloudflare Workers/Pages SSR, how do you implement your blogging system with contents in Markdown files?\n\nOne option is to bundle them into a single JavaScript file. However, as the content grows, the size of this bundle could become increased.\n\nIn this project, Cloudflare R2 is used as a kind of file system. With the Vite Plugin \"_Local2R2_\", you can manage Markdown files as if they were on a local file system, even though they're stored in local Cloudflare R2.\n\n## Vite Plugin \"Local2R2\"\n\nIn the development phase, you can write your articles in Markdown format, place the files in the `./contents` directory, and they will automatically be added to the local Cloudflare environment. This setup allows you to preview your work with hot-reloading.\n\nTo enable this, the project includes [a Vite plugin called \"_Local2R2_\"](plugins/local2r2.ts). This plugin is designed to watch a specified directory in the config. Whenever a file in this directory is updated, the plugin refreshes and uploads the file to a local R2 storage, which is emulated by Miniflare.\n\n\"_Local2R2_\" might be distributed as an independent package.\n\n## Screen Cast\n\n![screen cast](https://github.com/yusukebe/r2-blog/assets/10682/9f2b1e07-38a0-4ac0-ae5f-b30e543dc361)\n\n## Demo\n\n- \u003chttps://r2-blog.pages.dev/\u003e\n\n## Usage\n\n### Installation\n\n```txt\ngit clone git@github.com:yusukebe/r2-blog.git\ncd r2-blog\nnpm i\n```\n\n### Development\n\n```txt\nnpm run dev\n```\n\n### Deploying\n\n```txt\nnpm run deploy\n```\n\n### Uploading a Markdown file\n\n```txt\nwrangler r2 object put r2-blog/first.md -f ./contents/first.md\n```\n\n## Author\n\nYusuke Wada \u003chttps://github.com/yusukebe\u003e\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukebe%2Fr2-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusukebe%2Fr2-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukebe%2Fr2-blog/lists"}