GithubHelp home page GithubHelp logo

Comments (11)

saschalalala avatar saschalalala commented on June 25, 2024 1

Wouldn't adding watch support to themes not just only mean to load the theme name inside serve.js and watch the theme directories? Would I have to reparse the config file inside serve.js or would it be better to create a global config object that can be used inside the tasks?

from hugulp.

jbrodriguez avatar jbrodriguez commented on June 25, 2024

I haven't figured out yet how to properly support themes, but currently the build command will process the theme's assets (with some duplication, but the premise of optimization is still kept).

Your use case is a bit different, since you're actually developing a theme.

Your approach sounds ok, but you should do that in serve.js, which is where the watch(es) are created.

Maybe have a flag (--devTheme ??) defined to run that code only if needed ?

Does it make sense ?

from hugulp.

autoferrit avatar autoferrit commented on June 25, 2024

well, theoretically, not that i think about it, we dont need to compile the html templates in the active theme do we since hugo will automatically handle that? Or am I wrong. The local layouts/templates are inherited from the theme and replaceable when you make one with the same name out of the theme. So are the assets the only thing we need to process anyways?

from hugulp.

autoferrit avatar autoferrit commented on June 25, 2024

I suppose, if you're developing a theme you can do so in the root templates/static dirs and them move those to the theme when they're done. I'm still sorta new to hugo.

/shrugs

from hugulp.

jbrodriguez avatar jbrodriguez commented on June 25, 2024

we dont need to compile the html templates in the active theme do we since hugo will automatically handle that?

That's right :)

Actually, even the assets will be processed when you do a build, what's missing right now is watching for changes in the theme folder (while developing).

I'll play a bit with a theme and see what I find out.

In the worst case, I'll grab your code and do something along the lines of what I mentioned before (the --devTheme flag, etc.)

from hugulp.

 avatar commented on June 25, 2024

I haven't figured out yet how to properly support themes

@jbrodriguez want me to spike a PR in that direction?

from hugulp.

jbrodriguez avatar jbrodriguez commented on June 25, 2024

@jbrodriguez want me to spike a PR in that direction?

Sure, I'd like to see what's your take on the matter.

from hugulp.

gour avatar gour commented on June 25, 2024

Any progress on this?

I'd like to have adequate setup for Hugo while developing/tweaking Hugo theme/site when using some CSS framework (e.g Bulma, Foundation...)

Any hint for that?

from hugulp.

jbrodriguez avatar jbrodriguez commented on June 25, 2024

No progress so far, to be honest, as I'm tied up with other projects.

I remember I was thinking about adding another task that would process the theme folder as needed, but didn't go much further than that.

from hugulp.

gour avatar gour commented on June 25, 2024

I remember I was thinking about adding another task that would process the theme folder as needed, but didn't go much further than that.

Does it mean that at the moment it's recommended to simply create a (Hugo) theme using theme's toolchain if one e.g. uses some CSS framework and then after finishing the theme use Hugolp for smaller tweakings or is it that Hugolp is simply better to be used for general assets, iow. not suitable for working with themes?

from hugulp.

jbrodriguez avatar jbrodriguez commented on June 25, 2024

If you're using a theme for your site (not creating one), the theme assets should get processed by the hugulp pipeline.

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.