Always use PROJECT_NAME, even for user and org pages #384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The symptom was that if we had a user or org page (e.g., https://JoelMarcey.github.io), we would try to copy files to a directory within a directory, getting errors like:
This is because we were setting the end of
fromPath
to empty if we were using an org or user page.But we don't need to do that. The
PROJECT_NAME
(set insiteConfig.js
asprojectName
) is the user or org repoe.g., https://github.com/JoelMarcey/JoelMarcey.github.io/ has a
projectName
ofJoelMarcey.github.io
with anorganizationName
ofJoelMarcey
.So now the
fromPath
andtoPath
look like:fromPath
:build/JoelMarcey.github.io
toPath
:buuid/JoelMarcey.github.io-master
Test Plan
Ran:
on two repos. One for an org/user site and one for a project site. Publish worked on both:
Org/user site: https://github.com/JoelMarcey/JoelMarcey.github.io/tree/master (https://JoelMarcey.github.io)
Project site: https://github.com/JoelMarcey/docusaurus-testing/tree/gh-pages (https://JoelMarcey.github.io/docusaurus-testing)
Related PRs
N/A