Skip to content

How do I put all of my html, css, and javascript files inside of one src folder for better organization? #78723

Closed Answered by seyLu
DylanDevelops asked this question in Pages
Discussion options

You must be logged in to vote

Hi @DylanDevelops,

There is an npm package gh-pages that allows us to deploy to github pages programmatically.

After moving all your files under src/ directory, install gh-pages then add to your package.json:

npm i -D gh-pages
"scripts": {
+  "deploy": "gh-pages -d src",

Run the deploy script:

npm run deploy

This will create a gh-pages branch in your repo and put the stuff in your src/ directory to this branch. Then you'll have to configure in your repo settings to build and deploy from the gh-pages branch.

By this point, things should work as expected (albeit manual) and you can ignore the next step(s).


Butttttttttttt, there's always room for automation. We can leverage the powe…

Replies: 2 comments 2 replies

This comment was marked as spam.

Comment options

You must be logged in to vote
2 replies
@DylanDevelops
Comment options

@seyLu
Comment options

Answer selected by DylanDevelops
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pages Host a static website, right from your repo Question inactive This discussion has been automatically marked as inactive. This was formerly labeled stale.
3 participants