PeWu / topola-viewer

Topola Genealogy Viewer – interactive genealogy visualization
https://pewu.github.io/topola-viewer
Apache License 2.0
196 stars 49 forks source link

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

Open dima-ser opened 1 year ago

dima-ser commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

dima-ser commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Thank you!