Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tracking header #726

Merged
merged 11 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 7 additions & 74 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"react-measure": "^2.3.0",
"read-pkg-up": "^6.0.0",
"sentence-case": "^2.1.1",
"styled-components": "^6.1.0",
"styled-components": "^5.3.11",
"styled-system": "^5.0.18",
"worker-loader": "^3.0.2"
}
Expand Down
6 changes: 6 additions & 0 deletions theme/src/components/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ function Head(props) {
<meta property="og:description" content={description} />
<meta property="og:image" content={siteMetadata.imageUrl} />
<meta property="twitter:card" content="summary_large_image" />
{siteMetadata.primerTracking ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this use cookies at all? If so do we need to add a cookie notification when siteMetadata.primerTracking is true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. This variant is only sending basic information as an event on page load that does not rely on anything stored in a cookie.

<>
<meta name="ha-url" content="https://collector.githubapp.com/primer/collect" />
<script src="https://analytics.githubassets.com/hydro-marketing.min.js"></script>
</>
) : null}
</Helmet>
)
}
Expand Down
4 changes: 2 additions & 2 deletions theme/src/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ function PrimerNavItems({siteMetadata, items, path, pathPrefix}) {
<UnderlineNav aria-label="Main navigation" sx={{border: 'none'}}>
{items.map((item, index) => {
return (
<UnderlineNav.Link
<UnderlineNav.Item
key={index}
href={item.url}
selected={item.url === siteMetadata.header.url + (pathPrefix || '') + (path || '')}
sx={{fontSize: 2, lineHeight: 'condensed'}}
>
{item.title}
</UnderlineNav.Link>
</UnderlineNav.Item>
)
})}
</UnderlineNav>
Expand Down
3 changes: 3 additions & 0 deletions theme/src/components/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ const List = styled.ul`
}
`

export const UL = List
export const OL = styled(List).attrs({as: 'ol'})``

export default List
10 changes: 5 additions & 5 deletions theme/src/components/live-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ function LiveCode({code, language, highlight, noinline, metastring}) {
onChange={handleChange}
theme={githubTheme}
ignoreTabKey={true}
padding={theme.space[3]}
padding={theme?.space[3]}
style={{
fontFamily: theme.fonts.mono,
fontFamily: theme?.fonts.mono,
fontSize: '85%',
borderBottomLeftRadius: theme.radii[2],
borderBottomRightRadius: theme.radii[2],
borderBottomLeftRadius: theme?.radii[2],
borderBottomRightRadius: theme?.radii[2],
border: '1px solid',
borderTop: 0,
borderColor: theme.colors.border.default,
borderColor: theme?.colors.border.default,
}}
/>
</LineHighlighter>
Expand Down
6 changes: 3 additions & 3 deletions theme/src/components/wrap-root-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import HorizontalRule from './horizontal-rule'
import Image from './image'
import ImageContainer from './image-container'
import InlineCode from './inline-code'
import List from './list'
import {OL, UL} from './list'
import Note from './note'
import Paragraph from './paragraph'
import Superscript from './superscript'
Expand All @@ -37,8 +37,8 @@ const components = {
h4: H4,
h5: H5,
h6: H6,
ul: List,
ol: List.withComponent('ol'),
ul: UL,
ol: OL,
dl: DescriptionList,

// Custom components
Expand Down
Loading