Skip to content

Commit ac7ec6c

Browse files
author
Dushyant Priyadarshee
committed
Initial commit.
As obtained from https://github.com/scttcper/gatsby-casper commit 66bd50cb4a8f9b902751de9cabdff9d0a5be8a63.
0 parents  commit ac7ec6c

Some content is hidden

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

67 files changed

+23213
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
indent_size = 2
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
jest: true,
6+
browser: true,
7+
},
8+
extends: ['xo-space/esnext', 'xo-react/space', 'xo-typescript'],
9+
rules: {
10+
'object-curly-spacing': ['error', 'always'],
11+
'@typescript-eslint/indent': ['error', 2, { SwitchCase: 1 }],
12+
'@typescript-eslint/explicit-function-return-type': 0,
13+
'capitalized-comments': 0,
14+
'comma-dangle': ['error', 'always-multiline'],
15+
'react/jsx-tag-spacing': 0,
16+
'react/prop-types': 0,
17+
'no-warning-comments': 0,
18+
'complexity': 0,
19+
},
20+
};

.gitignore

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# =========================
2+
# Node.js-Specific Ignores
3+
# =========================
4+
5+
# Build directory
6+
public/
7+
8+
# Gatsby cache
9+
.cache/
10+
11+
# Logs
12+
logs
13+
*.log
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
18+
# Runtime data
19+
pids
20+
*.pid
21+
*.seed
22+
*.pid.lock
23+
24+
# Directory for instrumented libs generated by jscoverage/JSCover
25+
lib-cov
26+
27+
# Coverage directory used by tools like istanbul
28+
coverage
29+
30+
# nyc test coverage
31+
.nyc_output
32+
33+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
34+
.grunt
35+
36+
# Bower dependency directory (https://bower.io/)
37+
bower_components
38+
39+
# node-waf configuration
40+
.lock-wscript
41+
42+
# Compiled binary addons (http://nodejs.org/api/addons.html)
43+
build/Release
44+
45+
# Dependency directories
46+
node_modules/
47+
jspm_packages/
48+
49+
# Typescript v1 declaration files
50+
typings/
51+
52+
# Optional npm cache directory
53+
.npm
54+
55+
# Optional eslint cache
56+
.eslintcache
57+
58+
# Optional REPL history
59+
.node_repl_history
60+
61+
# Output of 'npm pack'
62+
*.tgz
63+
64+
# Yarn Integrity file
65+
.yarn-integrity
66+
67+
# dotenv environment variables file
68+
.env
69+
70+
# =========================
71+
# Operating System Files
72+
# =========================
73+
74+
# OSX
75+
# =========================
76+
77+
.DS_Store
78+
.AppleDouble
79+
.LSOverride
80+
81+
# Thumbnails
82+
._*
83+
84+
# Files that might appear on external disk
85+
.Spotlight-V100
86+
.Trashes
87+
88+
# Directories potentially created on remote AFP share
89+
.AppleDB
90+
.AppleDesktop
91+
Network Trash Folder
92+
Temporary Items
93+
.apdisk
94+
95+
# Windows
96+
# =========================
97+
98+
# Windows image file caches
99+
Thumbs.db
100+
ehthumbs.db
101+
102+
# Folder config file
103+
Desktop.ini
104+
105+
# Recycle Bin used on file shares
106+
$RECYCLE.BIN/
107+
108+
# Windows Installer files
109+
*.cab
110+
*.msi
111+
*.msm
112+
*.msp
113+
114+
# Windows shortcuts
115+
*.lnk
116+
.vscode

.prettierrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"tabWidth": 2,
4+
"printWidth": 100,
5+
"singleQuote": true,
6+
"trailingComma": "all"
7+
}

LICENSE

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

