Skip to content

Commit

Permalink
Merge pull request #13 from w3f-webops/feat/netlify-cms-site-local
Browse files Browse the repository at this point in the history
Feat/netlify cms site local
  • Loading branch information
4www authored Feb 15, 2022
2 parents 8aafdb3 + 518b8a0 commit af43e54
Show file tree
Hide file tree
Showing 31 changed files with 20 additions and 298 deletions.
2 changes: 2 additions & 0 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const config = require("@w3f/gatsby-theme-w3f/.eslintrc")
module.exports = config
11 changes: 6 additions & 5 deletions gatsby-theme-w3f/src/cms/index.js → example/src/cms/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import CMS from 'netlify-cms-app';
import CMS from "netlify-cms-app";

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

const netlifyCmsGitLocal = process.env.GATSBY_NETLIFY_CMS_GIT_LOCAL === 'true';
import options from "./options";

const netlifyCmsGitLocal = process.env.GATSBY_NETLIFY_CMS_GIT_LOCAL === "true";

if (netlifyCmsGitLocal) {
options.config.local_backend = true;
options.config.backend = {
name: 'git-gateway',
name: "git-gateway",
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import collections from './collections/index';
/* theme collections */
import strings from '@w3f/gatsby-theme-w3f/src/cms/collections/strings';

const collections = [strings]

const cmsOptions = {
config: {
collections,
collections: collections,
display_url: window.location.origin,
publish_mode: 'editorial_workflow',

Expand Down
4 changes: 2 additions & 2 deletions gatsby-theme-w3f/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ module.exports = {
sourceType: 'module',
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/imports': 'off',
// Disable prop-types
'react/prop-types': 'off',
// Enable prettier rules
'prettier/prettier': 'error',
'prettier/prettier': 'off',
},
};
2 changes: 1 addition & 1 deletion gatsby-theme-w3f/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ module.exports = ({
/* call the js file, instead of yaml */
manualInit: true,
/* Netlify CMS customization code directory. */
modulePath: `${__dirname}/src/cms/index.js`,
modulePath: path.resolve('src/cms/index.js'),
/* use netlify-identity widget to login */
enableIdentityWidget: true,
publicPath: `admin`,
Expand Down
2 changes: 1 addition & 1 deletion gatsby-theme-w3f/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@w3f/gatsby-theme-w3f",
"private": false,
"description": "w3f gatsby theme",
"version": "0.0.12",
"version": "0.0.13",
"author": "W3F <[email protected]>",
"keywords": [
"gatsby"
Expand Down
28 changes: 0 additions & 28 deletions gatsby-theme-w3f/src/cms/collections/authors.js

This file was deleted.

20 changes: 0 additions & 20 deletions gatsby-theme-w3f/src/cms/collections/categories.js

This file was deleted.

8 changes: 3 additions & 5 deletions gatsby-theme-w3f/src/cms/collections/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import authors from './authors';
import categories from './categories';
import posts from './posts';
import strings from './strings';
import tags from './tags';

export default [posts, authors, tags, categories, strings];
export default {
strings
};
30 changes: 0 additions & 30 deletions gatsby-theme-w3f/src/cms/collections/posts.js

This file was deleted.

20 changes: 0 additions & 20 deletions gatsby-theme-w3f/src/cms/collections/tags.js

This file was deleted.

Empty file.
7 changes: 0 additions & 7 deletions gatsby-theme-w3f/src/cms/fields/authors/description.js

This file was deleted.

7 changes: 0 additions & 7 deletions gatsby-theme-w3f/src/cms/fields/authors/image.js

This file was deleted.

7 changes: 0 additions & 7 deletions gatsby-theme-w3f/src/cms/fields/authors/name.js

This file was deleted.

10 changes: 0 additions & 10 deletions gatsby-theme-w3f/src/cms/fields/authors/slug.js

This file was deleted.

11 changes: 0 additions & 11 deletions gatsby-theme-w3f/src/cms/fields/categories/index.js

This file was deleted.

10 changes: 0 additions & 10 deletions gatsby-theme-w3f/src/cms/fields/categories/slug.js

This file was deleted.

6 changes: 0 additions & 6 deletions gatsby-theme-w3f/src/cms/fields/categories/title.js

This file was deleted.

20 changes: 0 additions & 20 deletions gatsby-theme-w3f/src/cms/fields/posts/authors.js

This file was deleted.

7 changes: 0 additions & 7 deletions gatsby-theme-w3f/src/cms/fields/posts/body.js

This file was deleted.

20 changes: 0 additions & 20 deletions gatsby-theme-w3f/src/cms/fields/posts/categories.js

This file was deleted.

6 changes: 0 additions & 6 deletions gatsby-theme-w3f/src/cms/fields/posts/createdAt.js

This file was deleted.

7 changes: 0 additions & 7 deletions gatsby-theme-w3f/src/cms/fields/posts/excerpt.js

This file was deleted.

7 changes: 0 additions & 7 deletions gatsby-theme-w3f/src/cms/fields/posts/featuredImage.js

This file was deleted.

7 changes: 0 additions & 7 deletions gatsby-theme-w3f/src/cms/fields/posts/isFeatured.js

This file was deleted.

10 changes: 0 additions & 10 deletions gatsby-theme-w3f/src/cms/fields/posts/slug.js

This file was deleted.

20 changes: 0 additions & 20 deletions gatsby-theme-w3f/src/cms/fields/posts/tags.js

This file was deleted.

6 changes: 0 additions & 6 deletions gatsby-theme-w3f/src/cms/fields/posts/title.js

This file was deleted.

6 changes: 0 additions & 6 deletions gatsby-theme-w3f/src/cms/fields/tags/name.js

This file was deleted.

10 changes: 0 additions & 10 deletions gatsby-theme-w3f/src/cms/fields/tags/slug.js

This file was deleted.

0 comments on commit af43e54

Please sign in to comment.