Skip to content

Commit a1bf298

Browse files
committed
0 parents  commit a1bf298

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+20293
-0
lines changed

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.hbs]
14+
insert_final_newline = false
15+
16+
[*.json]
17+
indent_size = 2
18+
19+
[*.md]
20+
trim_trailing_whitespace = false
21+
22+
[*.{yml,yaml}]
23+
indent_size = 2
24+
25+
[Makefile]
26+
indent_style = tab

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public/**
2+
plugins/**/*.js
3+
plugins/*/node_modules/*
4+
!plugins/*/src/*.js

.eslintrc.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
module.exports = {
2+
'parser': 'babel-eslint',
3+
'parserOptions': {
4+
'ecmaVersion': 6,
5+
'ecmaFeatures': {
6+
'jsx': true,
7+
'experimentalObjectRestSpread': true
8+
}
9+
},
10+
plugins: ['ghost', 'react'],
11+
extends: [
12+
'plugin:ghost/node',
13+
'plugin:ghost/ember',
14+
'plugin:react/recommended'
15+
],
16+
"settings": {
17+
"react": {
18+
"createClass": "createReactClass",
19+
"pragma": "React",
20+
"version": "16.0",
21+
"flowVersion": "0.53"
22+
},
23+
"propWrapperFunctions": ["forbidExtraProps"]
24+
},
25+
"rules": {
26+
"ghost/sort-imports-es6-autofix/sort-imports-es6": "off",
27+
"ghost/ember/use-ember-get-and-set": "off",
28+
"no-console": "off",
29+
"no-inner-declarations": "off",
30+
"valid-jsdoc": "off",
31+
"require-jsdoc": "off",
32+
"quotes": ["error", "backtick"],
33+
"consistent-return": ["error"],
34+
"arrow-body-style": [
35+
"error",
36+
"as-needed",
37+
{ "requireReturnForObjectLiteral": true }
38+
],
39+
"jsx-quotes": ["error", "prefer-double"],
40+
"semi": ["error", "never"],
41+
"object-curly-spacing": ["error", "always"],
42+
"comma-dangle": [
43+
"error",
44+
{
45+
"arrays": "always-multiline",
46+
"objects": "always-multiline",
47+
"imports": "always-multiline",
48+
"exports": "always-multiline",
49+
"functions": "ignore"
50+
}
51+
],
52+
"react/prop-types": [
53+
"error",
54+
{
55+
"ignore": ["children"]
56+
}
57+
]
58+
}
59+
};

.ghost.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"development": {
3+
"apiUrl": "https://gatsby.ghost.io",
4+
"contentApiKey": "9cc5c67c358edfdd81455149d0"
5+
},
6+
"production": {
7+
"apiUrl": "https://gatsby.ghost.io",
8+
"contentApiKey": "9cc5c67c358edfdd81455149d0"
9+
}
10+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: "\U0001F41B Bug report"
3+
about: Report reproducible software issues so we can improve
4+
5+
---
6+
7+
Welcome to the Gatsby Starter Ghost GitHub repo! 👋🎉
8+
9+
We use GitHub only for bug reports 🐛
10+
11+
Anything else should be posted to https://forum.ghost.org 👫
12+
13+
For questions related to the usage of Gatsby or GraphQL, please check out their docs at https://www.gatsbyjs.org/ and https://graphql.org/
14+
15+
🚨For support, help & questions use https://forum.ghost.org/c/help
16+
💡For feature requests & ideas you can post and vote on https://forum.ghost.org/c/Ideas
17+
18+
If your issue is with Gatsby.js itself, please report it at the Gatsby repo ➡️ https://github.com/gatsbyjs/gatsby/issues/new.
19+
20+
### Issue Summary
21+
22+
A summary of the issue and the browser/OS environment in which it occurs.
23+
24+
### To Reproduce
25+
26+
1. This is the first step
27+
2. This is the second step, etc.
28+
29+
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
30+
31+
### Technical details:
32+
33+
* Ghost Version:
34+
* Gatsby Version:
35+
* Node Version:
36+
* OS:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: "\U0001F4A1Anything else"
3+
about: "For help, support, features & ideas - please use https://forum.ghost.org \U0001F46B "
4+
5+
---
6+
7+
--------------^ Click "Preview" for a nicer view!
8+
9+
We use GitHub only for bug reports 🐛
10+
11+
Anything else should be posted to https://forum.ghost.org 👫.
12+
13+
🚨For support, help & questions use https://forum.ghost.org/c/help
14+
💡For feature requests & ideas you can post and vote on https://forum.ghost.org/c/Ideas
15+
16+
Alternatively, check out these resources below. Thanks! 😁.
17+
18+
- [Forum](https://forum.ghost.org/c/help)
19+
- [Gatsby API reference](https://docs.ghost.org/api/gatsby/)
20+
- [Content API Docs](https://docs.ghost.org/api/content/)
21+
- [Gatsby.js](https://www.gatsbyjs.org)
22+
- [GraphQL](https://graphql.org/)
23+
- [Feature Requests / Ideas](https://forum.ghost.org/c/Ideas)
24+
- [Contributing Guide](https://docs.ghost.org/docs/contributing)
25+
- [Self-hoster Docs](https://docs.ghost.org/)

.gitignore

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Node template
2+
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# Typescript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env
61+
.env.development
62+
.env.production
63+
64+
# IDE
65+
.idea/*
66+
*.iml
67+
*.sublime-*
68+
69+
# OSX
70+
.DS_Store
71+
.vscode
72+
73+
# Docs Custom
74+
.cache/
75+
public
76+
yarn-error.log
77+
.netlify/
78+
79+
# Local Netlify folder
80+
.netlify

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2013-2022 Ghost Foundation
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Gatsby Starter Ghost
2+
3+
A starter template to build lightning fast websites with [Ghost](https://ghost.org/) & [Gatsby](https://gatsbyjs.org)
4+
5+
**Demo:** https://gatsby.ghost.org/
6+
7+
 
8+
9+
![gatsby-starter-ghost](https://user-images.githubusercontent.com/120485/50913567-8ab8e380-142c-11e9-9e78-de02ded12fc6.jpg)
10+
11+
 
12+
13+
14+
# Installing
15+
16+
```bash
17+
# With Gatsby CLI
18+
gatsby new gatsby-starter-ghost https://github.com/TryGhost/gatsby-starter-ghost.git
19+
```
20+
21+
```bash
22+
# From Source
23+
git clone https://github.com/TryGhost/gatsby-starter-ghost.git
24+
cd gatsby-starter-ghost
25+
```
26+
27+
Then install dependencies
28+
29+
```bash
30+
yarn
31+
```
32+
33+
 
34+
35+
# Running
36+
37+
Start the development server. You now have a Gatsby site pulling content from headless Ghost.
38+
39+
```bash
40+
gatsby develop
41+
```
42+
43+
By default, the starter will populate content from a default Ghost install located at https://gatsby.ghost.io.
44+
45+
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.
46+
47+
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.
48+
49+
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.
50+
51+
To use this starter without issues, your Ghost installation needs to be at least on version `2.10.0`.
52+
53+
The default Ghost version that is used for this starter is `5.x`. If your Ghost installation is on a lower version, you will need to pass in a `version` property in your `.ghost.json` settings:
54+
55+
**Ghost >=2.10.0 <5.0.0**
56+
```json
57+
{
58+
"apiUrl": "https://gatsby.ghost.io",
59+
"contentApiKey": "9cc5c67c358edfdd81455149d0",
60+
"version": "v4.0"
61+
}
62+
```
63+
64+
**Ghost >=5.0.0**
65+
```json
66+
{
67+
"apiUrl": "https://gatsby.ghost.io",
68+
"contentApiKey": "9cc5c67c358edfdd81455149d0"
69+
}
70+
```
71+
72+
&nbsp;
73+
74+
# Deploying with Netlify
75+
76+
The starter contains three config files specifically for deploying with Netlify. A `netlify.toml` file for build settings, a `/static/_headers` file with default security headers set for all routes, and `/static/_redirects` to set Netlify custom domain redirects.
77+
78+
To deploy to your Netlify account, hit the button below.
79+
80+
[![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)
81+
82+
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.
83+
84+
Once deployed, you can set up a [Ghost + Netlify Integration](https://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.
85+
86+
&nbsp;
87+
88+
# Optimising
89+
90+
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.
91+
92+
&nbsp;
93+
94+
# Extra options
95+
96+
```bash
97+
# Run a production build, locally
98+
gatsby build
99+
100+
# Serve a production build, locally
101+
gatsby serve
102+
```
103+
104+
Gatsby `develop` uses the `development` config in `.ghost.json` - while Gatsby `build` uses the `production` config.
105+
106+
&nbsp;
107+
108+
# Copyright & License
109+
110+
Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE).

0 commit comments

Comments
 (0)