gatsby-theme-carbon 1.27.2 → 1.27.3
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/gatsby-config.js
CHANGED
package/gatsby-node.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const mkdirp = require('mkdirp');
|
|
4
|
+
const startCase = require('lodash.startcase');
|
|
4
5
|
|
|
5
6
|
exports.onPreBootstrap = ({ store, reporter }) => {
|
|
6
7
|
const { program } = store.getState();
|
|
@@ -31,12 +32,35 @@ exports.onCreatePage = (
|
|
|
31
32
|
const MdxNode = getNodesByType('Mdx').find(
|
|
32
33
|
({ fileAbsolutePath }) => fileAbsolutePath === page.component
|
|
33
34
|
);
|
|
35
|
+
let frontmatter = {
|
|
36
|
+
...page.context.frontmatter,
|
|
37
|
+
};
|
|
34
38
|
|
|
35
39
|
const { titleType = 'page' } = pluginOptions;
|
|
36
40
|
const { createPage, deletePage } = actions;
|
|
37
41
|
const [relativePagePath] = page.componentPath
|
|
38
42
|
.split('src/pages')
|
|
39
43
|
.splice('-1');
|
|
44
|
+
|
|
45
|
+
// Inject titles and descriptions for pages that don't include them
|
|
46
|
+
if (!frontmatter.title) {
|
|
47
|
+
const title = page.path
|
|
48
|
+
.split('/')
|
|
49
|
+
.filter((part) => part)
|
|
50
|
+
.map((part) => startCase(part))
|
|
51
|
+
.join(' / ');
|
|
52
|
+
|
|
53
|
+
frontmatter = {
|
|
54
|
+
description: title,
|
|
55
|
+
...frontmatter,
|
|
56
|
+
title,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (MdxNode) {
|
|
61
|
+
Object.assign(MdxNode, { frontmatter });
|
|
62
|
+
}
|
|
63
|
+
|
|
40
64
|
deletePage(page);
|
|
41
65
|
createPage({
|
|
42
66
|
...page,
|
|
@@ -44,6 +68,7 @@ exports.onCreatePage = (
|
|
|
44
68
|
...page.context,
|
|
45
69
|
relativePagePath,
|
|
46
70
|
titleType,
|
|
71
|
+
frontmatter,
|
|
47
72
|
MdxNode,
|
|
48
73
|
},
|
|
49
74
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-theme-carbon",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "vpicone <vp@vincepic.one> (@vpicone)",
|
|
6
6
|
"repository": {
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"gatsby-source-filesystem": "^2.2.2",
|
|
60
60
|
"gatsby-source-medium-feed": "^1.0.6",
|
|
61
61
|
"gatsby-transformer-yaml": "^2.3.1",
|
|
62
|
+
"lodash.startcase": "^4.4.0",
|
|
62
63
|
"lodash.throttle": "^4.1.1",
|
|
63
64
|
"mkdirp": "^1.0.3",
|
|
64
65
|
"node-sass": "^4.11.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
position: relative;
|
|
23
23
|
display: inline-block;
|
|
24
24
|
transition: color $transition--base;
|
|
25
|
-
color:
|
|
25
|
+
color: $text-01;
|
|
26
26
|
text-decoration: none;
|
|
27
27
|
margin-left: $spacing-05;
|
|
28
28
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
content: '\21B3'; //"↳"
|
|
38
38
|
position: absolute;
|
|
39
39
|
left: -$spacing-05;
|
|
40
|
-
color:
|
|
40
|
+
color: $text-01;
|
|
41
41
|
transition: color $transition--base;
|
|
42
42
|
cursor: pointer;
|
|
43
43
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
top: 0;
|
|
6
6
|
right: 0;
|
|
7
7
|
width: calc(100% - 3rem);
|
|
8
|
+
z-index: 2;
|
|
8
9
|
@include carbon--breakpoint('lg') {
|
|
9
10
|
position: static;
|
|
10
11
|
width: auto;
|
|
@@ -109,7 +110,7 @@ header.header {
|
|
|
109
110
|
border-top: 1px solid transparent;
|
|
110
111
|
display: flex;
|
|
111
112
|
align-items: center;
|
|
112
|
-
z-index:
|
|
113
|
+
z-index: 3;
|
|
113
114
|
&:focus {
|
|
114
115
|
outline: 2px solid $carbon--white-0;
|
|
115
116
|
outline-offset: -2px;
|
|
@@ -121,6 +122,10 @@ header.header {
|
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
.collapsed {
|
|
126
|
+
z-index: 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
124
129
|
.header .header-button {
|
|
125
130
|
flex-shrink: 0;
|
|
126
131
|
transition: background-color $duration--fast-02 $carbon--standard-easing;
|
|
@@ -103,7 +103,7 @@ const DefaultChildren = () => (
|
|
|
103
103
|
Carbon Design System
|
|
104
104
|
</SwitcherLink>
|
|
105
105
|
<SwitcherLink href="https://www.ibm.com/standards/web/carbon-for-ibm-dotcom/">
|
|
106
|
-
Carbon for IBM.com
|
|
106
|
+
Carbon for IBM.com
|
|
107
107
|
</SwitcherLink>
|
|
108
108
|
<SwitcherLink href="https://www.ibm.com/design/event/">
|
|
109
109
|
IBM Event Design
|
|
@@ -128,6 +128,9 @@ const DefaultChildren = () => (
|
|
|
128
128
|
<SwitcherLink href="https://w3.ibm.com/design/" isInternal>
|
|
129
129
|
IBM Design
|
|
130
130
|
</SwitcherLink>
|
|
131
|
+
<SwitcherLink href="https://www.ibm.com/design/racial-equity-in-design">
|
|
132
|
+
Racial Equity in Design
|
|
133
|
+
</SwitcherLink>
|
|
131
134
|
</>
|
|
132
135
|
);
|
|
133
136
|
|