Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Ability to export static site (html, JS, css) #144

Open
dima-ser opened this issue Feb 10, 2023 · 7 comments
Open

[Feature request] Ability to export static site (html, JS, css) #144

dima-ser opened this issue Feb 10, 2023 · 7 comments

Comments

@dima-ser
Copy link

It would be great to export the entire site as a static site with just HTML, CSS and JS so that it could be uploaded to my own web server and served that way without relying on Topola or any server-side components. Is such a thing possible?

@PeWu
Copy link
Owner

PeWu commented Feb 11, 2023

You can build it on your own and place it on your server. Here are the commands to do it:

git clone https://github.com/PeWu/topola-viewer.git
cd topola-viewer
npm install
npm run build

Now, take the contents of the build/ folder and host it on your own server.

Also, have a look at https://github.com/develancer/topola-webpack It is supposed to create a standalone topola-viewer package bundled together with a GEDCOM file.

@PeWu
Copy link
Owner

PeWu commented Feb 11, 2023

One more, probably the easiest way. Take this zip file, unpack it and upload the contents to your server:
https://github.com/PeWu/topola-viewer/archive/refs/heads/gh-pages.zip

@dima-ser
Copy link
Author

dima-ser commented Feb 11, 2023

One more, probably the easiest way. Take this zip file, unpack it and upload the contents to your server: https://github.com/PeWu/topola-viewer/archive/refs/heads/gh-pages.zip

Thanks, when I do that and load my GED file via URL (hosted on the same domain), I get

Failed to load file
Forbidden

Inspecting requests, it's still trying to go via https://topola-cors-server.up.railway.app. I'd like to avoid dependency on any third party service, so I can host it completely independently.

GET https://topola-cors-server.up.railway.app/https://my.domain.url

returns

Missing required request header. Must specify one of: origin,x-requested-with

Again, my goal is to self-host my tree on my own web server so I can share the URL with my family. I don't want to rely on any third-party service that could go down any time.

@PeWu
Copy link
Owner

PeWu commented Feb 11, 2023

Add &handleCors=false to the URL to avoid using the CORS proxy

@dima-ser
Copy link
Author

Add &handleCors=false to the URL to avoid using the CORS proxy

Thank you, that worked!

Is there a way to hide the top navigation bar? I don't want my family to be able to see all the options, I'm pre-configuring the file URL and all the options in the query string. I may also want to embed it in an iframe, so the navigation bar would be out of place there.

@PeWu
Copy link
Owner

PeWu commented Feb 12, 2023

Add &embedded=true to the URL. This option removes the options to open a different file. It is an option that was intended to be used when Topola Viewer is in an iframe.
There is no option to totally hide the navigation bar. You'd need to go into the code and just remove it there. It's the <TopBar ... /> part of the app.tsx file.

@dima-ser
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants