@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/gatsby-theme-doctocat",
3
- "version": "4.2.3",
3
+ "version": "4.3.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -31,7 +31,7 @@ function Header({isSearchEnabled}) {
31
31
  >
32
32
  <Box sx={{display: 'flex', alignItems: 'center'}}>
33
33
  <Link
34
- href="https://primer.style"
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
- <Link
44
- href="https://primer.style"
45
- sx={{
46
- color: 'accent.fg',
47
- fontFamily: 'mono',
48
- display: [
49
- // We only hide "Primer" on small viewports if a shortName is defined.
50
- siteMetadata.shortName ? 'none' : 'inline-block',
51
- null,
52
- null,
53
- 'inline-block'
54
- ]
55
- }}
56
- >
57
- Primer
58
- </Link>
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
- <Text
63
- sx={{display: ['none', null, null, 'inline-block'], color: 'accent.fg', fontFamily: 'mono', mx: 2}}
64
- >
65
- /
66
- </Text>
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>
@@ -7,6 +7,11 @@ function useSiteMetadata() {
7
7
  siteMetadata {
8
8
  title
9
9
  shortName
10
+ header {
11
+ title
12
+ url
13
+ logoUrl
14
+ }
10
15
  description
11
16
  imageUrl
12
17
  }