GithubHelp home page GithubHelp logo

Comments (11)

jbrodriguez avatar jbrodriguez commented on July 4, 2024

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.

 avatar commented on July 4, 2024

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.

jbrodriguez avatar jbrodriguez commented on July 4, 2024

Nice!

I think I'll have some free time this weekend, so I'll work on hugulp a bit.

from hugulp.

a-schaefers avatar a-schaefers commented on July 4, 2024

May I ask how this is coming along? I came here wondering the same thing as jhabdas. Thanks.

from hugulp.

jbrodriguez avatar jbrodriguez commented on July 4, 2024

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.

levidrain avatar levidrain commented on July 4, 2024

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.

jbrodriguez avatar jbrodriguez commented on July 4, 2024

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.

 avatar commented on July 4, 2024

Have you looked at Mage for packages?

from hugulp.

jbrodriguez avatar jbrodriguez commented on July 4, 2024

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.

 avatar commented on July 4, 2024

Yep. Could just like NPM requires Node. Docker is the solve.

from hugulp.

levidrain avatar levidrain commented on July 4, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.