Suppose I have the following directory structure in a gh-pages or other github website repo:
-project-dir
-- index.html # a symlink to mysite/index.html
-- mysite/
--- index.html # actual source, references otherstuff
--- otherstuff/
I don't want to copy the contents of mysite/ so that it all resides at the top level. In my case, this is because it is auto-generated in a specific format, and it would be extremely difficult to manage if it's unable to reside in a subdirectory.
For example, in order for a custom domain to work with gh-pages, I need a CNAME
file residing at the top directory. But I may also want a different CNAME
file further down in the directory structure. Simply copying the contents on mysite
into the top level would overwrite this.
(That example is a bit simplified. The real example involves lots of other things that could be overwritten, and dealing with lots of autogenerated components that should not be copied.)
The natural solution seems like symlinking, but if I make the top-level index.html
into a symlink that points to mysite/index.html
, then it fails because GitHub doesn't properly handle the symlink.
What is the standard solution for organizing all code into a subdirectory and not placing it into the top-level directory?