diff --git a/.changeset/techdocs-cats-whisper.md b/.changeset/techdocs-cats-whisper.md new file mode 100644 index 0000000000..290f8a1d7a --- /dev/null +++ b/.changeset/techdocs-cats-whisper.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Remove copyright from old footer in documentation generated with previous version of `mkdocs-techdocs-plugin` (`v0.2.2`). diff --git a/plugins/techdocs/src/reader/components/Reader.tsx b/plugins/techdocs/src/reader/components/Reader.tsx index 5f103fe535..e8ab2a4501 100644 --- a/plugins/techdocs/src/reader/components/Reader.tsx +++ b/plugins/techdocs/src/reader/components/Reader.tsx @@ -410,9 +410,20 @@ export const useTechDocsReaderDom = (entityRef: EntityName): Element | null => { .md-nav { font-size: calc(var(--md-typeset-font-size) * 0.9); } + .md-nav__link { + display: flex; + align-items: center; + justify-content: space-between; + } .md-nav__icon { - width: auto !important; - height: auto !important; + height: 20px !important; + width: 20px !important; + margin-left:${theme.spacing(1)}px; + } + .md-nav__icon svg { + margin: 0; + width: 20px !important; + height: 20px !important; } .md-nav__icon:after { width: 20px !important; @@ -424,10 +435,13 @@ export const useTechDocsReaderDom = (entityRef: EntityName): Element | null => { } .md-sidebar { + height: calc(100% - 100px); position: fixed; - bottom: 100px; width: 16rem; } + .md-sidebar .md-sidebar__scrollwrap { + max-height: calc(100% - 100px); + } .md-sidebar--secondary { right: ${theme.spacing(3)}px; } @@ -499,11 +513,14 @@ export const useTechDocsReaderDom = (entityRef: EntityName): Element | null => { display: none; } + .md-sidebar { + height: 100%; + } .md-sidebar--primary { width: 12.1rem !important; z-index: 200; left: ${ - isPinned ? 'calc(224px - 12.1rem)' : 'calc(72px - 12.1rem)' + isPinned ? 'calc(-12.1rem + 242px)' : 'calc(-12.1rem + 72px)' } !important; } .md-sidebar--secondary:not([hidden]) { diff --git a/plugins/techdocs/src/reader/transformers/simplifyMkdocsFooter.test.ts b/plugins/techdocs/src/reader/transformers/simplifyMkdocsFooter.test.ts index ac4c9fa986..fb4044f730 100644 --- a/plugins/techdocs/src/reader/transformers/simplifyMkdocsFooter.test.ts +++ b/plugins/techdocs/src/reader/transformers/simplifyMkdocsFooter.test.ts @@ -30,7 +30,7 @@ describe('simplifyMkdocsFooter', () => { expect(shadowDom.querySelector('.md-footer .md-copyright')).toBeTruthy(); }); - it('does remove mkdocs copyright', async () => { + it('does remove new mkdocs copyright', async () => { const shadowDom = await createTestShadowDom( FIXTURES.FIXTURE_STANDARD_PAGE, { @@ -41,4 +41,16 @@ describe('simplifyMkdocsFooter', () => { expect(shadowDom.querySelector('.md-footer .md-copyright')).toBeFalsy(); }); + + it('does remove old mkdocs copyright', async () => { + const shadowDom = await createTestShadowDom( + FIXTURES.FIXTURE_STANDARD_PAGE, + { + preTransformers: [simplifyMkdocsFooter()], + postTransformers: [], + }, + ); + + expect(shadowDom.querySelector('.md-footer-copyright')).toBeFalsy(); + }); }); diff --git a/plugins/techdocs/src/reader/transformers/simplifyMkdocsFooter.ts b/plugins/techdocs/src/reader/transformers/simplifyMkdocsFooter.ts index b583a72fbf..505c88dc71 100644 --- a/plugins/techdocs/src/reader/transformers/simplifyMkdocsFooter.ts +++ b/plugins/techdocs/src/reader/transformers/simplifyMkdocsFooter.ts @@ -18,9 +18,10 @@ import type { Transformer } from './transformer'; export const simplifyMkdocsFooter = (): Transformer => { return dom => { - // Remove mkdocs copyright + // Remove new mkdocs copyright dom.querySelector('.md-footer .md-copyright')?.remove(); - + // Remove old mkdocs copyright + dom.querySelector('.md-footer-copyright')?.remove(); return dom; }; };