{"id":21515563,"url":"https://github.com/dxrcy/unreact","last_synced_at":"2025-10-07T06:12:38.276Z","repository":{"id":145014396,"uuid":"615677508","full_name":"dxrcy/unreact","owner":"dxrcy","description":"A static site generation framework for Rust using Handlebars and Scss ","archived":false,"fork":false,"pushed_at":"2023-10-17T11:09:24.000Z","size":234,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T08:37:18.089Z","etag":null,"topics":["rust","ssg","web"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/dxrcy.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-03-18T11:02:41.000Z","updated_at":"2023-10-17T11:09:36.000Z","dependencies_parsed_at":"2023-06-30T09:48:31.363Z","dependency_job_id":"34d55ea6-dd91-4839-a143-5bd34b316df1","html_url":"https://github.com/dxrcy/unreact","commit_stats":{"total_commits":114,"total_committers":1,"mean_commits":114.0,"dds":0.0,"last_synced_commit":"b9419163eac747be50eb1bfa4d740c387a44c682"},"previous_names":["dxrcy/unreact","darccyy/unreact"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxrcy%2Funreact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxrcy%2Funreact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxrcy%2Funreact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxrcy%2Funreact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxrcy","download_url":"https://codeload.github.com/dxrcy/unreact/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066190,"owners_count":20392407,"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":["rust","ssg","web"],"created_at":"2024-11-23T23:55:54.421Z","updated_at":"2025-10-07T06:12:33.249Z","avatar_url":"https://github.com/dxrcy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unreact\r\n\r\nA static site generation framework for Rust using Handlebars and Scss.\r\n\r\n\u003e [Ibex](https://github.com/darccyy/ibex) is a much better option that this old project! Please consider!\r\n\r\nSubmit issue [here](https://github.com/darccyy/unreact/issues/new)\r\n\r\n-   [Docs.rs](https://docs.rs/unreact)\r\n-   [Crates.io](https://crates.io/crates/unreact)\r\n\r\n# Usage\r\n\r\nFor a quick start, check out [Unreact Template](https://github.com/darccyy/unreact-template)\r\n\r\nAdd the latest version to your `Cargo.toml` dependencies\r\n\r\n```toml\r\nunreact = \"*\"\r\n```\r\n\r\n## Using `\"dev\"` feature\r\n\r\nFeatures:\r\n\r\n- `unreact/dev` - Creates local dev server to host files.\r\n- `unreact/watch` - Superset of `unreact/dev`. Also listens for file changes and reloads server.\r\n\r\nRun with `--dev` or `-d` arguments, for `unreact::is_dev()` function to return `true`. Only works if `unreact/dev` or `unreact/watch` features are enabled.\r\n\r\n```bash\r\n# Run with `watch` feature, and dev mode\r\ncargo run --features unreact/watch -- --dev\r\n\r\n# Run without `watch` (for a production server)\r\ncargo run\r\n```\r\n\r\n### Hot-reloading in dev mode\r\n\r\nWith the `\"watch\"` feature enabled, the dev server will watch for changes in asset folders (`templates`, `styles`, and `public`; Can be changed with config).\r\nThe client will reload if a change was detected.\r\n\r\n\u003e NOTE: This will NOT reload the client if Rust files (in `src`) were changed! (See below)\r\n\r\n### Watching router in dev mode\r\n\r\nThis will watch file in `src`, and reload the program. The client should automatically try to reconnect.\r\n\r\n```\r\ncargo watch -x \"run --features unreact/watch -- --dev\" -w src -w Cargo.toml\r\n```\r\n\r\n## Small Example\r\n\r\nCreate an site with a single index page\r\n\r\n```rust\r\nuse unreact::prelude::*;\r\n\r\nfn main() -\u003e Result\u003c(), Error\u003e {\r\n   // Create the app\r\n   // Using default config, not in dev mode, and an example url\r\n   let mut app = Unreact::new(Config::default(), false, \"https://example.com\")?;\r\n   // Create an index route\r\n   // This uses the template 'page.hbs' in 'templates/'\r\n   // A json object with a value for 'foo' is passed into the template\r\n   app.index(\"page\", object! { foo: \"World!\" })?;\r\n   // Compile it!\r\n   app.run()\r\n}\r\n```\r\n\r\n## Larger Example\r\n\r\n```rust\r\nuse unreact::prelude::*;\r\n\r\n#[test]\r\nfn large_example() -\u003e Result\u003c(), Error\u003e {\r\n    // Custom config\r\n    let config = Config {\r\n        strict: true,\r\n        ..Config::default()\r\n    };\r\n\r\n    // Run with `is_dev`\r\n    let mut app = Unreact::new(config, is_dev(), \"https://example.com\")?;\r\n\r\n    // Set the global variable 'smiley'\r\n    app.globalize(object! {\r\n        smiley: \"(^_^)\"\r\n    });\r\n\r\n    // Create some routes\r\n    // Note that these methods will never return an error in dev mode. The error will be handled on `app.run()`\r\n    app.index(\"page\", object! {message: \"World!\"})?\r\n        .not_found(\"404\", object! {})?\r\n        .route_raw(\"hello\", \"this is my hello page\".to_string())\r\n        .route(\"article\", \"other/article\", object! {})?;\r\n\r\n    // Compiles normally, or opens a dev server and listens if in dev mode\r\n    app.run()\r\n}\r\n```\r\n\r\n## Automatic Compilation with Github Pages\r\n\r\nIn `.github/workflows/build.yaml`:\r\n\r\n```yaml\r\nname: Build\r\n\r\non:\r\n    # Triggers the workflow on push or pull request events but only for the \"main\" branch\r\n    push:\r\n        branches: [\"main\"]\r\n    pull_request:\r\n        branches: [\"main\"]\r\n\r\njobs:\r\n    build:\r\n        runs-on: ubuntu-latest\r\n\r\n        steps:\r\n            # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it\r\n            - name: Checkout 🛎️\r\n              uses: actions/checkout@v3\r\n\r\n            # Run compilation script with Rust\r\n            - name: Build 🔧\r\n              run: cargo run\r\n\r\n            # Push changes with plugin\r\n            - name: Deploy 🚀\r\n              uses: JamesIves/github-pages-deploy-action@v4\r\n              with:\r\n                  # This must be the build directory\r\n                  folder: ./build\r\n```\r\n\r\n---\r\n\r\n![Unreact Icon](./icon.png)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxrcy%2Funreact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxrcy%2Funreact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxrcy%2Funreact/lists"}