I seem to be running into a problem. I am wanting to upload my website to github but see that one needs to have the main page as index.html. This is an issue as i have created an empty ASP.NET MVC application with views and controllers that have the .cshtml tag.
How can I create an index.html as the main page and then call my other main page which will be a view, this way all I am doing is getting github to look at index.html and then my main page will be displayed? by index.html calling it.
I have tried to use the following as I saw them mentioned in a few other posts but can not seem to get it to work, I know that it did change my URL but still displayed index.html
routes.IgnoreRoute("");
Here is a picture of my project folder layout
Thanks for the the future reply's! Sorry if this post is a bit messy it is my first time posting here. TO add i am trying to host on gitHub through username.github.io
As far as I know Github does not support ASP.NET, but you can use a free Azure account. Take a look at:
http://www.asp.net/hosting
find answer by S.Spieker
kindly have a look on Deploying from ASP.Net MVC to GitHub Pages using AppVeyor if you want to do via AppVeyor
Related
when I go to my website directory it shows all my files and not to my landing page, is there a way to fix this? I have tried everything even looked through the internet without any clear response. I am close to finishing my website I only need to resolve this problem.
Thank you!
The issue seems to be that you are not on the HTML file, but on the folder.
To fix this issue, you have to redirect yourself to the HTML landing page.
/ar/home.html
This should show your HTML landing page correctly rendered.
Tip: Normally, the main page is called index.html by convention. This can be helpful. For example, the Live Server extension on Visual Studio Code will automatically go to index.html if the file isn't specified. Other hosting services, like GitHub Pages, also do the same.
None of the extensions, IDEs and hosting services listed above are sponsored! They are just used for the sole purpose of examples.
In conclusion, you need to go to the HTML file, instead of the folder.
Hello I am trying to learn react right now and I tried to deploy my first web site to the github servers. The problem is that when I deployed it and I access the link the page goes blank and the js/css files can t seem do deploy as well since they get a 404 .
My code:https://github.com/ksXV/monsters
The website:https://ksxv.github.io/monsters/
I tried looking for a solution but nothing seems to work.
I have created a html file using R markdown, and when I open it in browser, it looks exactly how I want. But if I upload the same html file in github and open there, it gives me totally different outlook.
https://github.com/syedaash/ML-Project/blob/main/ML_project.html is the link of my html doc in github, which is not I want. But if I open the html file from my local computer in a browser it's good. Why is that and what to do?
GitHub does not automatically load and render an HTML file because GitHub is about code, therefore going straight to any file will display the internals of that file, not how it would be rendered on a browser.
The HTML Preview project has a way to render HTML files hosted on GitHub, you can just append your HTML path like so and put it on your README for example:
https://htmlpreview.github.io/?https://github.com/syedaash/ML-Project/blob/main/ML_project.html
However, I would recommend that you look into creating a GitHub Page for your project, you only need to make a few changes and turn it on and you got it.
Edit: So I checked on your status #Alex and it looks like you created the GitHub Page for your GitHub profile, which is not rendering your profile properly. Maybe this tutorial from codeacademy will be easier to understand that you can get GitHub Pages rendered for EVERY repo if you wish. You can see I do that with my own simple project with its live site.
If you want to see the output of the file (what it looks like when opened in a browser, you have to enable Github pages for your repository, more here. The link you sent is just the HTML text file that you have written, not what it actually would look like in a browser. Github pages hosts the HTML text file (link you sent) so that you can actually see it in a browser window.
GitHub is to share code not to deploy website. So now you should use GitHub Pages this is my sample website Hariienesh1901 hosted by GitHub Pages. See tutorial from GitHub https://guides.github.com/features/pages/
I saw multiple tutorials on YouTube for publishing my site on Github but none of them is helping me.
I created a repository on Github, then I uploaded all my files in the repository and enabled the Github Pages for it, But even after doing so, my website is not being published.
Clicking onto the link that Github Pages redirects me to a page where I can only see my repository description and nothing else.
I am attaching some images for you guys to understand better.
Please follow this steps.
Note: You need to provide your username.gihub.io as a repository name.if this matches exacty then it will work.
https://pages.github.com/
Ex. If your username is xyz then your repository name should be xyz.github.io.
All the resources use only HTML, but stuff like Cordova and Ionic work on the client, with HTML pages (and JavaScript and CSS of course), and once MVC has served a page, that page is HTML, so the hybrid tooling should be able to use it.
The only problem is that once it's served, it lacks the .html extension, but maybe I can figure a way to add this.
The reason I'd like to stick to .cshtml for my layout is that I can scaffold views from my sever-side view models, and this adds quite a lot of value for me.
If the question is: can you have .cshtml files on your mobile device, the answer is no. .cshtml file is processed on server by the Razor view machine, so plain HTML can be generated. Obviously you don't have MVC, Razor and such on your hybrid ionic app.
You can however work around it by taking your angular templates to be generated on your server by MVC. So, when you setup your templateUrl somewhere, instead of taking the relative path to your local template .html file, you can point to the controller on your server, giving the full path, with http:// and so. The controller will then generate your template for you and return as plain HTML.
Bear in mind, that angular will cache this, so it will be loaded only once.