Skip to content

Commit

Permalink
Revert "feat: ✨ added website (#47)"
Browse files Browse the repository at this point in the history
This reverts commit 45a0f6c.
  • Loading branch information
arctic-hen7 authored Oct 4, 2021
1 parent 45a0f6c commit 5932564
Show file tree
Hide file tree
Showing 213 changed files with 1,284 additions and 3,585 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Compile and Deploy Book

on:
push:
paths:
- "docs/**"
- ".github/workflows/book.yml" # If we change this build script, it should rerun
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "latest"
- run: cargo install bonnie
- name: Build book
run: bonnie docs build
- name: Deploy book to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/dist
30 changes: 0 additions & 30 deletions .github/workflows/website.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"examples",
"testing",
"templates",
"exporting",
"website"
"exporting"
]
}
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
members = [
"packages/*",
"examples/*",
"website",
# We have the CLI subcrates as workspace members so we can actively develop on them
# They also can't be a workspace until nested workspaces are supported
"examples/basic/.perseus",
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
[![Top Language](https://img.shields.io/github/languages/top/arctic-hen7/perseus?style=for-the-badge)]()
[![Discord Chat](https://img.shields.io/discord/820400041332179004?label=Discord&style=for-the-badge)](https://discord.gg/PgwPn7dKEk)

> **WARNING:** the book is currently down for maintenance, but itll be back up soon as a fully-fledged website built with Perseus!
Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies, reactivity without a virtual DOM, and extreme customizability. It wraps the lower-level capabilities of [Sycamore](https://github.com/sycamore-rs/sycamore)!

- 📕 Supports static generation (serving only static resources)
Expand Down
27 changes: 0 additions & 27 deletions bonnie.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,6 @@ dev.subcommands.example.cmd = [
dev.subcommands.example.args = [ "example" ]
dev.subcommands.example.desc = "serves the given example using a live version of the cli"

site.subcommands.export.cmd = [
"cd website",
"find . -not -path \"./.perseus/*\" -not -path \"./target/*\" | entr -s \"perseus export\""
]
site.subcommands.export.desc = "exports the site, watching for changes"
site.subcommands.serve.cmd = [
"cd website",
"browser-sync start --server \".perseus/dist/exported\" --files .perseus/dist --no-open --port 8080 --extensions html"
]
site.subcommands.serve.desc = "serves the site's exported content"
site.subcommands.build-tailwind.cmd = [
"cd website",
"tailwindcss -c ./tailwind.config.js -o ./static/tailwind.css"
]
site.subcommands.build-tailwind.desc = "builds a tailwind stylesheet for development (no purging)"
site.subcommands.build-tailwind.subcommands.prod.cmd = [
"cd website",
"NODE_ENV=production npx tailwindcss -c ./tailwind.config.js -o ./static/tailwind.css --minify"
]
site.subcommands.build-tailwind.subcommands.prod.desc = "builds a tailwind stylesheet for production (purging and minifying)"
site.subcommands.deploy.cmd = [
"bonnie site build-tailwind prod",
"cd website",
"perseus deploy -e"
]
site.subcommands.deploy.desc = "builds the website for production and finalizes it at `website/pkg`"

build = "cargo build"

copy-subcrates.cmd = [
Expand Down
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
book
dist
1 change: 1 addition & 0 deletions docs/0.1.x/book.toml
21 changes: 0 additions & 21 deletions docs/0.1.x/en-US/SUMMARY.md

This file was deleted.

23 changes: 23 additions & 0 deletions docs/0.1.x/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Summary

- [Introduction](./intro.md)
- [Setup](./setup.md)
- [Architecture](./arch.md)
- [Building Your First App](./tutorials/first_app/intro.md)
- [Installation and Setup](./tutorials/first_app/setup.md)
- [Writing Your First Template](./tutorials/first_app/template.md)
- [Setting up the App Itself](./tutorials/first_app/app.md)
- [CLI](./cli.md)
- [Templates](./templates.md)
- [Routing](./routing.md)
- [Error Pages](./error_pages.md)
- [Rendering Strategies](./strategies/intro.md)
- [Build Paths](./strategies/build_paths.md)
- [Build State](./strategies/build_state.md)
- [Request State](./strategies/request_state.md)
- [Revalidation](./strategies/revalidation.md)
- [Incremental generation](./strategies/incremental.md)
- [Building](./building.md)
- [Serving](./serving.md)
- [Actix Web Integration](./integrations/actix-web.md)
- [Config Managers](./config_managers.md)
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/0.1.x/en-US/building.md → docs/0.1.x/src/building.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building

_You only need this page if you're not using the Perseus CLI, which performs this process for you!_
*You only need this page if you're not using the Perseus CLI, which performs this process for you!*

After you've defined all your templates and the like, you'll of course need to build them into pages! Perseus tries to make this process as simple as possible.

Expand Down Expand Up @@ -49,4 +49,4 @@ The reason we don't just make this whole function asynchronous is so we don't ha

## File Storage

It may have crossed your mind as to where all these static files are stored in production, and Perseus provides an excellent solution to this problem with custom read/write systems, documented in-depth [here](./config_managers).
It may have crossed your mind as to where all these static files are stored in production, and Perseus provides an excellent solution to this problem with custom read/write systems, documented in-depth [here](./config_managers.md).
6 changes: 3 additions & 3 deletions docs/0.1.x/en-US/cli.md → docs/0.1.x/src/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ define_app!{
}
```

This assumes you've defined a function to get your error pages elsewhere (you can read more about that [here](error_pages)), and that it's in a module called `error_pages`, you can customize that as needed.
This assumes you've defined a function to get your error pages elsewhere (you can read more about that [here](error_pages.md)), and that it's in a module called `error_pages`, you can customize that as needed.

The way the rest of this works is pretty simple. First off, you define a router with [Sycamore](https://sycamore-rs.netlify.app/docs/advanced/routing), which defines each of your templates and the paths on your site that it will accept. This **must** have a variant explicitly named `NotFound`, that's handled for you. Then, you define your app itself, which takes the following properties (which need to be in order right now!):

- `root` – the CSS selector for the element to render Perseus to, which should be unique, like an HTML `id`
- `route` – the `enum` for your app's routes that you just defined
- `router` – a match-like input that handles each of the variants of your `route`, except `NotFound` (handled for you); each one gets mapped to the corresponding page's path (e.g. `Post` with slug `test` might be mapped to `format!("post/{}", slug)`), which shouldn't include a leading or trailing `/`
- `error_pages` – your [error pages](error_pages)
- `error_pages` – your [error pages](error_pages.md)
- `templates` – each of your templates, taking the `G` parameter (which will be used at runtime to render them for the server or the client)
- `config_manager` (optional) – the [config manager](config_manager) your app should use, default is the inbuilt `FsConfigManager::new()`
- `config_manager` (optional) – the [config manager](config_manager.md) your app should use, default is the inbuilt `FsConfigManager::new()`

## Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In development, you'll still need to specify a config manager, which allows you

Any custom config managers have to implement the `ConfigManager` trait, which only has two functions: `read` and `write`. Here's the trait definition:

```rust
```rust,no_run,no_playground
pub trait ConfigManager {
/// Reads data from the named asset.
async fn read(&self, name: &str) -> Result<String>;
Expand All @@ -21,11 +21,11 @@ pub trait ConfigManager {

### Errors

It's easily possible for CDNs of filesystems to throw errors when we try to interact with them, and Perseus provides a custom set of errors with [`error_chain!`]() to deal with this. Note that your implementation _must_ use these, or it will not implement the trait and thus not be compatible with Perseus. The errors available to you are:
It's easily possible for CDNs of filesystems to throw errors when we try to interact with them, and Perseus provides a custom set of errors with [`error_chain!`]() to deal with this. Note that your implementation *must* use these, or it will not implement the trait and thus not be compatible with Perseus. The errors available to you are:

- `NotFound`, takes a `String` asset name
- `ReadFailed`, takes a `String` asset name and a `String` error (not chained because it might come back by carrier pigeon for all we know)
- `WriteFailed`, takes a `String` asset name and a `String` error (not chained because it might come back by carrier pigeon for all we know)
- `NotFound`, takes a `String` asset name
- `ReadFailed`, takes a `String` asset name and a `String` error (not chained because it might come back by carrier pigeon for all we know)
- `WriteFailed`, takes a `String` asset name and a `String` error (not chained because it might come back by carrier pigeon for all we know)

## Best Practices

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ If you're using [Actix Web](https://actix.rs), then Perseus can automate nearly

This integration provides a configuration function, which you can use to configure an existing web server to support Perseus, so you could even run something like [Diana](https://github.com/arctic-hen7/diana) on the same server!

This integration should support almost every use case of Perseus, but there may be some extremely advanced things that you'll need to go back to basics for. If that's the case, please let us know by [opening an issue]() (we want these integrations to be as powerful as possible), and in the meantime you can use the guide [here](./serving) to see how to set up a server without using the integrations. If you need implementation details, check out the actual source code for the integration in the [repository](https://github.com/arctic-hen7/perseus).
This integration should support almost every use case of Perseus, but there may be some extremely advanced things that you'll need to go back to basics for. If that's the case, please let us know by [opening an issue]() (we want these integrations to be as powerful as possible), and in the meantime you can use the guide [here](./serving.md) to see how to set up a server without using the integrations. If you need implementation details, check out the actual source code for the integration in the [repository](https://github.com/arctic-hen7/perseus).

## Installation

Expand Down
Loading

0 comments on commit 5932564

Please sign in to comment.