gatsby-theme-wirehead-tree 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,6 +15,7 @@ Specifically:
15
15
  * I want to be able to use a `type` key in the frontmatter to select the template because MDX has some weird stuff with it's native idea of templating and it doesn't really work the way I wanted it to.
16
16
  * I also want to be able to make JSX pages that have front matter in them. And I don't want to have a bunch of special-case code generating the navigational bits of the site that check if it's using JSX or MDX.
17
17
  * I wanted to mark something as a draft and have it not be published.
18
+ * I wanted to mark something as hidden and have it excluded from the page queries
18
19
 
19
20
  **WORK IN PROGRESS WARNING**: I'm totally not finished messing with this.
20
21
 
package/gatsby-node.js CHANGED
@@ -93,11 +93,19 @@ exports.onCreateNode = ({ node, actions }, pluginOptions) => {
93
93
  name: "date",
94
94
  value: node.frontmatter.date,
95
95
  });
96
- createNodeField({
97
- node,
98
- name: "hidden",
99
- value: node.frontmatter.hidden,
100
- });
96
+ if (node.frontmatter.hidden) {
97
+ createNodeField({
98
+ node,
99
+ name: "hidden",
100
+ value: node.frontmatter.hidden,
101
+ });
102
+ } else {
103
+ createNodeField({
104
+ node,
105
+ name: "hidden",
106
+ value: false,
107
+ });
108
+ }
101
109
  createNodeField({
102
110
  node,
103
111
  name: "updated",
@@ -134,6 +142,11 @@ exports.onCreateNode = ({ node, actions }, pluginOptions) => {
134
142
  name: "updated",
135
143
  value: null,
136
144
  });
145
+ createNodeField({
146
+ node,
147
+ name: "hidden",
148
+ value: null,
149
+ });
137
150
  }
138
151
  }
139
152
 
@@ -250,12 +263,12 @@ exports.createPages = async ({ actions, graphql, pathPrefix, reporter }, themeOp
250
263
  draft
251
264
  date
252
265
  updated
266
+ hidden
253
267
  }
254
268
  frontmatter {
255
269
  title
256
270
  type
257
271
  description
258
- hidden
259
272
  }
260
273
  excerpt(pruneLength: 300)
261
274
  }
@@ -291,7 +304,7 @@ exports.createPages = async ({ actions, graphql, pathPrefix, reporter }, themeOp
291
304
  title: title,
292
305
  type: node.frontmatter.type,
293
306
  date: node.fields.date,
294
- hidden: node.frontmatter.hidden,
307
+ hidden: node.fields.hidden,
295
308
  breadcrumbs: toBreadcrumb(basePath, pagePath, titles),
296
309
  excerpt: node.frontmatter.description || node.excerpt,
297
310
  updated: node.fields.updated,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-theme-wirehead-tree",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,17 +28,17 @@
28
28
  "node": ">=12.22.0"
29
29
  },
30
30
  "devDependencies": {
31
- "gatsby": "^3.3.0",
31
+ "gatsby": "^3.13.0",
32
32
  "react": "^17.0.2",
33
33
  "react-dom": "^17.0.2"
34
34
  },
35
35
  "peerDependencies": {
36
- "gatsby": "^3.3.0",
36
+ "gatsby": "^3.13.0",
37
37
  "react": "^17.0.2",
38
38
  "react-dom": "^17.0.2"
39
39
  },
40
40
  "dependencies": {
41
41
  "@babel/runtime": "^7.13.10",
42
- "gatsby-core-utils": "^2.3.0"
42
+ "gatsby-core-utils": "^2.15.0"
43
43
  }
44
44
  }