Giter VIP home page Giter VIP logo

Comments (4)

siamkreative avatar siamkreative commented on June 9, 2024

Hi @vjeantet,

What's the best way to apply those optimizations just for my documentation site? I don't like the idea of overriding footer.html (copying the file from themes\hugo-theme-docdock\layouts\partials) because it contains more than the script.

Would it be a good idea to split the scripts fromfooter.html and move them into its own file like scripts.html? That way, anyone can easily override the included scripts?

What's your take on this?

Cheers

from hugo-theme-docdock.

stp-ip avatar stp-ip commented on June 9, 2024

Not sure such optimization is really needed. With http/2 concatenation leads to worse performance due to cache invalidation, when one script changes. All scripts are loaded with almost no overhead due to http/2.

Minification could still be something interesting. This can easily be done via a PR I assume.

For overwriting specific scripts and where they are loaded from. As far as best practice goes:

  • load them locally first
  • make it configurable via file or setting to load from somewhere else.

from hugo-theme-docdock.

siamkreative avatar siamkreative commented on June 9, 2024

Thanks for getting back to me @stp-ip. Unfortunately, not everyone is using http/2 which means it would be good to concatenate / minify those assets.

But instead of doing the optimizations for everyone (which could be counter productive for those using http/2, as you pointed out), I will submit a PR to move the scripts to their own partial file. That way, we increase flexibility for developers.

from hugo-theme-docdock.

siamkreative avatar siamkreative commented on June 9, 2024

FYI The #53 has been merged, allowing more flexibility for developers

from hugo-theme-docdock.

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.