Skip to content

Instantly share code, notes, and snippets.

@tejuafonja
Created March 16, 2018 12:44
Show Gist options
  • Save tejuafonja/ea56c24c38b1bc7b4afafcd7c773fb81 to your computer and use it in GitHub Desktop.
Save tejuafonja/ea56c24c38b1bc7b4afafcd7c773fb81 to your computer and use it in GitHub Desktop.
Running Ghost on github pages
download ghost (see https://medium.com/aishik/publish-with-ghost-on-github-pages-2e5308db90ae)
install node
extract ghost to /home or anywhere you'd remember. maybe /home/my-ghost or /home/ghost. You can use any name you want
run knex-migrator init
run npm install
run npm start
checkout your server on http://localhost:2368/ #everything should work fine
CNTRL-C # kill the server
buster setup YOUR-FORK-REPO
mkdir static
/**************clone your forked repo somewhere on your computer ************/
git clone https://github.com/YOUR_USERNAME/YOUR_FORK.git # clone this outside the ghost folder i.e leave /home/my-ghost or whatever you named it
cd YOUR_FORK
cp . /home/my-ghost/static
/*************************** Go back to your ghost folder
cd /home/my-ghost/static
ls # you should see you cloned repo's content
/************************************************* Cosmetics - Done only once/
git remote -v #you should have what i've pasted below - more info https://help.github.com/articles/configuring-a-remote-for-a-fork/
# origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
# origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
git remote add upstream https://github.com/Tejaf/codeitgurl.github.io.git # you only have to do this once
git remote -v
# origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
# origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
# upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
# upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
/*********************************************price you pay for not owning your server lol, not really - you do this everytime you collaborate on a project ****************/
git fetch upstream # You have to do this all the time to make sure my you pull my changes
git checkout master
git merge upstream/master # merge my changes to your forked repo so we're now on the same page
/*******************You can now start the ghost server
cd .. # step away from the static folder
npm start
go to http://localhost:2368/
# navigate to another terminal
cd /home/my-ghost/
buster generate
buster preview
# Go to your mail box, you should see the invite I sent to You under spam
# click on the link and register
# you should be in the admin panel of codeitgurl now
# write your article, preview
cd static
. update_website.sh
# Go to your github and send me a Pull request, i'd merge it and hopefully this model will work before we can afford a server
LINKS
1. https://help.github.com/articles/syncing-a-fork/
/******ignore
git fetch -all
git reset --hard origin/master
git pull origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment