Use html/javascript files from master branch for github page - github

My project is a javascript doohicky, and so the entirety of the code is in javascript/html/css. In order to host the project, I created a github page.
Is there a way for the github page to "point to" the javascript and html in my main branch?
For example: My main branch has an index.html, is there a way to tell github to use this index.html as the gh page's index page?

Nope, no way to do that (Google Code can do that, AFAIK). The best you can do is:
a) make the gh-pages branch a branch of master (instead of resetting it) and just git rebase the gh-pages branch to the master branch every time you make an update to the master
or,
b) make the index.html page "smart" in the way that it is hosted on the gh-pages branch but is just an empty "shell" page which fetches its content from the master branch. I imagine this could be done via an iframe that covers the entire page and points to the index.html in the master branch (thus, effectively, the iframe becomes the page). Alternately, the webpage on the gh-pages branch could dynamically fetch content from the master branch via AJAX+GitHub API, and then inject the fetched content into itself (this is just for HTML content, since scripts and styles are easily injected via and tags).
I usually take approach a) for projects that are basically webapps.

Related

Why do GitHub workflow badges not render on Jekyll GitHub pages?

My GitHub Pages site is built from the master branch, using my README.md. The top of my read-me file is directly below.
![pytest](https://github.com/preritdas/wooster-trading-systems/actions/workflows/pytest.yml/badge.svg)
![coverage-badge](tests/badge.svg)
![version](https://img.shields.io/badge/python-3.10-blue)
![maintenance-status](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)
![firebase](https://github.com/preritdas/wooster-trading-systems/actions/workflows/firebase-hosting-merge.yml/badge.svg)
![pages-build-deployment](https://github.com/preritdas/wooster-trading-systems/actions/workflows/pages/pages-build-deployment/badge.svg)
# :chart_with_upwards_trend: :robot: Wooster Systems :moneybag: :money_with_wings:
This looks just fine in the read-me inside the repository. Image below.
Unfortunately, the workflow status badges don't populate on the Jekyll GitHub Pages site. Specifically, the badges that come directly from GitHub don't show, but the rest do. The ones that don't show are tests, firebase deployment, and pages-build-deployment. A screenshot from the site is below.
I'm not sure why this is happening. My hunch is that it has to do with the fact that my repository is private, but what has me confused is the fact that the coverage badge comes from an SVG file directly in my private repository. This works fine on the site (possibly has to do with "artifacts", though I don't really understand the behavior). If the workflow badges are indeed private, how can I make them display on my site?
The only config file (or file that has anything to do with the GitHub Pages site) is my _config.yml, which has the following contents.
theme: jekyll-theme-cayman
plugins:
- jemoji
I installed added jemoji to support the emoji shortcode in my title, which works fine.
Any help appreciated.
Private repositories are not publicly visible. For security, any requests to them from an account without the right credentials will get a 404, so you can't guess which repositories exist.
Because the repository isn't available, your workflows and their results aren't public either. If you want a developer on your team to have the build status, invite them to your private repository. If you want your builds to be publicly visible, open source your repository.
It can be because this tags are alterated because of github actions, so they update and change on the Repository, Github pages treats different the information so this tags are nos updating when you are accessing the web page.
Live tags from Shields.io doesn't work properly on github pages.

Adding pages to Github Pages

I have a website with a url like mywebsite.github.io . I want to create mywebsite.github.io/robots.txt.
I know that this can be done by setting up a new repository and adding gh-pages branch but how can I do this from my main repository?
When you created your Github page, it made a new repo with the contents of it.
It will be called .github.io, where is... your user name.
Add files there.
https://guides.github.com/features/pages/

Why isn't this static project page showing up on a Jekyll-generated user page on GitHub Pages?

I have a user page generated with Jekyll, it works fine, it even has a 404 custom page. But now I'd like to have a project page that is just plain HTML, CSS and JavaScript (no Node.js nor Jekyll), showing up as my_acount.github.io/project_repo/. I uploaded the content, added a blank file with the name .nojekyll, and created a duplicate branch with the name gh-pages which is the one selected in the settings for GitHub Pages, but when I visit https://my_acount.github.io/project_repo/ the browser shows a 404 page that is not the custom page for https://my_acount.github.io, and the content in the index.html page in project_repo is not shown.
Is it posible to have a configuration to show my project page hosted as a subfolder of the user page, without having to add it as a submodule or subfolder to the user website repository? If so, why isn't my configuration working?
It seems that github pages doesn't publish by default.
I succeeded to publish by doing :
fork https://github.com/1j01/jspaint
go to repo settings (https://github.com/username/reponame/settings)
in GitHub Pages section, switch source list to master branch and click save.
switch back to gh-pages branch and click save
Project is now published.

Travis-CI urls point to my fork

I am integrating travis-ci and I need to include the url to the build status points to my fork.
If I create a PR, they will have to change README.md and redirect that.
[![Build Status](https://travis-ci.org/FORK_USER/PROJECT.svg?branch=master)](https://travis-ci.org/FORK_USER/PROJECT)
How do I replace FORK_USER with something that works once the PR is merged?
You can't. Github markdown simply does not have any placeholder functionality for repos, users, etc. It's been a feature request for a long time too.

Is there a way to remove repository name from github page link?

I created a page for a github repository following these instructions:Getting Started with GitHub Pages. Worked perfectly, the page is already hosted.
But I would like to change the page URL, This is the currently URL: http://myusername.github.io/repositoryName/
Is there any way to remove the repository name? (http://myusername.github.io/)
I've seen the articles to configure a custom domain, but I think that's not the case.
To remove the repository name, you'll need to make it a User Page (or an Organization page). Create a repository named myusername.github.io, and commit your content to the master branch. See this help page for more information.