Closed noraj closed 5 years ago
PS : please take a look at my .gitlab-CI
and also give an example for GitLab under https://docusaurus.io/docs/en/publishing.
erratum : I just figured that was projectName
that was used and not baseURL
to create the extra sub-folder.
I agree. This is a legacy decision that we'll fix in v2.
@yangshun Nice to hear.
🐛 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/