File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858 # relatively as favicon.ico. if we skip public-url option, the href
5959 # paths will instead request username.github.io/favicon.ico which will
6060 # obviously return error 404 not found.
61- run : ./trunk build --release --public-url "/"
61+ run : ./trunk build --release
6262
6363
6464 # Deploy to gh-pages branch
Original file line number Diff line number Diff line change 77 < link data-trunk rel ="tailwind-css " href ="/style/tailwind.css " />
88 < link data-trunk rel ="rust " data-wasm-opt ="z " data-weak-refs />
99 < link data-trunk rel ="copy-dir " href ="/public/images "/>
10- < link data-trunk rel ="copy-file " href ="public/404.html " />
10+ < link data-trunk rel ="copy-file " href ="public/404.html " />
1111 < link rel ="icon " href ="images/odpicon.ico " type ="image/x-icon ">
1212 < link href ="https://fonts.googleapis.com/css2?family=Geist:wght@400;600&display=swap " rel ="stylesheet ">
1313 </ head >
Original file line number Diff line number Diff line change @@ -2,11 +2,18 @@ use leptos::prelude::*;
22use odp:: App ;
33
44fn main ( ) {
5- // GitHub Pages SPA redirect support: handle ?p= route param
5+ // GitHub Pages SPA redirect support: handle ?p= or ?redirect= route param
66 if let Some ( window) = web_sys:: window ( ) {
7- if let Ok ( location) = window. location ( ) . search ( ) {
8- if let Some ( idx) = location. find ( "?p=" ) {
9- let encoded = & location[ idx + 3 ..] ;
7+ if let Ok ( search) = window. location ( ) . search ( ) {
8+ let ( param, offset) = if let Some ( idx) = search. find ( "?p=" ) {
9+ ( "?p=" , idx + 3 )
10+ } else if let Some ( idx) = search. find ( "?redirect=" ) {
11+ ( "?redirect=" , idx + 10 )
12+ } else {
13+ ( "" , 0 )
14+ } ;
15+ if !param. is_empty ( ) && offset < search. len ( ) {
16+ let encoded = & search[ offset..] ;
1017 if let Ok ( path) = urlencoding:: decode ( encoded) {
1118 let history = window. history ( ) . unwrap ( ) ;
1219 history
You can’t perform that action at this time.
0 commit comments