Skip to content

Commit

Permalink
Move doc pages under /docs/* (#139)
Browse files Browse the repository at this point in the history
* Move doc pages under /docs/*

* Fix workflows
  • Loading branch information
lukechu10 authored Jul 2, 2021
1 parent 1a2dd0e commit 7e67e39
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Build examples
run: |
output="$(pwd)/docs/dist"
mkdir "$output/example"
mkdir "$output/examples"
for path in examples/*; do
if [[ ! -d $path ]]; then
continue
Expand All @@ -59,7 +59,7 @@ jobs:
echo "building: $example"
(
cd "$path"
dist_dir="$output/example/$example"
dist_dir="$output/examples/$example"
mkdir "$dist_dir"
trunk build --release --dist "$dist_dir" --public-url "/example/$example"
)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_website_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Build examples
run: |
output="$(pwd)/docs/dist"
mkdir "$output/example"
mkdir "$output/examples"
for path in examples/*; do
if [[ ! -d $path ]]; then
continue
Expand All @@ -52,7 +52,7 @@ jobs:
echo "building: $example"
(
cd "$path"
dist_dir="$output/example/$example"
dist_dir="$output/examples/$example"
mkdir "$dist_dir"
trunk build --release --dist "$dist_dir" --public-url "/example/$example"
)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn nav() -> Template<G> {
// Links section
div(class="flex flex-row ml-2 space-x-4 text-gray-600") {
a(class="py-2 px-3 text-sm hover:text-gray-800 hover:underline transition",
href="/getting_started/installation",
href="/docs/getting_started/installation",
) {
"Book"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn index() -> Template<G> {
"Fast isomorphic web apps in Rust + WASM"
}
a(
href="/getting_started/installation",
href="/docs/getting_started/installation",
class="py-2 px-3 bg-white hover:bg-yellow-500 border-2 border-yellow-500 \
rounded font-medium transition",
) {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sycamore_router::{BrowserRouter, Route};
enum Routes {
#[to("/")]
Index,
#[to("/<_>/<_>")]
#[to("/docs/<_>/<_>")]
Docs(String, String),
#[not_found]
NotFound,
Expand Down
42 changes: 21 additions & 21 deletions docs/src/sidebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ static PAGES: &[(&str, &[(&str, &str)])] = &[
(
"Getting Started",
&[
("Installation", "/getting_started/installation"),
("Hello World!", "/getting_started/hello_world"),
("Installation", "getting_started/installation"),
("Hello World!", "getting_started/hello_world"),
],
),
(
"Basics",
&[
("template!", "/basics/template"),
("Reactivity", "/basics/reactivity"),
("Components", "/basics/components"),
("Control Flow", "/basics/control_flow"),
("Iteration", "/basics/iteration"),
("Data Binding", "/basics/data_binding"),
("template!", "basics/template"),
("Reactivity", "basics/reactivity"),
("Components", "basics/components"),
("Control Flow", "basics/control_flow"),
("Iteration", "basics/iteration"),
("Data Binding", "basics/data_binding"),
],
),
(
"Advanced Guides",
&[
("NodeRef", "/advanced/noderef"),
("Tweened", "/advanced/tweened"),
("Advanced Reactivity", "/advanced/advanced_reactivity"),
("CSS", "/advanced/css"),
("Testing", "/advanced/testing"),
("Routing", "/advanced/routing"),
("SSR", "/advanced/ssr"),
("JS Interop", "/advanced/js_interop"),
("NodeRef", "advanced/noderef"),
("Tweened", "advanced/tweened"),
("Advanced Reactivity", "advanced/advanced_reactivity"),
("CSS", "advanced/css"),
("Testing", "advanced/testing"),
("Routing", "advanced/routing"),
("SSR", "advanced/ssr"),
("JS Interop", "advanced/js_interop"),
],
),
(
"Optimizations",
&[
("Code Size", "/optimizations/code_size"),
("Speed", "/optimizations/speed"),
("Code Size", "optimizations/code_size"),
("Speed", "optimizations/speed"),
],
),
(
"Contribute",
&[
("Architecture", "/contribute/architecture"),
("Development", "/contribute/development"),
("Architecture", "contribute/architecture"),
("Development", "contribute/development"),
],
),
];
Expand All @@ -60,7 +60,7 @@ pub fn sidebar() -> Template<G> {
template! {
li {
a(
href=page.1,
href=format!("/docs/{}", page.1),
class="pl-4 hover:bg-gray-300 w-full inline-block rounded transition",
) {
(page.0)
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[redirects]]
from = "/*"
from = "/docs/*"
status = 200
to = "/index.html"

Expand Down

0 comments on commit 7e67e39

Please sign in to comment.