Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HUGO_LAYOUTDIR to the JS environment #10975

Open
bep opened this issue May 21, 2023 · 2 comments
Open

Add HUGO_LAYOUTDIR to the JS environment #10975

bep opened this issue May 21, 2023 · 2 comments
Assignees
Labels
Milestone

Comments

@bep
Copy link
Member

bep commented May 21, 2023

This relates to #10974, which is good enough for the simple case, but when having multiple layout folders, Tailwind needs access to the composite source. Luckily that should be "small data", so I suggest pass down a HUGO_LAYOUTDIR to the JS environment and, in the more complex setups, sync that composite filesystem to a directory inside HUGO_CACHEDIR.

So the Tailwind config could look like this:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [process.env.HUGO_LAYOUTDIR + "/**/*.html],
  theme: {
    extend: {},
  },
  plugins: [],
}
@bep bep self-assigned this May 21, 2023
@bep bep added this to the v0.112.0 milestone May 21, 2023
@bep
Copy link
Member Author

bep commented May 22, 2023

A note: The above alone will not solve the Tailwind 3 use case for this, so this needs some further thinking.

@bep
Copy link
Member Author

bep commented May 22, 2023

Testing this a little further, this:

module.exports = {
	content: ['./hugo_stats.json'],
	plugins: [typography],
};

  • Works reasonably well when used with resources.PostProcess
  • When not using resources.PostProcess you need to make an extra edit for the changes to show ...

We should get the JIT compiler running, but that's a little more involved.

@bep bep modified the milestones: v0.112.0, v0.113.0 May 22, 2023
@bep bep added Proposal and removed Enhancement labels May 22, 2023
@bep bep modified the milestones: v0.113.0, v0.115.0 Jun 13, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 5, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep removed this from the v0.122.0 milestone Jan 27, 2024
@bep bep modified the milestones: v0.123.0, v0.124.0 Jan 27, 2024
@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep modified the milestones: v0.125.0, v0.137.0, v0.138.0 Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant