Skip to content

Commit

Permalink
Update readme, license and config
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiesigner committed Jan 5, 2021
1 parent 738fcc1 commit 0cee47c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 81 deletions.
25 changes: 6 additions & 19 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
Copyright (c) 2013-2020 Ghost Foundation
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
Copyright (c) 2021 Eduardo Gómez (https://eduardogomez.io)

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
91 changes: 35 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,72 @@
# Gatsby Starter Ghost
# eduardogomez.io

A starter template to build lightning fast websites with [Ghost](https://ghost.org) & [Gatsby](https://gatsbyjs.org)

**Demo:** https://gatsby.ghost.org

 

![gatsby-starter-ghost](https://user-images.githubusercontent.com/120485/50913567-8ab8e380-142c-11e9-9e78-de02ded12fc6.jpg)
The source code for my personal website built with [Gatsby](https://www.gatsbyjs.com/) and [Ghost](https://ghost.org/).

 

# Installing

Install Gatsby and clone the repository

```bash
# With Gatsby CLI
gatsby new gatsby-starter-ghost https://github.com/TryGhost/gatsby-starter-ghost.git
# Install the Gatsby CLI
npm install -g gatsby-cli
```

```bash
# From Source
git clone https://github.com/TryGhost/gatsby-starter-ghost.git
cd gatsby-starter-ghost
# Clone the repository
git clone https://github.com/eddiesigner/eduardogomez.io.git
```

Then install dependencies

```bash
yarn
npm install
```

 

# Running

Start the development server. You now have a Gatsby site pulling content from headless Ghost.
Create the file `.env.development` in the root directory and paste the following variables:

```bash
gatsby develop
NODE_ENV=development
SITEURL=http://localhost:8000
GHOST_API_URL=https://gatsby.ghost.io
GHOST_CONTENT_API_KEY=9cc5c67c358edfdd81455149d0
GTM_ID=GTM-XXXXXXX
```

By default, the starter will populate content from a default Ghost install located at https://gatsby.ghost.io.
The API URL is the URL of your Ghost site. For Ghost(Pro) customers, this is the Ghost URL ending in `.ghost.io`, and for people using the self-hosted version of Ghost, it's the same URL used to access your site.

To use your own install, you will need to edit the `.ghost.json` config file with your credentials. Change the `apiUrl` value to the URL of your Ghost site. For Ghost(Pro) customers, this is the Ghost URL ending in `.ghost.io`, and for people using the self-hosted version of Ghost, it's the same URL used to access your site.

Next, update the `contentApiKey` value to a key associated with the Ghost site. A key can be provided by creating an integration within Ghost Admin. Navigate to Integrations and click "Add new integration". Name the integration appropriately and click create.
A Content API Key can be provided by creating an integration within Ghost Admin. Navigate to Integrations and click "Add new integration". Name the integration appropriately and click create.

Finally, configure your desired URL in `siteConfig.js`, so links (e. g. canonical links) are generated correctly. You can also update other default values, such as `postsPerPage` in this file.
Start the development server. You now have a Gatsby site pulling content from headless Ghost.

To use this starter without issues, your Ghost installation needs to be at least on version `2.10.0`.
```bash
gatsby develop
```

The default Ghost version that is used for this starter is `3.x`. If your Ghost installation is on a lower version, you will need to pass in a `version` property in your `.ghost.json` settings:
Finally, configure your desired URL in `siteConfig.js`, so links (e. g. canonical links) are generated correctly. You can also update other default values, such as `postsPerPage` in this file.

**Ghost >=2.10.0 <3.0.0**
&nbsp;

```json
{
"apiUrl": "https://gatsby.ghost.io",
"contentApiKey": "9cc5c67c358edfdd81455149d0",
"version": "v2"
}
```
# Production Build

Create the file `.env.production` in the root directory, paste the same development variables and change the values accordingly.

**Ghost >=3.0.0**
```bash
# Run a production build, locally
gatsby build

```json
{
"apiUrl": "https://gatsby.ghost.io",
"contentApiKey": "9cc5c67c358edfdd81455149d0"
}
# Serve a production build, locally
gatsby serve
```

Gatsby `develop` uses the `development` variables in `.env.development` - while Gatsby `build` uses the `production` variables in `.env.production`.

&nbsp;

# Deploying with Netlify
Expand All @@ -78,9 +75,9 @@ The starter contains three config files specifically for deploying with Netlify.

To deploy to your Netlify account, hit the button below.

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/TryGhost/gatsby-starter-ghost)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/eddiesigner/eduardogomez.io)

Content API Keys are generally not considered to be sensitive information, they exist so that they can be changed in the event of abuse; so most people commit it directly to their `.ghost.json` config file. If you prefer to keep this information out of your repository you can remove this config and set [Netlify ENV variables](https://www.netlify.com/docs/continuous-deployment/#build-environment-variables) for production builds instead.
Content API Keys must be set as [Netlify ENV variables](https://www.netlify.com/docs/continuous-deployment/#build-environment-variables) for production builds.

Once deployed, you can set up a [Ghost + Netlify Integration](https://docs.ghost.org/integrations/netlify/) to use deploy hooks from Ghost to trigger Netlify rebuilds. That way, any time data changes in Ghost, your site will rebuild on Netlify.

Expand All @@ -91,21 +88,3 @@ Once deployed, you can set up a [Ghost + Netlify Integration](https://docs.ghost
You can disable the default Ghost Handlebars Theme front-end by enabling the `Make this site private` flag within your Ghost settings. This enables password protection in front of the Ghost install and sets `<meta name="robots" content="noindex" />` so your Gatsby front-end becomes the source of truth for SEO.

&nbsp;

# Extra options

```bash
# Run a production build, locally
gatsby build

# Serve a production build, locally
gatsby serve
```

Gatsby `develop` uses the `development` config in `.ghost.json` - while Gatsby `build` uses the `production` config.

&nbsp;

# Copyright & License

Copyright (c) 2013-2020 Ghost Foundation - Released under the [MIT license](LICENSE).
12 changes: 6 additions & 6 deletions src/utils/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ module.exports = {
postsPerPage: 10, // Number of posts shown on paginated pages (changes this requires sometimes to delete the cache)

siteTitleMeta: `Eduardo Gómez`, // This allows an alternative site title for meta data for pages.
siteDescriptionMeta: `A starter template to build amazing static websites with Ghost and Gatsby`, // This allows an alternative site description for meta data for pages.
siteDescriptionMeta: `Eduardo Gómez. Frontend Engineer. Designer.`, // This allows an alternative site description for meta data for pages.

shareImageWidth: 1000, // Change to the width of your default share image
shareImageHeight: 523, // Change to the height of your default share image
shareImageWidth: 1200, // Change to the width of your default share image
shareImageHeight: 636, // Change to the height of your default share image

shortTitle: `Ghost`, // Used for App manifest e.g. Mobile Home Screen
shortTitle: `Eduardo Gómez`, // Used for App manifest e.g. Mobile Home Screen
siteIcon: `favicon.png`, // Logo in /static dir used for SEO, RSS, and App manifest
backgroundColor: `#e9e9e9`, // Used for Offline Manifest
themeColor: `#15171A`, // Used for Offline Manifest
backgroundColor: `#ffffff`, // Used for Offline Manifest
themeColor: `#1f1f20`, // Used for Offline Manifest
}

0 comments on commit 0cee47c

Please sign in to comment.