@AlanG Thanks for the fix and additions … slick script. I’m using it to publish to local LAMP server which is served to the PUBLIC internet via LocalXpose. The only real downside thus far is the size of the CSS file. ~6.5M for “Minimal” theme.
Agreed. This was the one thing I couldn’t decide on. Some of the theme CSS files are completely blown out by including the fonts encoded inside the files themselves. So on the one hand it’s really nice to have your shared links looking exactly as you’d expect them, but on the other hand it’s completely ridiculous depending on the theme. The default theme is 280kb.
On the sharing side, I separate it out to its own CSS file so that you get a benefit of caching with multiple shared files. I might see if I can stripe out the encoded fonts. I hadn’t realised any themes were as big as 6.5MB, so that gives me a good reason to check into that.
Those issues have been fixed, and I have great news!
The script will now remove any embedded fonts, and upload them as separate files which are then linked back into the theme CSS. I have tested this with Minimal at my end, which is now showing 690kb for the CSS.
If the file has already been shared, it won’t compute and upload the CSS.
If you want to force a re-upload of your CSS, just remove the share_link property from your frontmatter and share the file.
I have removed the previous UPLOAD_CSS config option. If you’re using my example PHP upload script, you will need to update the whitelist to allow for font files to be uploaded:
Thank you for sharing this! I finally made it work with HostDrive and DirectAdmin!
There is one thing that I did not figure out how to fix, though. For the links generated for me, it is in the format of https://obsidianshare.com/file/572e1ae4a0aeadf5943862d1deaf8fe6.html rathar than https://file.obsidianshare.com/572e1ae4a0aeadf5943862d1deaf8fe6.html. Still, I can access this file with both links.
I tried to create a subdomain and put everything within that directly, but it says that the file is not permitted to be accessed.
Thanks! It works now. Previously I tried to upload to file.obsidianshare.com but the notes cannot be uploaded successfully, probably because I misconfigured something. After that, I deleted everything, including the domain.
Is it possible to provide such a Templater script for this purpose? I tried to find out how to modify the original script, but did not figure out how to do that.