![]() ![]() gh-pages -d dist # call inside your project with -d and the directory created by the build step.npm run build # run vite build step (edit base path in the package.json).cd create-website-with-html-tw-css # enter the project directory.npm i gh-pages -g # install gh-pages globally.It creates a new branch in your repository and uses that to create the site.įor this step the previous project does not make too much sense, so for this, we will use the same project but build with Tailwind CSS that you can find here. This way uses the gh-pages npm package that you can find here. The method described before is a really simple way to publish your website, but there is another way that is especially helpful if you use a bundler like vite that includes a build step. Host GitHub Pages through the gh-pages package Wait till the page is finished building and check the provided URL.Select a source branch for your repo (in this case, I will just use main) and save.Head to the settings page of your repository and open the pages tab.The basic way of hosting with GitHub Pages is by using the Web UI of your repository! For this example, I will use the simple portfolio website we created in this post here. Host GitHub Pages through the Web UIīefore we start publishing to the web, we need a project and an associated GitHub Repository. How to create a free GitHub Pages Website?įor a complete overview, we will first host the site to GitHub Pages through the web UI, and then do the same by using the gh-pages npm package. The repository has to be public if you are using GitHub Free, or it can be private if you use GitHub Pro. ![]() What state does the repository have to be in? The resulting URL is: .įor a subdomain, you have to create a CNAME record pointing from to .įor an apex domain, you either have to create an A record pointing to 185.199.108.153, 185.199.109.153, 185.199.110.153 or 185.199.111.153. One exception is the URL structure for a repository named like. If this guide is helpful to you and you like what I do, please support me with a coffee! ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |