Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 3080

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 61k
Author
Asked: November 26, 20242024-11-26T11:24:08+00:00 2024-11-26T11:24:08+00:00

The starter template you need – part 3

  • 61k

In case you missed , here you can read other parts :

  • Part 1
  • Part 2
  • Part 3, this post

Part 2 Completed – What have we achieved so far ??

So far, we have “saved” our project starter in our GitHub space.

The next goal is to see this page published over the Web.

In order to achive that, we'll use a feature of Github called GitHub Pages
Put simply, every repository on gitHub can have a “live” website , hosted by GitHub server.

Let's go !

3.1 Build your GitHub Pages URL

First of all, IT IS NOT YOUR GITHUB REPO LINK!

The url follows this syntax :

https://<github-name>.github.io/<github-repo-name>/ 
Enter fullscreen mode Exit fullscreen mode

As example, assuming :

  • github-name is mister-blue
  • github-repo-name is my-starter.

My GitHub Pages URL will be

https://mister-blue.github.io/my-starter/ 
Enter fullscreen mode Exit fullscreen mode

Keep this URL written somewhere.

3.2 Configure Deploy to GitHub Pages

Open terminal and navigate to my-starter directory (done in part 1).

In case you deleted, follow part 2, and make a clone of it and navigate inside that instead.

First step is to install the package gh-pages.

So run this command

npm i -D gh-pages 
Enter fullscreen mode Exit fullscreen mode

Then open package.json file with a text editor and remove this line

"main": "index.js", 
Enter fullscreen mode Exit fullscreen mode

In package.json, add also these lines, replacing <github-pages-url> with your url builded on 3.1 step.

{   "scripts": {     "start": ...,// already here     "build": ..., // already here     "build:gh-pages": "parcel build ./src/index.html --public-url "<github-pages-url>"",     "predeploy": "npm run build:gh-pages",     "deploy": "gh-pages -d dist"   } } 
Enter fullscreen mode Exit fullscreen mode

Example , assuming <github-pages-url is https://mister-blue.github.io/my-starter/ :

"build:gh-pages": "parcel build ./src/index.html --public-url "https://mister-blue.github.io/my-starter/"", 
Enter fullscreen mode Exit fullscreen mode

3.3 Deploy!

Run this command

npm run deploy 
Enter fullscreen mode Exit fullscreen mode

To test your Deployed GitHub Pages you have two option:

  • Open your GitHub Pages Link with the browser.
  • Open your GitHub Repository page, click on Settings => Pages and you ll find your url at the top.

3.4 Update your starter on Github

The last time we pushed our local code to GitHub is at the end of part 2, so if now we start another clone all steps done in part 3 aren't there.

So we update the GitHub repo (remote repo) with our local changes.

Run

git add . 
Enter fullscreen mode Exit fullscreen mode

git commit -m "Added GitHub Pages" 
Enter fullscreen mode Exit fullscreen mode

git push origin master 
Enter fullscreen mode Exit fullscreen mode

Conclusion

In these blog series , we covered a lot of stuff that at first glance seems intimidating.
Don't worry if you don't understand what some command does or what some step requires you to do.
The idea of this blogpost is to start from a practical working scenario, then you do your research in a reverse engineering manner.

If you found this blogpost interesting, if something is not clear or you get some error, let me know in the comments.

beginnersjavascripttutorialwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    ES6 - A beginners guide - Template Literals

    • 0 Answers
  • Author

    Understanding Higher Order Functions in JavaScript.

    • 0 Answers
  • Author

    Build a custom video chat app with Daily and Vue.js

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.