{"id":28828693,"url":"https://github.com/crisfeim/cli-bearpublish","last_synced_at":"2025-07-19T12:34:11.891Z","repository":{"id":297049881,"uuid":"995496564","full_name":"crisfeim/cli-bearpublish","owner":"crisfeim","description":"🛠️ Static site generator for the Bear Notes app.","archived":false,"fork":false,"pushed_at":"2025-06-29T00:46:52.000Z","size":2685,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-29T01:37:47.748Z","etag":null,"topics":["bear-app","bear-cli","bear-frontend","cli","ssg","static-site-generation","static-site-generator","swift"],"latest_commit_sha":null,"homepage":"https://bearpublish.vercel.app","language":"Swift","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/crisfeim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"funding.yml","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,"zenodo":null},"funding":{"github":"crisfeim","buy_me_a_coffee":"crisfeim"}},"created_at":"2025-06-03T15:09:39.000Z","updated_at":"2025-06-29T00:46:55.000Z","dependencies_parsed_at":"2025-06-04T01:22:10.062Z","dependency_job_id":"71affe73-ce22-4416-916d-a86e7649bb46","html_url":"https://github.com/crisfeim/cli-bearpublish","commit_stats":null,"previous_names":["crisfeim/cli-bearpublisher","crisfeim/cli-bearpublish"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crisfeim/cli-bearpublish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-bearpublish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-bearpublish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-bearpublish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-bearpublish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crisfeim","download_url":"https://codeload.github.com/crisfeim/cli-bearpublish/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crisfeim%2Fcli-bearpublish/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265934210,"owners_count":23852089,"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":["bear-app","bear-cli","bear-frontend","cli","ssg","static-site-generation","static-site-generator","swift"],"created_at":"2025-06-19T05:09:09.571Z","updated_at":"2025-07-19T12:34:11.887Z","avatar_url":"https://github.com/crisfeim.png","language":"Swift","funding_links":["https://github.com/sponsors/crisfeim","https://buymeacoffee.com/crisfeim"],"categories":[],"sub_categories":[],"readme":"# 🐻‍❄️ BearPublish\n\n![type: cli-tool](https://img.shields.io/badge/type-cli--tool-blue.svg)\n\n![Icon](img.png)\n\nStatic site generator for Bear Notes.\n\n## Overview\n\n**BearPublish** transforms a Bear Notes database into a static website.\n\n## Project Architecture\n\n### Modules\n\n- `BearDatabase`: SQL logic to extract notes, metadata, tags, and files.\n- `BearMarkdown`: Note content markdown parser with custom bear specific processors (file blocks, wikilinks, hex colors, etc...)\n- `BearWebUI`: Web UI interface made with [Plot](https://github.com/JohnSundell/Plot).\n- `BearDomain`: Intermediary domain objects that mediate between database and ui layers.\n\n### Site Generation\n\n- `BearSiteBuilder`: Builds `BearSite` with the needed data.\n- `BearSiteRenderer`: Builds a `BearSiteRendered` with provided renderers from `BearSite`.\n- `BearSiteGenerator`: Writes `BearSiteRendered`  to disk (output url) and copies provided media files (files \u0026 images folders).\n- `BearPublisher`: Composes the generator with the data passed data providers and needed renderers. \n- `BearPublisherComposer`: Composes the publisher with defaults (data coming from the bear database and ui renders from the ui module)\n- `BearPublisherCLI`: command-line interface using `ArgumentParser` that consumes `BearPublisherComposer`.\n\n## Installation \u0026 Usage\n\nBuild and run the CLI. By default it outputs the site into a `dist` folder:\n\n```\nswift build -c release \\\nswift run\n```\n\nFor custom output and paths, pass arguments:\n\n```bash\nswift build -c release\n.build/release/BearPublishCLI \\\n  --db-path /path/to/database.sqlite \\\n  --files-folder-path /path/to/files \\\n  --images-folder-path /path/to/images \\\n  --output ./dist \\\n  --title \"My Static Site\" \\\n  --lang \"en\"\"\n```\n\n## What I'd Do Differently (and Hope to Add Eventually)\n\n- **Drop HTMX for vanilla JS** – HTMX helped speed up the prototype, but it's overkill for what this project needs. I’m mainly using `hx-get` and `hx-swap`, and the extra attributes feel like baggage.\n- **Better routing** – Currently routes rely on query parameters (e.g., `?slug=note-slug`). I’d prefer cleaner URLs like `bearsit.es/note-slug`.\n\n## Ideas for Future Improvements\n\n- **Bear default's theme selection** – Right now, the only supported theme is Duotone Light (❤️). I’d like to support theme selection via CLI:  \n  `BearPublishCLI (...args...) --theme duotone-light`\n- **Frontend theme switcher** – Ideally, visitors should be able to select themes from the generated site's UI.\n- **Fix UI bug** – There's a minor issue when selecting nested menu items that aren’t expanded yet.\n- **Mac App** – I’d love to build a GUI for non-technical users to publish directly.\n- **Tag-based note export** – Add support for filtering exported notes via tags:  \n  `BearPublishCLI --tags [dev, code, articles]`\n- **Companion app** – A lightweight CLI or GUI focused solely on exporting notes by tag in raw markdown.\n- **Optimize CSS and JS** – These were initially written in 2023 to get a quick prototype running, so some parts may be ~~ugly~~~ repetitive or unoptimized.\n- **Polish frontend and markdown parser** – Still have a lot of rough edges.\n- **Add backlinks support** — As it was done in the original implementation.\n- **Add live server** — As it was done in the original implementation.\n- **Support external themes (frontend)** – Like a proper SSG, this would enable more granular control and flexibility in how content is displayed or customized.\n\n\n## Contributing\n\nThis is a personal open source project. While I’d love to keep improving it, for now I can’t guarantee active maintenance or support for feature requests. That said, improvements may happen as time and energy allow.\n\nFeel free to open issues or pull requests — just know that response times may vary (and sometimes take a while).\n\n## Third party\n\n- [Plot](https://github.com/JohnSundell/Plot)\n- [Markdownkit](https://github.com/objecthub/swift-markdownkit)\n- [SQLite](https://github.com/stephencelis/SQLite.swift)\n- [HTMX](https://github.com/bigskysoftware/htmx)\n- [Hyperscript](https://github.com/bigskysoftware/_hyperscript)\n- [PylonCSS](https://github.com/almonk/pylon)\n\n## Related Projects\n\n- [Bear PHP export script](https://gist.github.com/crisfeim/55e5c005f7e888ee0a380660b2dba8d5) — One of my first attempts of doing something like this.\n- [Bearnotes Hugo theme](https://github.com/crisfeim/theme-hugo-bearnotes) — Basically the grandpa of this project.\n- [Miyano](https://github.com/wuusn/miyano) — An awesome static site generator for Bear notes, built in Ruby by Wuusn. Main inspiration for this project.\n\n## ☕ Buy Me a Coffee\n\nIf you found this project useful and feel like supporting it, you can buy me a coffee — no pressure, but always appreciated!\n\n[Buy me a coffee](https://buymeacoffee.com/crisfeim)\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrisfeim%2Fcli-bearpublish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrisfeim%2Fcli-bearpublish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrisfeim%2Fcli-bearpublish/lists"}