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 a way to avoid copying from /static #7591

Open
ghost opened this issue Aug 23, 2020 · 4 comments
Open

Add a way to avoid copying from /static #7591

ghost opened this issue Aug 23, 2020 · 4 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Aug 23, 2020

I'm interested in having a 1GB+ staticDir under a consistent prefix, say /files.

It seems like however staticDir is set, it copies it into public/ and such. I'd rather hugo not manage that and copy it myself, while still being able to refer to the folder while running hugo server.

Would this be a useful new feature or is there already a way to do it?

Thank you!

@ghost ghost added the Proposal label Aug 23, 2020
@bep bep added Enhancement and removed Proposal labels Aug 23, 2020
@bep bep added this to the v0.75 milestone Aug 23, 2020
@bep bep changed the title staticDir without copying? Add a noCopy flag to the static file system Aug 23, 2020
@bep bep changed the title Add a noCopy flag to the static file system Add a way to avoid copying from /static Aug 23, 2020
@bep bep added Proposal and removed Enhancement labels Aug 23, 2020
@bep
Copy link
Member

bep commented Aug 23, 2020

Would this be a useful new feature or is there already a way to do it?

  • The /static folder is currently copy-as-is
  • If you don't want that, then don't put anything in it
  • If you, as an example, create a symlink in /public/mybigfiles that will work exactly like a /static setup; Hugo does not need to know about that.

@ghost
Copy link
Author

ghost commented Aug 23, 2020

Hi bep, thanks for replying.

If I make a symlink under content, I can see "mybigfiles" in hugo server. However, it gets copied when I hugo.

Is there a way that I can ignore that directory when running hugo or include content outside of content/ when running hugo server?

I guess I could symlink before hugo server and delete after hugo, potentially.

@bep
Copy link
Member

bep commented Aug 23, 2020

So, the different folders in Hugo have different roles. If you put them below /my-site/foo then Hugo will not touch them.

@ghost
Copy link
Author

ghost commented Aug 23, 2020

But if it's below that directory hugo server won't serve them, right?

I have worked around this for myself by just avoiding hugo server and doing a local webserver.

@bep bep modified the milestones: v0.75, v0.76 Sep 14, 2020
@bep bep modified the milestones: v0.76, v0.77 Oct 6, 2020
@bep bep modified the milestones: v0.77, v0.78 Oct 30, 2020
@bep bep modified the milestones: v0.78, v0.83 Apr 23, 2021
@bep bep modified the milestones: v0.83, v0.84 May 3, 2021
@bep bep modified the milestones: v0.84, v0.85 Jun 18, 2021
@bep bep modified the milestones: v0.85, v0.86 Jul 5, 2021
@bep bep modified the milestones: v0.86, v0.87, v0.88 Jul 26, 2021
@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 4, 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 modified the milestones: v0.122.0, 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.126.0 Apr 23, 2024
@bep bep modified the milestones: v0.126.0, v0.127.0 May 15, 2024
@bep bep modified the milestones: v0.127.0, v0.128.0 Jun 8, 2024
@bep bep modified the milestones: v0.128.0, v0.129.0 Jun 21, 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