-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
baseURL behavior #1081
Comments
PS : please take a look at my |
erratum : I just figured that was |
I agree. This is a legacy decision that we'll fix in v2. |
@yangshun Nice to hear. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
I don't know if it is related with #448 but I don't think that
baseURL
insiteConfig.js
has the right behavior or I don't understand it.I understand that one have to put this config if the documentation is directly accessed under
https://rawsec.gitlab.io/'
:url: 'https://rawsec.gitlab.io'
baseUrl: '/'
or to put this configuration if the documentation is accessed from a sub-directory like
https://rawsec.gitlab.io/rawsec-cybersecurity-inventory-doc/
:url: 'https://rawsec.gitlab.io'
baseUrl: '/rawsec-cybersecurity-inventory-doc/'
A lot of project behave like that but then they generate the website directly under the
build/
directory where Docusaurus is generating it underbuild/rawsec-cybersecurity-inventory-doc/
creating an extra sub-folder.So in a CI/CD that auto-deploy the website, if one is doing
cp -rT build/rawsec-cybersecurity-inventory-doc/ ../public
he will havepublic/
in the end (we are force to use-T, --no-target-directory
or globbing to avoidrawsec-cybersecurity-inventory-doc/
to be copied and resulting inpublic/rawsec-cybersecurity-inventory-doc/
so the doc would be served underhttps://rawsec.gitlab.io/rawsec-cybersecurity-inventory-doc/rawsec-cybersecurity-inventory-doc/
).This is forcing us to put
rawsec-cybersecurity-inventory-doc/
in the CI file. So if the URL change because the gitlab project/repository is renamed we will have to modify the CI too.So how I see it is: not creating an extra directory under
build/
.I don't really get why the extra directory is created, maybe for people that serve the doc themselves under something like
/var/www/html/
so copyingbuild
they will already haverawsec-cybersecurity-inventory-doc/
created. But for hosting under Gitlab Pages (maybe same behavior with Github pages and an external CI) this force people to be very careful on how they copybuild/
.Of course this won't be a problem for people using
publish-gh-pages
script. But this is a particular and manual case, where using a CI/CD is a more automated and generic case.So ok this is a very minor issue, and I maybe should have put it under
question
. Sorry for the extensive description but this is difficult to explain.To Reproduce
Don't really applicable. See the description.
Expected behavior
Generated website is directly placed under
build/
folder, no extra sub-directory is created.Actual Behavior
Generated website is placed under
build/baseURLhere/
sub-folder.Reproducible Demo
See the repo: https://gitlab.com/rawsec/rawsec-cybersecurity-inventory-doc
Update: I included the documentation in my current repository instead of having a separate repository: https://gitlab.com/rawsec/rawsec-cybersecurity-list/
The text was updated successfully, but these errors were encountered: