GithubHelp home page GithubHelp logo

kustomzone / blazor-wasm-github-pages-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pierre3/blazor-wasm-github-pages-template

0.0 1.0 0.0 21.37 MB

A template for Blazor WASM SPA to host on a GitHub pages.

License: MIT License

C# 31.46% HTML 49.03% CSS 19.51%

blazor-wasm-github-pages-template's Introduction

Blazor WASM GitHub Pages Template

A Blazor WebAssembly template for hosting on GitHub Pages.

This template works in the following environment.

The version of Blazor used in this template is Blazor WebAssembly 3.2.0 RC1.

Over View

This is a project template that adds the following changes to the official Blazor WebAssembly template.

  • Add the scripts needed to run a single-page application on a static site based on the methodology described in here

    • Add a custom 404.html page that rewrites the URL and redirects it to index.html
    • Add a script to index.html to handle routing
  • Change the path base to the path to the GitHub project page

    • <base href="/my-repository-name/" />
  • Added GitHub action to build pushed source code in Master branch and deploy it to gh-pages branch

Installation

Download the VSIX installer from the Visual Studio Marketplace or use the Manage extensions dialog box in Visual Studio to install it.

Usage

  1. Launch the Visual Studio 2019 Preview and select "Create a New Project".

  2. Select "Blazor GitHub Pages SPA" from the list of projects and click on the "Next" button.

image_01

  1. "Configure your new project" dialog, enter "project name" and "solution name" and click the "Create" button.
    • In the solution name, enter the name of the repository you want to create on GitHub.

image_02

  1. Once the project you created is loaded, select "Add to Source Control" from the "File" menu.

image_03

  1. In the "Initialize Git repository" dialog, select "GitHub" and enter "Solution Name" in the "Repository Name" field.

image_04

  1. When you click the "Initialize and Push" button, a repository is created on GitHub and the source code is pushed to the Master branch.

image_05

  1. When you push your code to the master branch, GitHub Actions executes the build and pushes the build artifact to the "gh-pages" branch.

image_06

  1. On your GitHub repository page, click on the Settings tab and check the GitHub Page section.

  2. After selecting "master branch" in the "Source" field pull-down, select "gh-pages branch" again.

image_07

  1. When you see "Your site is published at {URL}", click on the URL. This should take you to the Blazor Webassembly site you just created. (It will take a little while for the page to become accessible.)

image_08

blazor-wasm-github-pages-template's People

Contributors

pierre3 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.