@primer/gatsby-theme-doctocat 4.2.3 → 4.3.0
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/CHANGELOG.md +18 -0
- package/gatsby-config.js +5 -0
- package/package.json +1 -1
- package/src/components/header.js +26 -23
- package/src/components/nav-items.js +9 -0
- package/src/use-site-metadata.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @primer/gatsby-theme-doctocat
|
|
2
2
|
|
|
3
|
+
## 4.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`9c0bbf5`](https://github.com/primer/doctocat/commit/9c0bbf509eec35361739ad12d8acec309e2b57f9) [#534](https://github.com/primer/doctocat/pull/534) Thanks [@colebemis](https://github.com/colebemis)! - Add support for two levels of nesting in `nav.yml`:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
- title: Introduction
|
|
11
|
+
children:
|
|
12
|
+
- title: Getting started
|
|
13
|
+
- url: /getting-started
|
|
14
|
+
+ children:
|
|
15
|
+
+ - title: React
|
|
16
|
+
+ url: /getting-started/react
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Note: Items with `children` cannot also have URLs.
|
|
20
|
+
|
|
3
21
|
## 4.2.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/gatsby-config.js
CHANGED
|
@@ -5,6 +5,11 @@ module.exports = themeOptions => {
|
|
|
5
5
|
siteMetadata: {
|
|
6
6
|
title: 'Doctocat',
|
|
7
7
|
shortName: 'Doctocat',
|
|
8
|
+
header: {
|
|
9
|
+
title: 'Primer',
|
|
10
|
+
url: 'https://primer.style',
|
|
11
|
+
logoUrl: 'https://primer.style'
|
|
12
|
+
},
|
|
8
13
|
description: 'A Gatsby theme for creating Primer documentation sites',
|
|
9
14
|
imageUrl: 'https://user-images.githubusercontent.com/10384315/53922681-2f6d3100-402a-11e9-9719-5d1811c8110a.png'
|
|
10
15
|
},
|
package/package.json
CHANGED
package/src/components/header.js
CHANGED
|
@@ -31,7 +31,7 @@ function Header({isSearchEnabled}) {
|
|
|
31
31
|
>
|
|
32
32
|
<Box sx={{display: 'flex', alignItems: 'center'}}>
|
|
33
33
|
<Link
|
|
34
|
-
href=
|
|
34
|
+
href={siteMetadata.header.logoUrl}
|
|
35
35
|
sx={{
|
|
36
36
|
color: 'accent.fg',
|
|
37
37
|
mr: 3,
|
|
@@ -40,30 +40,33 @@ function Header({isSearchEnabled}) {
|
|
|
40
40
|
>
|
|
41
41
|
<StyledOcticon icon={MarkGithubIcon} size="medium" />
|
|
42
42
|
</Link>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
43
|
+
{siteMetadata.header.title ? (
|
|
44
|
+
<Link
|
|
45
|
+
href={siteMetadata.header.url}
|
|
46
|
+
sx={{
|
|
47
|
+
color: 'accent.fg',
|
|
48
|
+
fontFamily: 'mono',
|
|
49
|
+
display: [
|
|
50
|
+
// We only hide "Primer" on small viewports if a shortName is defined.
|
|
51
|
+
siteMetadata.shortName ? 'none' : 'inline-block',
|
|
52
|
+
null,
|
|
53
|
+
null,
|
|
54
|
+
'inline-block'
|
|
55
|
+
]
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
{siteMetadata.header.title}
|
|
59
|
+
</Link>
|
|
60
|
+
) : null}
|
|
60
61
|
{siteMetadata.shortName ? (
|
|
61
62
|
<>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
{siteMetadata.header.title && (
|
|
64
|
+
<Text
|
|
65
|
+
sx={{display: ['none', null, null, 'inline-block'], color: 'accent.fg', fontFamily: 'mono', mx: 2}}
|
|
66
|
+
>
|
|
67
|
+
/
|
|
68
|
+
</Text>
|
|
69
|
+
)}
|
|
67
70
|
<Link
|
|
68
71
|
as={GatsbyLink}
|
|
69
72
|
to="/"
|
|
@@ -37,6 +37,15 @@ function NavItems({items}) {
|
|
|
37
37
|
{item.children.map(child => (
|
|
38
38
|
<NavItem key={child.title} href={child.url}>
|
|
39
39
|
{child.title}
|
|
40
|
+
{child.children ? (
|
|
41
|
+
<NavList.SubNav>
|
|
42
|
+
{child.children.map(subChild => (
|
|
43
|
+
<NavItem key={subChild.title} href={subChild.url}>
|
|
44
|
+
{subChild.title}
|
|
45
|
+
</NavItem>
|
|
46
|
+
))}
|
|
47
|
+
</NavList.SubNav>
|
|
48
|
+
) : null}
|
|
40
49
|
</NavItem>
|
|
41
50
|
))}
|
|
42
51
|
</NavList.Group>
|