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

Remove /exampleSite/resources/_gen from the repository #867

Open
fjtc opened this issue Feb 11, 2022 · 3 comments
Open

Remove /exampleSite/resources/_gen from the repository #867

fjtc opened this issue Feb 11, 2022 · 3 comments

Comments

@fjtc
Copy link
Contributor

fjtc commented Feb 11, 2022

Is this a BUG REPORT or FEATURE REQUEST?:

FEATURE REQUEST

What happened:

I think it would be a good idea to remove the directory /exampleSite/resources/_gen from the repository and add it to .gitignore as it is generated again whenever needed by Hugo. Furthermore, some posts, such as https://discourse.gohugo.io/t/the-best-gitignore-for-hugo/20283 suggest that this directory can be safely ignored for sites.

What you expected to happen:

The directory will no longer be in the repository, messing with its history. Since the files inside this directory are generated by Hugo from the source of the site, there is no point to keep them in the repository. Furthermore, since they are usually stored as binary files or single line text fields, any changes on those files means a complete replacement of their contents regardless of the size of the changes.

How to reproduce it (as minimally and precisely as possible):

Just change something in the theme's CSS and run the site. Some files inside /exampleSite/resources/_gen will eventually change. If you remove the directory before execute Hugo, it will be generated automatically by it based on the site's source thus there is no need to add it to the repository.

Anything else we need to know?:

It is a minor repository issue that can reduce the size of the repository in the long term. If you think it is a good idea, let me know and I'll send a pull request with this change.

Environment:

  • Syna Theme version: commit 36d3ec8
  • Hugo version: 0.80
@stp-ip
Copy link
Member

stp-ip commented Feb 14, 2022

The reasoning behind having the _gen directory included and checked in is for the non extended Hugo version to function. If I remember correctly only the extended Hugo version does generate the assets. The "normal"/lightweight one only uses them.

Maybe I missed this change and both the lightweight and the extended hugo version works without any pregenerated assets now. Could you check please.

@fjtc
Copy link
Contributor Author

fjtc commented Feb 14, 2022

I'll test it here. In fact I'm using the extended version of Hugo 0.80. I was told to always stick with the extended version as it is the best way to run anything as the normal and lightweight do not run with some themes. I'll test it here and see what happens. As soon as I get the results I'll update this issue.

@stp-ip
Copy link
Member

stp-ip commented Feb 14, 2022

Yeah I'd say running with the extended version is best especially while working on themes as well, but not every platform and therefore not every user does have it and we wanted to stay compatible with the "no-code" users as well.
Thanks for taking a closer look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants