summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/commands/site/export.py5
-rw-r--r--frontend/site/site/site.actions.js3
-rw-r--r--frontend/site/site/site.reducer.js8
-rw-r--r--frontend/site/viewer/viewer.container.js2
4 files changed, 15 insertions, 3 deletions
diff --git a/cli/commands/site/export.py b/cli/commands/site/export.py
index c8e687a..cf6be7b 100644
--- a/cli/commands/site/export.py
+++ b/cli/commands/site/export.py
@@ -33,7 +33,10 @@ def cli(ctx, opt_graph_path, opt_output_dir):
index_html = load_text(join(app_cfg.DIR_STATIC, 'site.html'), split=False)
write_json(site_data, join(opt_output_dir, graph.path, 'index.json'), default=str)
- write_index(graph, None, index_html, join(opt_output_dir, graph.path, 'index.html'))
+ # write_index(graph, None, index_html, join(opt_output_dir, graph.path, 'index.html'))
+
+ home_page = site_data['graph']['home_page']
+ write_text(f'<meta http-equiv="refresh" content="0; url={home_page}">', join(opt_output_dir, graph.path, 'index.html'))
index_path = ""
for page in graph.pages:
diff --git a/frontend/site/site/site.actions.js b/frontend/site/site/site.actions.js
index 1d92de1..2362e5f 100644
--- a/frontend/site/site/site.actions.js
+++ b/frontend/site/site/site.actions.js
@@ -17,7 +17,8 @@ export const loadSite = (graph_name, path_name) => dispatch => (
// console.log(graph.home_page)
const first_path = ["", graph_name, path_name].join("/")
if (!path_name || !(first_path in graph.pages)) {
- setTimeout(() => history.push(graph.home_page), 10)
+ // console.log(graph.home_page)
+ window.location.href = graph.home_page
}
})
)
diff --git a/frontend/site/site/site.reducer.js b/frontend/site/site/site.reducer.js
index 4975089..f630b9c 100644
--- a/frontend/site/site/site.reducer.js
+++ b/frontend/site/site/site.reducer.js
@@ -23,6 +23,14 @@ export default function siteReducer(state = initialState, action) {
graph: action.data.graph,
}
+ case '@@router/LOCATION_CHANGE':
+ return {
+ ...state,
+ graph: {
+ ...state.graph,
+ }
+ }
+
default:
return state
}
diff --git a/frontend/site/viewer/viewer.container.js b/frontend/site/viewer/viewer.container.js
index e0a0079..68088d2 100644
--- a/frontend/site/viewer/viewer.container.js
+++ b/frontend/site/viewer/viewer.container.js
@@ -21,7 +21,7 @@ class ViewerContainer extends Component {
}
componentDidUpdate(prevProps) {
- console.log('didUpdate', this.props.graph !== prevProps.graph, this.props.location.pathname !== prevProps.location.pathname)
+ // console.log('didUpdate', this.props.graph !== prevProps.graph, this.props.location.pathname !== prevProps.location.pathname)
if (this.props.graph !== prevProps.graph || this.props.location.pathname !== prevProps.location.pathname) {
this.load()
}