👻Static Host in Github
Host Static Application in Github
Last updated
Was this helpful?
Host Static Application in Github
Last updated
Was this helpful?
Create a Static Web Application using Blazor or any Just a HTML file
Create a Github Repository.
Clone the Github Repository
Publish the Static Web Application
Copy the "Publish" files
Create the ".nojekyll", file.
Check in the code
Configure the Github Web Page
Test the same in web browser
Base URL Settings
Select the Blazor WebAssembly Standalon Application and set the Framework as .NET 8.0.
Web.Profile
" ApplicationThe pusblish file located in the "C:\Github\Web.Profile\Publish\wwwroot
".
This published files to be checked in to the Github Location, and remmeber that the root folder should have "index.html
".
Hence we should replace this wwwroot
and cut and paste in the root GitHub repository directly.
Now Create the file called ".nojekyll" file.
Checkin the code.
When we host and run in the github, the base url might have been changed for examlple
https://{weburl.github.com/{static-host}/.
This has to be changed. The above code will identify and replace based on our need.
Eg. In the above code, if it is running on the local host, the base href will be set to href="/"
, else href="/Web.Profile/"
which is the repository of Github.
Blazor Static Web Application
Host in GitHub
Host in Netlify