README.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# gatsby-casper
2+
3+
Demo: https://gatsby-casper.netlify.com/
4+
5+
This is a static blog generator and starter gatsby repo. A port of [Casper](https://github.com/TryGhost/Casper) v2 a theme from [Ghost](https://ghost.org/) for [GatsbyJS](https://www.gatsbyjs.org/) using [TypeScript](https://www.typescriptlang.org/).
6+
7+
## Getting Started
8+
Clone this repo.
9+
10+
```
11+
git clone https://github.com/scttcper/gatsby-casper.git --depth=1
12+
```
13+
14+
Remove .git folder and setup a new one
15+
16+
```
17+
rm -rf .git && git init
18+
```
19+
20+
Edit website-config.ts with your website settings.
21+
Either disable subscribe or setup a mailchimp list and add the form action and hidden field input name.
22+
23+
Now push to whatever repo you want!
24+
25+
26+
### Progress
27+
- [x] emotion / component styles
28+
- [x] home page
29+
- [x] tag page
30+
- [x] author page
31+
- [x] blog page
32+
- [x] subscribe form - using [mailchimp](https://mailchimp.com)
33+
- [ ] full width images in markdown? - not sure if possible
34+
- [ ] multiple post authors
35+
- [ ] floating reading progress bar
36+
- [x] 404 page
37+
- [x] subscribe modal/overlay
38+
- [x] rss feed (on production build)
39+
- [x] polish ✨
40+
- [x] meta tags
41+
- [x] page titles
42+
- [x] pagination
43+
44+
### Deploy to Netlify
45+
46+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/scttcper/gatsby-casper)
47+
48+
## How to configure Google Analytics
49+
Edit `gatsby-config.js` and add your tracking ID
50+
51+
52+
```javascript
53+
{
54+
resolve: `gatsby-plugin-google-analytics`,
55+
options: {
56+
// Here goes your tracking ID
57+
trackingId: 'UA-XXXX-Y',
58+
// Puts tracking script in the head instead of the body
59+
head: true,
60+
// IP anonymization for GDPR compliance
61+
anonymize: true,
62+
// Disable analytics for users with `Do Not Track` enabled
63+
respectDNT: true,
64+
// Avoids sending pageview hits from custom paths
65+
exclude: ['/preview/**'],
66+
// Specifies what percentage of users should be tracked
67+
sampleRate: 100,
68+
// Determines how often site speed tracking beacons will be sent
69+
siteSpeedSampleRate: 10,
70+
},
71+
},
72+
```
73+
74+
## How to edit your site title and description
75+
Edit `gatsby-config.js` section `siteMetadata`
76+
77+
```javascript
78+
siteMetadata: {
79+
title: 'My awesome site name',
80+
description: 'This is a description for my site',
81+
siteUrl: 'https://mysite.com', // full path to blog - no ending slash
82+
},
83+
```
84+
85+
## How to adjust pagination
86+
In `gatsby-node.js`, edit the `postsPerPage` constant. The default value is
87+
six posts per page.

gatsby-config.js

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
siteMetadata: {
5+
title: 'Ghost',
6+
description: 'The professional publishing platform',
7+
siteUrl: 'https://gatsby-casper.netlify.com', // full path to blog - no ending slash
8+
},
9+
mapping: {
10+
'MarkdownRemark.frontmatter.author': 'AuthorYaml',
11+
},
12+
plugins: [
13+
'gatsby-plugin-sitemap',
14+
'gatsby-plugin-sharp',
15+
{
16+
resolve: 'gatsby-source-filesystem',
17+
options: {
18+
name: 'content',
19+
path: path.join(__dirname, 'src', 'content'),
20+
},
21+
},
22+
{
23+
resolve: 'gatsby-transformer-remark',
24+
options: {
25+
plugins: [
26+
{
27+
resolve: 'gatsby-remark-responsive-iframe',
28+
options: {
29+
wrapperStyle: 'margin-bottom: 1rem',
30+
},
31+
},
32+
'gatsby-remark-prismjs',
33+
'gatsby-remark-copy-linked-files',
34+
'gatsby-remark-smartypants',
35+
'gatsby-remark-abbr',
36+
{
37+
resolve: 'gatsby-remark-images',
38+
options: {
39+
maxWidth: 1170,
40+
quality: 90,
41+
},
42+
},
43+
],
44+
},
45+
},
46+
'gatsby-transformer-json',
47+
{
48+
resolve: 'gatsby-plugin-canonical-urls',
49+
options: {
50+
siteUrl: 'https://gatsby-casper.netlify.com',
51+
},
52+
},
53+
'gatsby-plugin-emotion',
54+
'gatsby-plugin-typescript',
55+
'gatsby-transformer-sharp',
56+
'gatsby-plugin-react-helmet',
57+
'gatsby-transformer-yaml',
58+
'gatsby-plugin-feed',
59+
{
60+
resolve: 'gatsby-plugin-postcss',
61+
options: {
62+
postCssPlugins: [require('postcss-color-function'), require('cssnano')()],
63+
},
64+
},
65+
{
66+
resolve: `gatsby-plugin-google-analytics`,
67+
options: {
68+
trackingId: 'UA-XXXX-Y',
69+
// Puts tracking script in the head instead of the body
70+
head: true,
71+
// IP anonymization for GDPR compliance
72+
anonymize: true,
73+
// Disable analytics for users with `Do Not Track` enabled
74+
respectDNT: true,
75+
// Avoids sending pageview hits from custom paths
76+
exclude: ['/preview/**'],
77+
// Specifies what percentage of users should be tracked
78+
sampleRate: 100,
79+
// Determines how often site speed tracking beacons will be sent
80+
siteSpeedSampleRate: 10,
81+
},
82+
},
83+
],
84+
};

0 commit comments

Comments
 (0)