Comments (11)
without altering the structure of my static files
You mean in your case there's no need to replace assets references ?
I need to look at the code, the cascaded dependencies in gulp tasks may probably make this not exactly trivial. :)
from hugulp.
You mean in your case there's no need to replace assets references ?
Correct. None whatsoever. CloudCannon and Siteleaf, Cloud CMS's for static sites, do the same transparent cache busting. Im not sure about Neflify, but I'd wager they're doing the same as a part of the deployment pipeline following builds. If I understand it correctly, adding the cache headers would be as simple as getting MD5 sum of the file contents (or SHA, in case of DCVS), and busting those assets with a new ETAG or Cache-Control headers at the CDN-level.
from hugulp.
Nice!
I think I'll have some free time this weekend, so I'll work on hugulp a bit.
from hugulp.
May I ask how this is coming along? I came here wondering the same thing as jhabdas. Thanks.
from hugulp.
Hi, I haven't been able to work on hugulp due to real life :)
I'll get back to it at the earliest possible.
from hugulp.
I'd like to be able to turn this off as well.
Also, doesn't hugo support reading git info. Couldn't this be more cleanly handled by hugo using a query string of the commit hash?
from hugulp.
I'm currently thinking of a broader change to hugulp.
I've never liked the idea of having to install node/npm for these tasks, although the docker instance alleviates the issue.
There are some options using go as base and I'm looking into it.
I didn't quite catch what you meant with the git info + commit hash.
from hugulp.
Have you looked at Mage for packages?
from hugulp.
Thanks for the suggestion @jhabdas !
I understand you meant https://magefile.org/
It looked great until I read https://magefile.org/howitworks/
Seems you need the go environment in the end user system 😞
from hugulp.
Yep. Could just like NPM requires Node. Docker is the solve.
from hugulp.
@jbrodriguez Sorry, I was thinking Hugo exposed the last commit for the repo, but it exposed the last commit for individual files. However, what if you did something like this:
<link href="/layout.css?{{ slicestr (readFile "static/layout.css" | md5) 0 10 }}" rel="stylesheet">
On the original subject of being able to turn off asset fingerprinting. I think this would make it possible to use hugulp to create themes. I think you could just treat your theme folder like a full site with content and such and then just exclude those folders (content, public, etc) from checkin. I might be missing something, but given hugo's strong separation of file types, I believe it would be possible.
from hugulp.
Related Issues (20)
- Add docker support HOT 1
- having problem with reference task HOT 1
- Stuck in infinite loop on Ubuntu HOT 4
- UnCSS support HOT 3
- Source Map HOT 2
- Unable to minify Javascript error HOT 1
- HTML minifying HOT 1
- .hugulprc HOT 2
- Update code and variables
- Put all hard coded files/directories into an array
- Support .sass files in addition to .scss
- hugulp next HOT 1
- why doesn't 'watch' include autoprefixer? HOT 5
- CSS and JS not minified HOT 7
- JavaScript Concatenation? HOT 4
- Allow json extension for config file
- Update to Gulp 4 HOT 1
- Support for standardjs or custom eslint-config
- hugulp reprocesses images already compressed or optimized by hugulp HOT 1
- No stylesheets generated? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugulp.