GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.16k stars 412 forks source link

Add support for CDNs #274

Open dziudek opened 5 years ago

dziudek commented 5 years ago

ref. https://github.com/GetPublii/Publii/issues/271#issuecomment-454391795

We need to add an option to specify a domain for the assets (it would be good to specify separate domains for theme assets and media assets).

vivek-kumar-poddar commented 5 years ago

No, the relative path needed to enable netlify cdn.

And I am using cdn for static assets (fonts, images, svgs, js, css ). And I don't enable them manually, it's automatic in netlify ( if you choose proper settings ).

docherty commented 4 years ago

Here is the Ghost storage adapter I've used for Cloudinary which worked perfectly for my needs. Perhaps there's some value to be had looking at that as a starting point. https://github.com/eexit/ghost-storage-cloudinary

designgrande commented 4 years ago

When can we expect support for CDN?

OR alternatively can developers please provide or tell me how to modify static assets (js/CSS/fonts/images) URL path to custom CDN path.

Example: After sites rendering; the path of a CSS file is: domain.com/assets/css/style.css

To enable CDN, I need to change it to: cdn.domain.com/assets/css/style.css

BUT it is necessary that there is "style.css" in the following directory -> domain.com/assets/css/

So basically, I just need help to rewrite the URL for static assets after or while rendering.

I want to transfer 3 of my WordPress websites to publii, but I can not afford to sacrifice on website speed, and without CDN, I don't find any mean to keep all my site performant.

Please please help me with this.

Thanks!

designgrande commented 4 years ago

Any help, please

dziudek commented 4 years ago

@designgrande - at this moment the only way to make it working is to use @rendering.previewMode global variable to create custom CSS/JS paths when website is rendered. So if previewMode is active - you render CSS/JS paths in the old way, but for the non-preview mode you use custom paths.

designgrande commented 4 years ago

@dziudek Hi, I understood how to do it for CSS and JS (also thanks to docs: https://getpublii.com/dev/renderer-global-variable/) but how to achieve the same with images?

gadgetraja commented 4 years ago

Any update on CDN implementation - I think it was requested back in Jan 2019. Not enforcing or anything, just that every other issue is resolved within months.

Regards.

Suleman-Elahi commented 3 years ago

Is there any improvement on this. Because SEO site checkers give warnings about it. If not images then at least there should be an option to load most common CSS/JS files from a CDN.

thefourcraft commented 2 years ago

I think that this problem is still, applicable to this day. If I want to add my own domain to GitHub pages I need to change all the files manually. adding a check box for a domain will be amazing when pushing to Github pages because it will mess up the website

it won't find the CSS...

candideu commented 2 years ago

Here is the Ghost storage adapter I've used for Cloudinary which worked perfectly for my needs. Perhaps there's some value to be had looking at that as a starting point. https://github.com/eexit/ghost-storage-cloudinary

Ghost also has a an official Cloudinary integration: https://ghost.org/integrations/cloudinary/