diff --git a/src/SUMMARY.md b/src/SUMMARY.md index bc05c73..290f9c9 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -33,7 +33,7 @@ ## More -* [CSS](more/css.md) +* [Static Content](more/static.md) * [Roadmap](more/roadmap.md) * [Testing](more/testing.md) * [External Libs](more/external-libs.md) diff --git a/src/more/css.md b/src/more/css.md deleted file mode 100644 index 1f8894d..0000000 --- a/src/more/css.md +++ /dev/null @@ -1,6 +0,0 @@ -# CSS - -<TODO> - -Proposal for proper CSS support can be found here: [https://github.com/yewstack/yew/issues/533](https://github.com/yewstack/yew/issues/533) - diff --git a/src/more/static.md b/src/more/static.md new file mode 100644 index 0000000..388dec8 --- /dev/null +++ b/src/more/static.md @@ -0,0 +1,42 @@ +# Static Content + +Static content in Yew is served from the `static` directory in your crate. For example, if you have a folder structure like: + +``` +myapp +├── src/ +│ └── lib.rs.css +├── static/ +│ └── script.js +├── Cargo.lock +└── Cargo.toml +``` + +## HTML + +Yew compiles to a single-page application, with one JavaScript bundle that can be imported into an HTML page. Yew generates boilerplate HTML page out of the box, but you can create a custom one in `static/index.html` if you wish to override this. + +Your application will be built at `/crate.js`. For example, for your custom HTML page that imports some CSS, you might have: + +```html + + + + + + My Awesome App! + + + + + + + +``` + +## CSS + +A proposal for proper CSS support can be found here: [https://github.com/yewstack/yew/issues/533](https://github.com/yewstack/yew/issues/533). + +For now, you can reference stylesheets be creating a custom `index.html` within the `static` directory. +