You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/perseus/src/export.rs
+20-5
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,15 @@ pub async fn export_app(
65
65
// We need the encoded path to reference flattened build artifacts
66
66
// But we don't create a flattened system with exporting, everything is properly created in a directory structure
67
67
let path_encoded = urlencoding::encode(&path).to_string();
68
+
// All initial load pages should be written into their own folders, which prevents a situation of a template root page outside the directory for the rest of that template's pages (see #73)
69
+
// The `.html` file extension is added when this variable is used (for contrast to the `.json`s)
70
+
let initial_load_path = if path.ends_with("index"){
71
+
// However, if it's already an index page, we dont want `index/index.html`
72
+
path.to_string()
73
+
}else{
74
+
format!("{}/index",&path)
75
+
};
76
+
68
77
// Get the template itself
69
78
let template = templates.get(&template_path);
70
79
let template = match template {
@@ -78,9 +87,13 @@ pub async fn export_app(
78
87
};
79
88
// Create a locale detection file for it if we're using i18n
80
89
// These just send the app shell, which will perform a redirect as necessary
90
+
// TODO put everything inside its own folder for initial loads?
0 commit comments