hosting multiple github pages from one github repository - html

I have github repository which contains 4 different folders named module2/3/4/5 solutions respectively each containing index.html and style.css files which are a part of a coursera course i am currently pursuing....now i can't figure out how to host all these 4 different pages separately from this one repository....all tutorials and documentation tell to create a new repo named username.github.io and simply push the index.html and it'll work which i understand....but i don't want 4 different repositories for solutions of different weeks...rather i would like to host all 4 independently form this very same repository....please tell me what to do?
I want my repository to look like this guys repsitory
https://github.com/siddartha19/Coursera-HTML-CSS-and-JavaScript-for-Web-Developers
as you can see all the different module solutions are hosted from this repository....

The architecture of the github page website mirror the architecture of the repository.
From your example, one of the page's URL is:
https://siddartha19.github.io/Coursera-HTML-CSS-and-JavaScript-for-Web-Developers/Assignments/module-3/index.html
The repository name is 'Coursera-HTML-CSS-and-JavaScript-for-Web-Developers' - It contains a folder 'Assignments' which contains 'module-3' which contains an index.html file.
Do you see how the URL format mirrors the structure of the folders?
If you want your github page to have the same architecture you can just do the same folder structure.

This can be achieved through netlify. Once you've registered, add project -> select git repo. Remember to change the base URL to let's say module2/index.html.

Related

href relative links broken in git hub pages

link to website in GitHub pages git hub repository when i pushed my code to git hub i tried to use git hub pages to display a simple recipe website i created but when i load the website it takes me to the index.html file and when i try to go to the lasagne recipe it says "error 404 there isn't a GitHub pages site here." here i dont know how to fix this and i just want to set up a place for all my future projects to be stored I have only just started programming so any help would be useful
Make href="https://furqaan78621.github.io/odin-recipes/recipes/lasagne.html"
or remove "../"
You should also rename lasagne.html to index.html to have less sub directories and contain all files for lasagna in a folder under recipes.

Can't use Git Pages

TLDR: GitHub Pages isn't working.
I have a little knowledge on GitHub and tried multiple fixes to no avail. One repository is only showing readme file contents.
Please explain in lamest terms.
New to web development, I finally was able to complete my first site, but I'm unable to actually deploy the files for some reason; please forgive me, I literally have no idea what any of the git terminologies are.
I purchased a pro subscription in order to keep the repository private and the site public.
Every file is present in what seems to be the main root directory, but nothing is being actually presented.
I've created two different repositories in an effort to fix this, as I've seen different methods are available.
The first repository includes a README file because I was originally instructed to do so, however, all the site link does is present that README file's contents;
I also attempted to add a permalink fix within the file, but all it did was add that text to the other text presented.
The second repository in question literally greets me with nothing but a 404 error.
The solution I tried for the second repository was to have the repository name share my username as well since that seems to be where the site's link originates, but no present changes have occurred.
Finally, the waiting game solution hasn't beared any fruit yet either aside from updating the README file's contents.
All help is very much appreciated.
Check first:
Your GitHub repository name, which depends on the type of GitHub Pages you are creating
If you're creating a user or organization site, your repository must be named <user>.github.io or <organization>.github.io.
your GitHub Pages Publishing source
If you use the default publishing source for your GitHub Pages site, your site will publish automatically. You can also choose to publish your site from a different branch or folder.
You can add more pages to your site by creating more new files.
Each file will be available on your site in the same directory structure as your publishing source.
For example, if the publishing source for your project site is the gh-pages branch, and you create a new file called /about/contact-us.md on the gh-pages branch, the file will be available at https://<user>.github.io/<repository>/about/contact-us.html.
Make sure you have GitHub Pages enabled for every repository and that it's set to the branch you want to publish by checking your Pages settings at github.com/<user>/<repo>/settings/pages. If enabled, there should be a link on that page that takes you to the site.

How to post assignment .io on github?

