Giter Site home page Giter Site logo

paladini / ghost-on-github-pages Goto Github PK

View Code? Open in Web Editor NEW
478.0 13.0 71.0 1.82 MB

Ghost on Github Pages. Build and deploy Ghost for free in a few minutes.

Home Page: http://paladini.github.io/ghost-on-github-pages-demo/

License: MIT License

Shell 92.69% HTML 7.31%
ghost github-page free hosting ghost-installation ghost-on-github-pages gh-pages ghost-blog ghost-server blog

ghost-on-github-pages's Introduction

Ghost on Github Pages

We need contributions via Pull Requests in order to maintain this as a working solution. Please, if possible send your contribution!

image

Demo Version: http://paladini.github.io/ghost-on-github-pages-demo/

Ghost is a fully open source, adaptable platform for building and running a modern online publication - a complete professional publishing platform. Now you can build your own Ghost blog for free in a few minutes. After that initial setup, it's very easy to maintain a fresh and modern blog.

Let's make a Ghost blog go live right now?

That was made possible because we've created some powerful automation scripts to deploy your Ghost blog as static content on Github Pages. Interested? Join us throughout this guide, but first check out the live demo here.

Table of Contents

Requirements

Major dependencies should be installed in your computer. This is only step currently done by your own.

Install Python 2

Install Python 2.X, because buster package doesn't support Python 3.

# Debian-based systems
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python2.7

Install NodeJS

Install a version that is officially supported by Ghost, just like Node v14.x.

# Debian-based systems
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash
sudo apt-get install -y nodejs

Install npm

NodeJS package manager from https://nodejs.org/en/

# Debian-based systems
sudo apt install npm

Besides that, there's some minor dependencies too, but they should be automatically installed for you (tested on MacOS High Sierra and Ubuntu 16.04). If needed, check out the minor dependencies here and install by yourself.

Setup

1) Download and extract ghost-on-github-pages

Download the latest version of this repository code by clicking here. After downloading the project, extract it anywhere you'll remember later. E.g: I've extract the .zip file to /home/1doctecnologia/ghost-on-github-pages:

image

2) Create a new Github repository

Create a new repository that is going to store your Ghost blog and also give you a free Github Pages domain. I've created a public Github repo called ghost-on-github-pages-demo to use as example throughout this guide.

[IMPORTANT] Copy the repository remote URL to your clipboard (SSH or HTTPS), because you will be asked to provide this later. E.g: [email protected]:paladini/ghost-on-github-pages-demo.git.

3) Install

Now we are ready to install everything needed using the script called install.sh. Open a new Terminal window, navigate to the previous extract folder and then run:

$ chmod +x install.sh
$ ./install.sh

During the process you will be asked to enter the repository remote URL that was copied to your clipboard in the previous step.

Everything will be installed at /home/YOUR_USERNAME/.ghost/ (e.g: /home/paladini/.ghost). Everything means the local Ghost server, a few static files required by GH Pages and some useful scripts for deploying your blog on Github Pages.

In the end, the script will start Ghost server and then make a first deploy to Github. All the static files generated from default Ghost blog will be commited to your Github repository. However it can take up to 10 minutes to your Ghost blog go live at http://YOUR_USERNAME.github.io/YOUR_REPOSITORY. It should look like this:

image

You can see my Ghost blog here.

4) Deploying to Github Pages

Let's customize your Ghost blog for the first time. To do that, we are going to access the administrative panel that's running at http://localhost:2373/ghost.

A Ghost initial setup screen will appear and you should complete the setup to continue. After that, you can explore the beautiful Ghost Administrative Panel and change whatever you like:

image

With some changes, you may want to see the new version of your blog online at Github Pages. Just run the script deploy.sh (located at/home/YOUR_USERNAME/.ghost/deploy.sh):

# Only for the first time
$ chmod +x ~/.ghost/deploy.sh

# Anytime you want to deploy new updates to your blog on Github Pages:
$ cd ~/.ghost
$ ./deploy.sh

The deploy.sh script will make a push to your Github repository, modifying both master and gh-pages branches with the changes you've made. The updated blog should go live very soon at the same address (http://YOUR_USERNAME.github.io/YOUR_REPOSITORY).

How to update your blog?

Whenever you want to update your blog (e.g: create a new article, change the blog theme, etc.), just open your local Ghost blog and make all desired modifications. When finished, open a Terminal window and run the following commands to deploy your changes from the local Ghost blog to Github Pages:

$ cd ~/.ghost
$ ./deploy.sh

Remember that Github takes about 10 minutes to update the website.

Example

I wrote and published a test article on my local Ghost blog:

image

After that, I opened a Terminal window, go to the Ghost installation folder ($HOME/.ghost) and then run the following command:

$ ./deploy.sh

Running the script, my updates on blog are sent to my blog on Github Pages. A few moments later I refreshed the home page of my blog and then find out my new article:

image

And that's all :)

FAQ

1) Where is located Ghost files? Ghost and all scripts you may need will be placed at .ghost folder inside your Home directory, i.e: /home/YOUR_USERNAME/.ghost.

2) Why branches master and gh-pages are equal? Currently they are mirror branches and are designed that way to facilitate GH Pages deploy. You should avoid updating them manually - our scripts handle that for you. Soon I'll be developing a lightweight version for branch gh-pages that will make it contain only static files.

3) What deploy.sh do in the background? This script is responsible for deploying updates from your local Ghost blog to your online blog at Github Pages. The general logic of the script can be read below:

If there's no Git repository at Ghost installation directory (~/.ghost/current), a new one will be created for you with all needed branches. At the same time, buster will be configured to generate static files from the running Ghost server. After that, a commit will be made to the remote repository at Github (our first deploy) containing default Ghost blog theme and configurations.

