Skip to content

Commit 54ac269

Browse files
authored
[TOC] Fix bug to render TOC on section content pages (Shopify#10473)
### WHY are these changes introduced? Fixes Shopify#10472. Fixes issue where Table of Contents was not rendering on content pages. ### WHAT is this pull request doing? Updates conditional logic to render TOC on content pages. Adds in missing title and description on Polaris-Migrator page. Resolves console warning regarding source element `srcset` attribute. <details> <summary>Warning example</summary> <img src="https://github.com/Shopify/polaris/assets/26749317/d68f9e91-5871-40bf-8f08-d40c9632bd76" alt="Warning example"> </details> <!-- ℹ️ Delete the following for small / trivial changes --> ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 178e973 commit 54ac269

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

polaris.shopify.com/content/tools/polaris-for-vscode.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ order: 1
1111
<Lede>{frontmatter.description}</Lede>
1212

1313
<picture>
14-
<source srcset="/images/tools/polaris-for-vscode/polaris-for-vscode-preview.png" media="(prefers-reduced-motion: reduce)"></source>
15-
<img style={{maxWidth: "100%" }} srcset="/images/tools/polaris-for-vscode/polaris-for-vscode-preview.gif" alt="Demo of Polaris for VS Code tokens autocomplete" />
14+
<source
15+
srcSet="/images/tools/polaris-for-vscode/polaris-for-vscode-preview.png"
16+
media="(prefers-reduced-motion: reduce)"
17+
></source>
18+
<img
19+
style={{maxWidth: '100%'}}
20+
srcSet="/images/tools/polaris-for-vscode/polaris-for-vscode-preview.gif"
21+
alt="Demo of Polaris for VS Code tokens autocomplete"
22+
/>
1623
</picture>
1724

1825
## Features

polaris.shopify.com/content/tools/polaris-migrator.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@ icon: ReplaceMajor
66
order: 3
77
---
88

9+
# {frontmatter.title}
10+
11+
<Lede>{frontmatter.description}</Lede>
12+
913
[<img src="https://img.shields.io/npm/v/@shopify/polaris-migrator.svg?labelColor=f9f9f9&color=dcf5f0" alt="npm version" style={{width: "95px"}} />](https://www.npmjs.com/package/@shopify/polaris-migrator)
1014

1115
<picture>
12-
<source srcset="/images/tools/polaris-migrator/polaris-migrator-demo.png" media="(prefers-reduced-motion: reduce)"></source>
13-
<img style={{maxWidth: "100%"}} srcset="/images/tools/polaris-migrator/polaris-migrator-demo.gif" alt="Demo of Polaris migrator" />
16+
<source
17+
srcSet="/images/tools/polaris-migrator/polaris-migrator-demo.png"
18+
media="(prefers-reduced-motion: reduce)"
19+
></source>
20+
<img
21+
style={{maxWidth: '100%'}}
22+
srcSet="/images/tools/polaris-migrator/polaris-migrator-demo.gif"
23+
alt="Demo of Polaris migrator"
24+
/>
1425
</picture>
1526

1627
## Usage

polaris.shopify.com/content/tools/stylelint-polaris.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ keywords:
2727

2828
<picture>
2929
<source
30-
srcset="/images/tools/stylelint-polaris/stylelint-demo.png"
30+
srcSet="/images/tools/stylelint-polaris/stylelint-demo.png"
3131
media="(prefers-reduced-motion: reduce)"
3232
/>
3333
<img
34-
srcset="/images/tools/stylelint-polaris/stylelint-demo.gif"
34+
srcSet="/images/tools/stylelint-polaris/stylelint-demo.gif"
3535
alt="Demo of Stylelint Polaris"
3636
style={{width: '100%'}}
3737
/>

polaris.shopify.com/pages/[...slug].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const CatchAllTemplate = ({
9696
<Page
9797
editPageLinkPath={editPageLinkPath}
9898
isContentPage={isContentPage}
99-
showTOC={showTOC}
99+
showTOC={showTOC || isContentPage}
100100
>
101101
<PageMeta title={title} description={seoDescription} noIndex={noIndex} />
102102
<Markdown

0 commit comments

Comments
 (0)