-
Notifications
You must be signed in to change notification settings - Fork 65
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
Export as Static HTML #188
Comments
I have made some progress on this, but it needs more work to get it over the line. I am going to use this issue to write down my findings so far. The steps that I have taken are:
This does a pretty good job of pulling all of the assets, and I can confirm that even Thebe works on the site, so we shouldn't have problems there. There are a few other problems though:
I think that I think that to get this done we:
After those things are done, we can After we download and write the html, the cli copies over all of the files from both the |
Ok, latest release has This ticks off a major feature, and should allow myst sites to be used a bit more widely than just with a I will leave this issue open to document the feature as well as think a bit more about an easy github action (I think we can also do PR preview deployments easily with this...!).
|
I have put the documentation (#383) so far here: Feedback welcome - and other deployment targets! :) |
I'm currently struggling with this. Followed the instructions at https://mystmd.org/guide/deployment and ran
but the resulting Here's a simple page using And the same page rendered as static HTML: I haven't found any documentation about this. Am I missing something obvious? And thanks for this amazing writing tool, I am very excited about the possibilities. |
@brian-rose , how are you opening the files? |
Hi @brian-rose -- as I think @riziles is pointing at, if you double click on the Instead, if you run a local web server in and access the static content that way it should work. e.g.
then open the url is gives you / is serving on. |
I see, thank you! I guess I didn't pay enough attention to the docs. I was just opening Working now. Many thanks for the quick response. |
@brian-rose , for what it's worth, there are tools out there that will do this for you, for example: https://github.com/richardtallent/vite-plugin-singlefile , but serving the files is definitely the better way to go. I just usually use VS Code's "Live Server" plugin. It's got 43 million downloads, so apparently I'm not alone. |
Hi, I have the same problem as @brian-rose. But I want to upload the build html to my own web server. But when I upload the html folder and open the file on the server on my browser, I habe the same output like @brian-rose. What should I upload to get the same output like running it on a npx-server? Kind regards |
@pac84 , could be a path issue. Is |
Hi @pac84 - the https://mystmd.org/guide/deployment If you set that environment variable and then re-run |
Hi, thanks for your reply. It's in a subfolder. |
Hi, thanks for your help! It will be on a "normal" server in a subfolder, like Does the Base URL have to be defined in the "myst.yaml"? Kind regards |
I think this issue should be revisited. Can't we use relative paths (relative to |
This limitation is currently in Remix (we are building a web application, and then making a static html export of it). There is probably something in the configuration that we could do, but in my experimenting I have not found it yet.
@pac84 this is an environment variable in the build, you can run |
Hmm, that happens after The only thing I've found was Migration to next.js or something that has ssg would be difficult I suppose? |
Hi, thanks for the two answers. My actual solution is to use Jupyter Book and export html. This is static code and could directly copied to a server. Kind regards |
Which area is this feature request for?
Website User Interface, Command Line Tools
Describe the feature you'd like to request
Currently the website requires an application server (the theme) to render html, which is done on the fly from a json file + static resources.
The initial pages are server-side-rendered, and can be exported as a static website (e.g. hosted on github pages or sent in a zip file). Twitter thread of the general idea with pointers:
https://twitter.com/mjackson/status/1585795441907494912?t=7VDGKQXUn6nSIqWevT2ZpA&s=19
We may in the future want to look into other html templating solutions to create html assets from the rendered mdast.
Describe the solution you'd like
A static HTML build that I can click on a
.html
file and it works! :)Places to get back to:
The text was updated successfully, but these errors were encountered: