Skip to content

Commit af43e54

Browse files
authored
Merge pull request #13 from w3f-webops/feat/netlify-cms-site-local
Feat/netlify cms site local
2 parents 8aafdb3 + 518b8a0 commit af43e54

31 files changed

+20
-298
lines changed

example/.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const config = require("@w3f/gatsby-theme-w3f/.eslintrc")
2+
module.exports = config
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import CMS from 'netlify-cms-app';
1+
import CMS from "netlify-cms-app";
22

3-
import { LinkCTA } from './editor-components';
4-
import options from './options';
3+
import { LinkCTA } from "@w3f/gatsby-theme-w3f/src/cms/editor-components";
54

6-
const netlifyCmsGitLocal = process.env.GATSBY_NETLIFY_CMS_GIT_LOCAL === 'true';
5+
import options from "./options";
6+
7+
const netlifyCmsGitLocal = process.env.GATSBY_NETLIFY_CMS_GIT_LOCAL === "true";
78

89
if (netlifyCmsGitLocal) {
910
options.config.local_backend = true;
1011
options.config.backend = {
11-
name: 'git-gateway',
12+
name: "git-gateway",
1213
};
1314
}
1415

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import collections from './collections/index';
1+
/* theme collections */
2+
import strings from '@w3f/gatsby-theme-w3f/src/cms/collections/strings';
3+
4+
const collections = [strings]
25

36
const cmsOptions = {
47
config: {
5-
collections,
8+
collections: collections,
69
display_url: window.location.origin,
710
publish_mode: 'editorial_workflow',
811

gatsby-theme-w3f/.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ module.exports = {
2929
sourceType: 'module',
3030
},
3131
rules: {
32-
'simple-import-sort/imports': 'error',
32+
'simple-import-sort/imports': 'off',
3333
// Disable prop-types
3434
'react/prop-types': 'off',
3535
// Enable prettier rules
36-
'prettier/prettier': 'error',
36+
'prettier/prettier': 'off',
3737
},
3838
};

gatsby-theme-w3f/gatsby-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ module.exports = ({
175175
/* call the js file, instead of yaml */
176176
manualInit: true,
177177
/* Netlify CMS customization code directory. */
178-
modulePath: `${__dirname}/src/cms/index.js`,
178+
modulePath: path.resolve('src/cms/index.js'),
179179
/* use netlify-identity widget to login */
180180
enableIdentityWidget: true,
181181
publicPath: `admin`,

gatsby-theme-w3f/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@w3f/gatsby-theme-w3f",
33
"private": false,
44
"description": "w3f gatsby theme",
5-
"version": "0.0.12",
5+
"version": "0.0.13",
66
"author": "W3F <[email protected]>",
77
"keywords": [
88
"gatsby"

gatsby-theme-w3f/src/cms/collections/authors.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

gatsby-theme-w3f/src/cms/collections/categories.js

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import authors from './authors';
2-
import categories from './categories';
3-
import posts from './posts';
41
import strings from './strings';
5-
import tags from './tags';
62

7-
export default [posts, authors, tags, categories, strings];
3+
export default {
4+
strings
5+
};

gatsby-theme-w3f/src/cms/collections/posts.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)