guys I'm supposed to upload assignment for this online course..
I followed the tutorial along exactly but something is not working properly.
https://zwc1625.github.io/coursera-web24/ is the where my repo is published and it's working fine.
but,
https://zwc1625.github.io/coursera-web24/mod_2/
where mod_2 is the assignment folder containing 1 html and 1 css file,
when I try to type in this address in the url 404 comes up
My local drive is up to date with the github repo
Help. New and very frustrated with github, I'm spending so much time with this and making no progress.
Github will serve a few specifically named files automatically, like 'index.html', 'readme.md' or 'readme'. Most servers will look in the specified folder (https://zwc1625.github.io/coursera-web24/mod_2/) for files named: 'index' or 'default' with a specific extension like 'html', 'asp', 'xhtml'.
As the file in your folder 'mod_2' is called 'module2HTML.html' it will not get served automatically. Consequently, if you want to open that file in your browser, you will need to name it specifically in the URL you enter in the browser addressbar: https://zwc1625.github.io/coursera-web24/mod_2/module2HTML.html
Furthermore, when you did name your file 'index.html' it may be possible that there is a time lag between your 'commit' and Github being able to serve your page. Some patience may be required....

HUGO + GitHub Pages: How to set up subdomain

I have a github repository that I want to add my hugo site to. From the docs folder in my repository I can run github pages.
Therefore, I have changed my publishDir parameter in the hugo config to docs.
publishDir = "docs"
Now when I build hugo it ouputs everything in the docs folder which is great, the issue is running a subdomain from there.
How do I get a subdomain on hugo that is generated into my docs folder that acts like a subdomain on github pages?
I know I would need to use a CNAME and then tell it to say /docs/subdomain is actually subdomain.site.com
but I am not sure how to set that up in HUGO. and where do I put the subdomain folder? in the static folder so it would be theme_name/static/subdomain which would ouput into the docs like docs/subdomain?
If this is the way, can I use all the parameters and shortcodes in my static folder?
Also, if I need to create 2 hugo installations, one for the main site and one for the subdomain site, is their a way to share site params, configs, static files and layout files etc… ?
You have to create a custom script to create two different builds and then
Add a CNAME file to your project's repository. The content of this file must be a single line specifying the bare subdomain for your project's custom subdomain (e.g. pjname.mydomain.com).
In your DNS provider's settings, create a new CNAME record that points project name to either the root (usually denoted by #), if you have previously set up an apex domain, or to myusername.github.io if you've set up a custom subdomain. It should look something like this:
If you have two sites that you want to serve separately under two domains/subdomains (or even subpath), it's better that you create two different repositories for that.
In your username.github.io repository, you are using the "docs" folder to serve your site. However, this procedure will not work for other repositories. To serve from other repositories, name the repo whatever you like and create a "gh-pages" branch on it. The branch root must contain the entire site. You can access this site using username.github.io/your-repo-name/.
In this new repo you can add a CNAME. Hope this works. I did almost the same thing, except that I used subpaths instead of subdomains. Here's my main profile rafed.github.io and my blog rafed.github.io/devra/

Setting a GitHub pages site from a Jekyll-generated page

I cannot setup a new Jekyll-based GitHub pages site based on the tutorials I've read. Here is the full list of steps I took:
Ran jekyll new jek_test. This created a new dir.
Used GitHub desktop to create a git repository in that dir, then pushed it to a new git repository, jek_test.
In the project settings GitHub Pages panel, I choose master branch as source.
So far this had no effect I could see. Navigating to https://gadial.github.io/jek_test/ yielded a 404 error.
I added the following two lines to the projects Gemfile:
source "https://rubygems.org"
gem "github-pages", group: :jekyll_plugins
Now, after pushing to GitHub, the https://gadial.github.io/jek_test/ link is working, but the page loaded is obviously incorrect; the CSS is not loaded, the links are wrong, etc.
I guess I am missing several crucial steps, but all the tutorials I've found either go "simply push it and everything will be ok", or seem to assume I am not using a Gem-based theme, meaning all the layouts, css files etc. are explicitly stored in the _layouts directories etc.
Am I going about this the right way? What is the simplest method to get a Jekyll-generated site up and running on GitHub pages?
You are using minima which is the default so, that's not the issue but, if you have a look at your about.md you'll see that it is looking for a layout called page. You currently don't have a _layouts folder
Try creating a folder called _layouts and create a layout in that called page.html with however you want it to display the contents of all files with layout : page
The default page.html can be found here.
You will need to change url to "https://gadial.github.io" and baseurl to "/jek_test".
If this two attributes are not set up properly, Jekyll won't know where to look for your resources.