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

Always generate appearance.js in js folder #830

Merged
merged 1 commit into from
Jul 29, 2023
Merged

Always generate appearance.js in js folder #830

merged 1 commit into from
Jul 29, 2023

Conversation

fuse314
Copy link
Contributor

@fuse314 fuse314 commented Jul 17, 2023

depending on the basePath, the "appearance.js" was generated in an additional subfolder (Example: set the basePath to "https://example.com/foobar/", the file was generated into "/js/foobar/appearance...js" instead of "/js/appearance...js" ).

This fixes the behaviour, the javascript resource is always generated into the target "js" folder along with all the other js files.

depending on the basePath, the "appearance.js" was generated in an additional subfolder (i.E. /js/docs/appearance... instead of /js/appearance... ).
@nunocoracao
Copy link
Owner

Not sure about this one @fuse314. What is this fixing?

@fuse314
Copy link
Contributor Author

fuse314 commented Jul 20, 2023

Steps to reproduce:

  1. open config.toml, set baseURL = 'https://example.com/foo/bar/baz/'
  2. delete local "public" directory
  3. run hugo
  4. check content of "public" directory for a directory called "foo":

example:
image

the pull request always generates the javascript file into the "js" directory, along with the other javascript files.

@nunocoracao
Copy link
Owner

@fuse314 which given that you defined a baseUrl like that makes sense right? What exactly doesn't work when you do this?

@fuse314
Copy link
Contributor Author

fuse314 commented Jul 21, 2023

@nunocoracao no, it does not. If I deploy the public folder to /foo/bar/baz/ on the webserver, the full url to this file is /foo/bar/baz/foo/bar/baz/js/appearance....
It is the only file in the double relative path, all other js files are deployed in the /js/ folder.
Just try it out locally and look at the resulting folder structure and the files.

I have various existing folders in my webroot and I have to create "include" and "ignore" rules for ftp deployment. It just makes these rules unneccessarily more complex.

@nunocoracao nunocoracao merged commit 8cb34f3 into nunocoracao:main Jul 29, 2023
@fuse314 fuse314 deleted the fix/js_asset branch July 30, 2023 04:27
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.

2 participants