Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you publish a typescript website to GitHub Pages using Visual Studio?

So I made a Typescript project with Visual Studio. It works fine when I launch it with Visual Studio, but if I try to push it to my GitHub Pages site, it will put the index.html in a subfolder and I get a 404 error when I try to load my website. Even if I try to reference the index.html in the website url it doesn't really work.

I was wondering if it's possible to only publish the needed items. I think I would only need the subfolder. Correct me if I am wrong though.

Note: I have the GitHub extension for Visual Studio installed.

Project in VS

UPDATE:

Since some of the links don't seem to work anymore I think I should give some extra information. So basically you need to have a branch named gh-pages. On that branch you need to have an index.html file in your root folder. Then the index.html file should be visible on the github page URL.

like image 550
BuggStream Avatar asked Mar 20 '16 08:03

BuggStream


Video Answer


1 Answers

You need to push a branch named gh-pages in order to view it as a website.

Create a new branch and then move the file into the root folder of the branch, upload it to the gh-pages and you set to go.

Check this out:

https://github.com/nirgeier/JimVliet.github.io/tree/gh-pages

This is how your file should be inside your root folder.

enter image description here

like image 122
CodeWizard Avatar answered Sep 21 '22 02:09

CodeWizard