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

Development Server Support #29

Merged
merged 15 commits into from
Oct 30, 2020
Merged

Development Server Support #29

merged 15 commits into from
Oct 30, 2020

Conversation

platinummonkey
Copy link
Contributor

This PR adds a few features

  1. Adds Development server support via bzl run
  2. Adds @ryanrf-ac s archetypes support 881a1bf
  3. Makes the relative_path a little more accomodating see Excessively restrictive requirements on source layout #25 master...DataDog:master#diff-2e74d1b13ce9b7645c011139fc5931fdR15-R16
  4. Fixes the example site hugo theme
  5. Includes generated file support @nitnelave 56a29b8 Add support for generated files #26

@pcj
Copy link
Member

pcj commented Sep 17, 2020

Thanks @platinummonkey I'll try this out!

@pcj
Copy link
Member

pcj commented Sep 26, 2020

Some good changes in this, but the development server appears to reload on changes to files in the output tree. I don't see an easy way to propagate changes back to the source tree... Was it intended?

An alternative approach would be to use ibazel //site:site in conjunction with a static files server.

@platinummonkey
Copy link
Contributor Author

Some good changes in this, but the development server appears to reload on changes to files in the output tree. I don't see an easy way to propagate changes back to the source tree... Was it intended?

An alternative approach would be to use ibazel //site:site in conjunction with a static files server.

That's the intent and the workflow I use ibazel $target :)

@pcj
Copy link
Member

pcj commented Sep 28, 2020

So then if I understand correctly, using the hugo server here is not to facilitate hot regeneration of outputs, but rather just as a 'hugo-aware' webserver that gets restarted every time ibazel recompiles?

@platinummonkey
Copy link
Contributor Author

correct, I'll be looking at another iteration where I can hint to ibazel when the runfiles for the hugo generation change explicitly to orchestrate the hot reloading steps

@pcj
Copy link
Member

pcj commented Sep 29, 2020

OK, I'll have another look using ibazel. Documentation for the PR should be updated to suggest this workflow.

@f110
Copy link
Contributor

f110 commented Oct 21, 2020

This PR is really useful for me. I appreciated your work!
When I built my site with your PR, I needed to make small changes.

f110@a263d59
This patch makes relative_path to return correctly path if src is top-level.
Without this path, for example, content will be copied to ontent.

@pcj
Copy link
Member

pcj commented Oct 21, 2020

Sounds like we should put a little more effort into getting this merged. @platinummonkey what is your status on this? Any other changes planned? Do you want to apply @f110 patch?

@platinummonkey
Copy link
Contributor Author

@f110 's patch is included now 👍

@platinummonkey
Copy link
Contributor Author

also getting new files added even with ibazel has this issue: bazelbuild/bazel-watcher#135 so unfortunately this is about as far as we could take it without pushing this issue upstream for add/remove of files. It does detect runfile files that are modified.

@ryanrf-ac
Copy link
Contributor

I don't use ibazel, so I'm not sure if this is out of line for this PR, but I've submitted another PR that allows the use of local theme files, instead of pulling from github, should anyone be interested in merging that with this PR (assuming it's in line with 'development server support').

My workflow is using hugo itself for local development, then having bazel build everything using the same files I've used for local development. This does mean you need to check the theme files into the running bazel, but I think it makes it slightly more deterministic in the long run.

@platinummonkey
Copy link
Contributor Author

I don't use ibazel, so I'm not sure if this is out of line for this PR, but I've submitted another PR that allows the use of local theme files, instead of pulling from github, should anyone be interested in merging that with this PR (assuming it's in line with 'development server support').

My workflow is using hugo itself for local development, then having bazel build everything using the same files I've used for local development. This does mean you need to check the theme files into the running bazel, but I think it makes it slightly more deterministic in the long run.

happy to include it :) will update this PR by end-of-day

@platinummonkey
Copy link
Contributor Author

@ryanrf-ac included now 👍

@pcj
Copy link
Member

pcj commented Oct 30, 2020

LGTM, thanks @platinummonkey, @f110, @ryanrf-ac.

@pcj pcj merged commit 155d0e7 into stackb:master Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants