-
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. |
Beta Was this translation helpful? Give feedback.
Replies: 28 comments 19 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. |
Beta Was this translation helpful? Give feedback.
-
Yea @50wliu, true. Thank you for helping out, I am grateful. |
Beta Was 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. |
Beta Was 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? |
Beta Was this translation helpful? Give feedback.
-
50wliu:
There is also a special case for user pages (Those directly available under |
Beta Was 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 |
Beta Was 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 |
Beta Was 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 |
Beta Was 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"
|
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was 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. |
Beta Was this translation helpful? Give feedback.
-
There is already peaceiris/actions-gh-pages which does this job. |
Beta Was 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: |
Beta Was 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 |
Beta Was this translation helpful? Give feedback.
-
I would love the option of a |
Beta Was this translation helpful? Give feedback.
-
This has been going on for awhile with not much movement, but I’ll drop in to echo the sentiment: I would love to be able to point this to any arbitrary folder on any branch! I often use github pages for previewing a site before pushing it to its public destination, so being able to point to anywhere within the repo would be very useful. Also, I may be wrong, but it looks to me like you can currently point to any branch (not just |
Beta Was this translation helpful? Give feedback.
-
I'll throw my hat into the ring saying that at least some other options, if not outright configuration of any directory, would be nice here. The use of There might be very good reasons why |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was 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:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
+1 for a custom path, limiting it to |
Beta Was 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. |
Beta Was 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 ) |
Beta Was 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... |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Beta Was 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..." |
Beta Was 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.