elias-sundqvist / obsidian-static-file-server

Serve obsidian vault subfolders with a static web server
GNU Affero General Public License v3.0
42 stars 6 forks source link

[Question] How could I visit the website like you did in GIF? #3

Closed Quorafind closed 3 years ago

Quorafind commented 3 years ago

Is the www.desmos.com/caculator.html a file in your path? Or I missed something?

elias-sundqvist commented 3 years ago

Yes, I have a single folder which I call "Offline Proxy", and I have put several different folders there, one for each website that I want to access offline. image

I used the Save All Resources chrome extension. to download the website.

If you map the port (say, 1234) directly to the www.desmos.com folder, it should work out of the box. Then you can simply write src="http://localhost:1234/calculator.html" in your iframe tag.

If you want to put websites in subfolders, like I did, it is a bit trickier. Many links will break, and some websites won't work at all. My fix in the case of desmos was to change all absolute links to relative links. (By doing a replace all from ="/ to ="./) in calculator.html

Quorafind commented 3 years ago

Thanks for tons of tips. Maybe you could add this to the README, so that people could understand how you did it.