@primer/gatsby-theme-doctocat 4.2.3 → 4.4.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 +24 -0
- package/gatsby-config.js +5 -0
- package/gatsby-node.js +1 -1
- package/package.json +1 -1
- package/src/components/header.js +26 -23
- package/src/components/nav-items.js +9 -0
- package/src/primer-nav.yml +0 -2
- package/src/use-site-metadata.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @primer/gatsby-theme-doctocat
|
|
2
2
|
|
|
3
|
+
## 4.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`cdd5f08`](https://github.com/primer/doctocat/commit/cdd5f08e47905ec3224dd9843974ecb711f95235) [#541](https://github.com/primer/doctocat/pull/541) Thanks [@maximedegreve](https://github.com/maximedegreve)! - Remove news from the menu
|
|
8
|
+
|
|
9
|
+
## 4.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`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`:
|
|
14
|
+
|
|
15
|
+
```diff
|
|
16
|
+
- title: Introduction
|
|
17
|
+
children:
|
|
18
|
+
- title: Getting started
|
|
19
|
+
- url: /getting-started
|
|
20
|
+
+ children:
|
|
21
|
+
+ - title: React
|
|
22
|
+
+ url: /getting-started/react
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Note: Items with `children` cannot also have URLs.
|
|
26
|
+
|
|
3
27
|
## 4.2.3
|
|
4
28
|
|
|
5
29
|
### 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/gatsby-node.js
CHANGED
|
@@ -44,7 +44,7 @@ exports.createPages = async ({graphql, actions}, themeOptions) => {
|
|
|
44
44
|
const rootAbsolutePath = path.resolve(process.cwd(), themeOptions.repoRootPath || '.')
|
|
45
45
|
|
|
46
46
|
const fileRelativePath = path.relative(rootAbsolutePath, node.fileAbsolutePath)
|
|
47
|
-
const defaultBranch = themeOptions.defaultBranch || '
|
|
47
|
+
const defaultBranch = themeOptions.defaultBranch || 'main'
|
|
48
48
|
const editUrl = getEditUrl(repo, fileRelativePath, defaultBranch)
|
|
49
49
|
|
|
50
50
|
let contributors = []
|
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>
|
package/src/primer-nav.yml
CHANGED