Skip to content

Commit b8d9803

Browse files
committed
Update example site
1 parent 6ad8f22 commit b8d9803

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

examples/example-site/content/blog/hello-world/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ const Wrapper = styled.section`
1818
}
1919
`
2020

21+
// highlight-start
2122
export default function MyComponent({ children }) {
2223
return <Wrapper>{children}</Wrapper>;
2324
}
25+
// highlight-end
2426
```
2527

2628
```js

examples/example-site/src/components/layout.js

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react"
2+
import Helmet from "react-helmet"
23
import { Link } from "gatsby"
34

45
import { rhythm, scale } from "../utils/typography"
@@ -52,22 +53,33 @@ class Layout extends React.Component {
5253
)
5354
}
5455
return (
55-
<div
56-
style={{
57-
marginLeft: `auto`,
58-
marginRight: `auto`,
59-
maxWidth: rhythm(24),
60-
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`,
61-
}}
62-
>
63-
<header>{header}</header>
64-
<main>{children}</main>
65-
<footer>
66-
© {new Date().getFullYear()}, Built with
67-
{` `}
68-
<a href="https://www.gatsbyjs.org">Gatsby</a>
69-
</footer>
70-
</div>
56+
<>
57+
<Helmet>
58+
<style children={`
59+
.vscode-highlight {
60+
--vscode-highlight-line-highlighted-background-color: rgba(255, 255, 255, 0.1); /* default: transparent */
61+
--vscode-highlight-line-highlighted-border-color: rgba(255, 255, 255, 0.6); /* default: transparent */
62+
--vscode-highlight-line-highlighted-border-width: 2px; /* default: 2px */
63+
}
64+
`} />
65+
</Helmet>
66+
<div
67+
style={{
68+
marginLeft: `auto`,
69+
marginRight: `auto`,
70+
maxWidth: rhythm(24),
71+
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`,
72+
}}
73+
>
74+
<header>{header}</header>
75+
<main>{children}</main>
76+
<footer>
77+
© {new Date().getFullYear()}, Built with
78+
{` `}
79+
<a href="https://www.gatsbyjs.org">Gatsby</a>
80+
</footer>
81+
</div>
82+
</>
7183
)
7284
}
7385
}

0 commit comments

Comments
 (0)