create a Jekyll GitHub blog as a subdirectory of an Organization - github

I want to know if creating a Jekyll GitHub blog for a particular GitHub page will associate itself with that entire GitHub entity or if it is possible to make multiple Jekyll blogs under the auspices of a single GitHub profile.
I'm part of an "Organization" on GitHub, my research group, and I want to create a blog for a particulat project following this tutorial, i.e. "Jekyll QuickStart: Host on GitHub in 3 Minutes".
At first I created an entirely new and seperate GitHub profile from which to host this blog, but it would be better if I could create this blog as a repository within the Organization to which I belong since most the people that need to access this blog are already associated with that organization.
But it would be suboptimal if this one blog were the only things that could be associated with the organization since the organization is involved in things other than this project as well.
So for these GitHub blogs is it 1 page/organization = 1 blog, or can we have a one to many mapping?

If you've already got a Github Pages repository set up for the organization (e.g. some-org.github.io), then any additional gh-pages repository will be accessible via some-org.github.io/<repo name>.
For example, I've got the organization "SusHack", and it has a repository called sushack.github.io.
sushack.github.io serves the main domain of sushack.co.uk, and we've got a project repository under that organization with a gh-pages branch, e.g. https://github.com/sushack/PuppetMaster/tree/gh-pages, and it is accessible via sushack.github.io/PuppetMaster or sushack.co.uk/PuppetMaster
So to recap:
Make a <orgname>.github.io repository under the Organization. In this you can create a file called CNAME to define a custom domain, or just use <orgname>.github.io.
Make a repository called blog with a gh-pages branch. You can push your Jekyll codebase to this branch, and Github will build it for you
Access your blog via <orgname>.github.io/blog/.

Related

How to make a github pages for an organization

We have an organization on github, and in one of the repo's I'm trying to convert it to a simple github.io page to present the MD files in the repo. I'm following this guide.
It seemed easy enough, I added an _config.yml file to the repo and enabled github pages in the settings.
The problem is that github now shows that the site is published at our www.ORGANIZATION_NAME.org/wiki. But we don't own that domain. That domain isn't a registered domain in our github organization settings. I really have no clue where it got the name from, it seems completely arbitrary.
Is there any way to get a ORGANIZATION_NAME.github.io or similar default domain?
The message from Github settings page (organization name supplanted)
Your site is published at http://www.ORAGANIZATION_NAME.org/wiki/
To use the feature where your pages are exposed on *.github.io you need to make sure your github repository follows the correct naming convention.
Use the repository name <username or org-name>.github.io the github system sees this as a "Personal Page" and exposes the repository via https://<username or org-name>.github.io.
see: https://pages.github.com/
You can can customize the exposed URL by adding the "CNAME" file at the root of the repository.
Example:
I have the github repository Loki-Astari.github.io
Github repo: https://github.com/Loki-Astari/Loki-Astari.github.io
Exposed here: https://Loki-Astari.github.io
CNAME here: https://LokiAstari.com
Another Example:
Github repo: https://github.com/academicpages/academicpages.github.io
Exposed here: https://academicpages.github.io

Sync GitHub Pages Configuration Between Projects and Organization

I have a GitHub organization where I publish a webpage from the repository orgname.github.io. Of course, I have several project repositories where I'd like to host documentation about those projects. This is all possible through GitHub Pages.
However, I'm not sure how to synchronize the configuration of the organization page with the project pages. I want the website to look the same whether I'm at
http://orgname.github.io or if I'm at http://orgname.github.io/project.
What can I do to keep the Jekyll-based configuration in sync?
This is the solution we've come up with:
Create a repository to contain the Jekyll configuration, jekyll-website.
Fork/copy the repository to the repository <orgname>.github.io.
In every project, create a git subtree as the docs directory.
Whenever you need to make change to the look/design of the webpage, do it in jekyll-website, then pull those changes into <orgname>.github.io and all the project subtrees. This is a little bit of work whenever you need to make changes to the website, but it gets the job done.
Since the Github pages sites are hosted in the gh-pages branch of their respective repos, they are independent from each other and the project pages.
I'm assuming your content will be unique for each repo, so you're asking about syncing the theme/structure etc, which as far as I know that cannot be synced. I would recommend choosing a Jekyll theme for all of your sites and stick to editing content.

Use Github pages on multiple repositories when one has a custom CNAME already?

I have a Github repository set up to host a small static site. The repository that hosts this is in the following format:
username.github.io
This repository is setup to use a custom domain and has a CNAME file to do so properly. This repository works exactly as expected.
Now I want to set up a project page and utilize the gh-pages branch for a different repository. When I do this, though, the CNAME in the first repository seems to apply and I am redirected to example.com/REPOSITORYNAME instead of using the expected username.github.io/projectname associated with this separate repository.
How can I continue to use the username.github.io repository with a custom domain and the gh-pages branch on a different repository without redirecting the gh-pages repository to the custom domain defined in the first repository?
As of Aug 2016, I don't think this is possible. (https://help.github.com/articles/custom-domain-redirects-for-github-pages-sites/)
The Github Pages help article states that
Project Pages site owned by a user account, such as username.github.io/projectname, will be Automatically redirected to a subdirectory of a User Pages site custom domain (user.example.com/projectname), unless a different CNMAE is specified, such as project.example.com
See Github pages - Disable custom domain redirection for all but a single site?
The easiest way is to create a Github Organisation for each website you decide to manage this way.
In this case, I had to publish to master instead of gh-pages.
More informations here : https://help.github.com/articles/user-organization-and-project-pages/

Static Website: I want to host different subdomain (=different directory) on github service?

Github allows you to host your static website for free. On this page, Github describes the difference between User Pages and Project Pages. I can't understand the difference!
Currently, my website is running on github well. but I want to add a sub-domain to it.
www.123.github.io -> redirects to 123.com (which is a repository on Github, too.)
www.123.com -> is working
www.blog.123.com -> how? -> should it be "Project pages"?
I mean, can I run a domain and a subdomain in one repository?In summary:
Can I host a domain and a subdomain using Github-Pages?
Can I host different subdomains (a.123.com, b.123.com, ....) on github? Is it possible into one repository? (according to the Github limitations, the repository name should be the same as Github username, so we can just create just one repository under each account!)
The difference is that each repo can have its own Project Page (from gh-pages branch) but you can have only one User pageā€”in a specially named repo.
However you can also create multiple Organizations from a single user; Org Pages are similar in spirit to user Pages.
Project pages are served in subdirectories of the same domain (username.github.io/projectname), but each can have its own custom domain if you add a CNAME file (and arrange DNS)).
In any case, you at most get one domain per repo.
You can use a.123.com and b.123.com for different repos but I'm not sure if you can get it simultaneously with 123.com.
Unfortunately GitHub doesn't allow multiple subdomains in a single repository, so you'd need to have two repos pointing to the two different URLs.

How can I activate the pages machinery in GitHub without subdomains?

Is there any way to activate the Pages machinery in GitHub without going through the subdomains? A practical case could be in a GitHub Enterprise instance.
To view GitHub Pages (gh-pages branch) on your github enterprise server, use this URL structure:
http://[github-enterprise-domain]/pages/[username]/[repo]/
This URL structure doesn't work for github.com.
For user or organization pages, you can't create a "username.github.io" repo. Instead, you can create a repo and name it the same as your username or org, and then you use:
/pages/[username]/[username]/
The 2nd [username] is simply the name of your repo.