Demo simple static website hosted on Google Drive
How to create simple index site for a Google-Drive folder
See for example demo here: (https://on8ztwzvhh5hoqtfwumxhq-on.drv.tw/Drv2Web/) which is in fact folder “Drv2Web” and subfolders on my google-drive.
This page is created with the help of Markdown see .pet packages to Convert to HTML
Assuming you have a directory tree to share already on disk First create index.html recursively, here are two options: (there are more of course that can be found on the web).
- Perl script:
https://gist.github.com/Zverik/3555260
recursive_index.pl depends on perl module “HTML::Template”, install with PPM: libhtml-template-perl Make the script executable first. Run the script from the top of your shared folder:
./recursive_index.pl -r
(the -r is for recursive)
- Python script:
https://gist.github.com/glowinthedark/b1f5900be2490c5371f827a49fd09f49
generate_directory_index.py
Make the script executable first.
Run the script from the top of your shared folder:
./generate_directory_index.py
(above will include the script on the index, if not desired, see second post for other options)
Ok, now that the html files are created, upload the whole directory tree to your google-drive Or if it’s already on google-drive, just upload the new index.html files in the different directories to google-drive (matching the same directories) The top directory needs to be marked as “shared” otherwise it won’t work.
To demonstrate I use test folder Drv2Web that I have setup on my google drive including the index.html files (created by the python script).
https://on8ztwzvhh5hoqtfwumxhq-on.drv.tw/Drv2Web/
Now, go to https://drv.tw/ (DriveToWeb) NO registration required, and choose Google-drive:
Choose account (if not logged in already, you need to login first):
Give DriveToWeb permission (sorry, it’s in Dutch, “Toestaan” means “Allow”):
Wait a while and your link(s) should show:
If all works well … congratulations !! You now have your website hosted from google-drive FOR FREE ! Smile
Instead of an index website, it’s also possible to host another form of static website. of course, using HTML.