-
Instead of the normal options as the source for my site deployed with pages, that is the This will be really helpful, as I really like using specific names for my repo folders. |
BetaWas this translation helpful?Give feedback.
Replies: 32 comments 22 replies
-
From https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/, the only three options that GitHub Pages recognizes are:
So it doesn’t look like you’re able to define a custom folder or branch yet. |
BetaWas this translation helpful?Give feedback.
-
Yea @50wliu, true. Thank you for helping out, I am grateful. |
BetaWas this translation helpful?Give feedback.
-
I agree with @osioke, being able to choose a custom folder name would be great — I was about to create a post on this topic, but since I’ve found this thread I just joined in, so I’ll share here some thoughts on this. I find that having only the “docs/” folder as an option for serving GH-Pages contents directly within the main repository is very limiting. The idea of hosting the GH-Pages contents inside the repo is a really cool feature, which I use a lot for online documentation, since it allows smart reuse of the repository contents to generate the documentation without having to work across orphan branches. But in most cases, I find the “docs” folder name problematic, for I’d rather use that folder for the software/project documentation, whereas for the GH-Pages contents a folder named “www” would have been more intuitive and practical — or at least the freedom to rename the folder as I please. |
BetaWas this translation helpful?Give feedback.
-
@50wliu I do not have gh-pages branch. Only the ‘master’ and ‘docs/folder’ branch. Is there anything I can do about this? |
BetaWas this translation helpful?Give feedback.
-
50wliu:
There is also a special case for user pages (Those directly available under |
BetaWas this translation helpful?Give feedback.
-
(Bit late on a response but better late then never I guess?) With GitHub Actions could you setup an action, that would listen for pushes towards a specific folder (your |
BetaWas this translation helpful?Give feedback.
-
@Andre601, I like your suggestion of using GitHub Actions to publish on the But I still think that in some case it might be desirable to have the HTML files inside the project, e.g. when the documentation is intended for both online and offline reading. Being able to customize the GHPages folder name would be quite practical, and would allow to accommodate the user’s naming convention — e.g. Mainly, I think that naming the default GHPages folder If the folder was named |
BetaWas this translation helpful?Give feedback.
-
I want to have this as feature request. We should allowed to specified any folder of the repo as pages From my used case, I have create my web repo with blazor. And the default folder it use for page is |
BetaWas this translation helpful?Give feedback.
-
Based on https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/ I am not sure if gh-pages branch is still an option. I found: Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io). · GitHub which is " Deploying a subfolder to GitHub Pages"
|
BetaWas this translation helpful?Give feedback.
-
The |
BetaWas this translation helpful?Give feedback.
-
@tajmone , @Andre601 , @mluevanos , et al, I encountered the same need, and - it took me much longer than expected but - I finally came up with a reusable Github Actions named Github Pages Overwriter to allow choosing arbitrary folder in your repo to publish it into Github Pages. Give it a shot, spread the words if you like it, subscribe my project if you want to receive future updates, report issues here because I may not come back and check this post. |
BetaWas this translation helpful?Give feedback.
-
There is already peaceiris/actions-gh-pages which does this job. |
BetaWas this translation helpful?Give feedback.
-
Hi @Andre601 , good point. And, yes, peaceires/actions-gh-pages was (and still is) among the top search results when I was evaluating existing solutions. Here come the major reasons that I eventually started the Github Pages Overwriter project.
Perhaps I should also include this essay into my project’s README file. :slight_smile: |
BetaWas this translation helpful?Give feedback.
-
In the meantime, since this discussion took place, GitHub added a new option that allows using a custom-named branch (not just |
BetaWas this translation helpful?Give feedback.
-
I would love the option of a |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Forgive my cynicism, but this seems silly. There is a dropdown for directories that could easily populate dirs other than /root or /docs. KISS method: symlink the directory to another outside of the local repo and create a new repo for that directory. |
BetaWas this translation helpful?Give feedback.
-
Ah, yes, the reverse would work. Thanks! Also, symlink the output dir a level up and create a new repo for it. This is what I've chosen as the separation of the generator with the site repos makes sense to me. I can gitignore the site output, and dev on the generator, while having CICD on the site repo when I edit/blog on it. …On Thu, Sep 15, 2022, 10:18 AM Wonseok Shin ***@***.***> wrote: I would use a symlinked locally to a docs folder, but it doesnt work as git sees symlinks as files. symlink works for me. Suppose your static site generator generates the output files in a specific folder, say website/. I think you probably did ln -s website docs. This doesn't work, because git sees the symbolic link docs as a file as you pointed out. You should reverse the direction of the symlink: ln - s docs website. Then, when the static site generator generates files in website/, actually docs/ is populated. Now you can push the populated docs/ to GitHub to deploy the website. This may not be an ideal solution, but it is a method that works for me. — Reply to this email directly, view it on GitHub <#23073 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AF7OL3HIGKOFZFVG3CEZKSLV6NK5XANCNFSM56VZTELQ> . You are receiving this because you commented.Message ID: ***@***.***> |
BetaWas this translation helpful?Give feedback.
-
+1 for a custom path, limiting it to |
BetaWas this translation helpful?Give feedback.
-
Is there any plan of implementing this in the near future? I feel like writing actions for such a basic configuration is an overkill. |
BetaWas this translation helpful?Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Final Solution: ( Reported by @airtower-luna ) |
BetaWas this translation helpful?Give feedback.
-
This would be super useful because I could place my files inside a directory with the same name as my repo, allowing me to migrate my website without changing every single in-site href to account for the new root directory name... |
BetaWas this translation helpful?Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
BetaWas this translation helpful?Give feedback.
-
It kind of amazes me that this is still an issue... What's being asked for here, is to be able to be able to make a simple, (for many people) one-time change to their repo settings, so the pages are hosted from another folder (that isn't precisely, exactly named "docs"). This is akin to asking for a hammer to deal with a nail that's sticking out. And the recurring solution offered, to use Github Actions, is akin to responding "sorry, we don't have a hammer, just learn how to use a jackhammer". As has been said, it's overkill for this use-case. Come on Github, you've already built quite a complex system here, right down to the drop-down box that already exists for selecting "root" or "docs". Just finish the 99% done job and let people pick another folder as their pages base. "When all you have is a jackhammer..." |
BetaWas this translation helpful?Give feedback.
-
Adding myself to the list of people who would greatly prefer an option in the settings dropdown. I can and do use github actions regularly but I'm also a teacher and having to teach people github actions can double the length of a session in my 'building a static site with github' training |
BetaWas this translation helpful?Give feedback.
-
years later, still the same dump problems this is why i've left github |
BetaWas this translation helpful?Give feedback.
-
Honestly, this limitation makes no sense. There’s no real technical reason for this — it just adds friction for anyone who uses Pages for something slightly more advanced than a static HTML site. |
BetaWas this translation helpful?Give feedback.
-
Another reason to switch to gitlab Bruce Davidson …On Fri, Dec 12, 2025, 5:53 AM Ryan Emberling ***@***.***> wrote: I would love the flexibility to specify any directory of the project, and I agree that an alternative top-level predefined name which was more clear about intent would be preferable to docs. I suggest gh-pages as the folder name to match the predefined branch pattern, and to be even more explicit than www — Reply to this email directly, view it on GitHub <#23073 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAJUE4QRMGVBHEI7D3NVYJL4BLCFRAVCNFSM6AAAAABZOZ3WJ6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMRUGA3DAOI> . You are receiving this because you commented.Message ID: ***@***.***> |
BetaWas this translation helpful?Give feedback.

From https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/, the only three options that GitHub Pages recognizes are:
So it doesn’t look like you’re able to define a custom folder or branch yet.