If a Git repository was found at Ghost installation path, then buster will be called to generate static files and a new commit will be pushed to remote branches on Github (master and gh-pages).

4) What's the purpose of this repository? This repository is a guide that compiles everything you need to know in order to setup and maintain your Ghost by your own, with no costs associated. It's purpose is to teach any people interested on how to setup in 20 minutes a free blog under Github Pages using Ghost blogging platform.

About

This project was created some years ago and I've made a major update on it's core in May 2018. Besides that, the documentation/guide has been almost rewritten from scratch. If you have any problems or would like to ask some questions, feel free to open an issue anytime.

References:

ghost-on-github-pages's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ghost-on-github-pages's Issues

Error - Working directory is not a recognisable Ghost installation.

I get this error after going through the steps mentioned.
Do I need to install Ghost via ghost-CLI at this location?

I'm new to this and would appreciate your help, thanks!

[INFO] Starting Ghost server...
Working directory is not a recognisable Ghost installation.
Run ghost start again within a folder where Ghost was installed with Ghost-CLI.
cp: directory /Users/abhilashjain/.ghost//current does not exist
cp: directory /Users/abhilashjain/.ghost//current does not exist
cp: /Users/abhilashjain/.ghost//current/.gitignore: No such file or directory

Navigation Links Always Point To Localhost

On Ghost Control Panel, when configuring Navigation Items Link, I can't change link to Github domain, they keep change back to localhost.

I Know this is happen on Ghost side, but are there any workaround to solve this?

screen shot 2018-06-07 at 21 54 34

"Working directory is not a recognisable Ghost installation."

Well, ghost-CLI isn't listed among the prerequisites, but okay, I've installed ghost-CLI. And I installed an instance of ghost. And I tried moving all of the ghost-on-github-pages files to that directory with that Ghost installation already in it.

./install never asked me for any info, including that url it's supposed to ask me for. No matter what I do, it says "Working directory is not a recognisable Ghost installation." Why is this happening?

deploy.sh does not upload a working Ghost static file hierarchy

Yesterday I was trying to setup Ghost in Github Pages with this tool

System : Arch Linux x64
Node: 8.11
npm: 6.1.0
yarn: 1.7.0
Ghost CLI: 1.7.3
Ghost: 1.23.0

After installing and having Ghost running in localhost without problems, when trying to deploy to github, the deploy.sh file doesn't upload all files correctly

After installing, in GHOST_PATH folder we end up with these folders

content/ 
current/ (which is a link to the latest version installed by Ghost CLI)
versions/
----> 1.23.0 (which is the latest version of Ghost today)
static/ (which is generated by buster)

Then, when you run deploy.sh, it runs a git add -A it does add all folders in GHOST_PATH, when we are really interested in the files in static, what is uploaded to github doesn't work

Adding an cd static/ before both **git add -A" make this work again, not sure if this is the more elegant solution though

Generated static file cannot render Images

The file that has been generated has a bug which I need to fix everytime I deploy.
In the static index.html file for my new Post and the home Page, it renders the image incorrectly, the file name is changed and an extra "g" or "pg" or "jpg" is getting added to the images
For ex in this tag
img class="post-card-image" srcset="content/images/size/w300/2019/06/chennai-img.jpeg 300w,
content/images/size/w600/2019/06/chennai-img.jpegg 600w,
content/images/size/w1000/2019/06/chennai-img.jpegpg 1000w,
content/images/size/w2000/2019/06/chennai-img.jpegjpg 2000w" sizes="(max-width: 1000px) 400px, 700px" src="content/images/size/w600/2019/06/chennai-img.jpeg" alt="PLODDING START TO AN ENERGETIC WIN - MY SIH 2019 EXPERIENCE">
Screenshot from 2019-06-28 21-53-39
Screenshot from 2019-06-28 21-53-52

If you see the image sources, extra text gets added at the end that i have to remove manually.
Please help

generate not working

buster generate keeps waiting for some http response:

buster generate
--2016-09-21 11:29:07--  http://drive/ghost-0.11.0/static
Resolving drive... 127.0.53.53
Connecting to drive|127.0.53.53|:80... connected.
HTTP request sent, awaiting response...

Installation script selects for Python3's pip instead of Python2's pip2

I have both Python 2 and Python 3 installed on my Fedora 27 installation. However, by default it seems like the install script runs with the python3 command instead of the python2 command.

In the install.sh script, on line 59, it checks if pip is installed on the system. However, since I have both version of python installed, by default, pip refers to the Python 3 installation whereas pip2 refers to the Python2 installation. I commented out that line. However, that shouldn't be a fix for the users of this script.

I CAN'T RUN BUSTER BECAUSE OF MISSING MODULE NAMED SERVER

Hi guys, Can someone help me?
I got this error when run buster
$ ./deploy.sh [INFO] Deploying to your Github repository... Traceback (most recent call last): File "c:\users\user\anaconda3\envs\py27\lib\runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "c:\users\user\anaconda3\envs\py27\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\Users\user\Anaconda3\envs\py27\Scripts\buster.exe\__main__.py", line 5, in <module> File "c:\users\user\anaconda3\envs\py27\lib\site-packages\buster\buster.py", line 22, in <module> import http.server ImportError: No module named server On branch master nothing to commit, working tree clean fatal: I don't handle protocol '?

But follow https://github.com/waveform80/pistreaming/issues/14 , I need to use Python3 and It will not run buster anymore ( buster is only available with python2) . Any help would be greatly appreciated.

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.