fix(plugin-techdocs): remove both old and new footer copyright

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2022-02-24 17:35:51 +01:00
parent 6cf146869b
commit 5b0f9a75fa
4 changed files with 42 additions and 7 deletions
+5
View File
@@ -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`).
@@ -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]) {
@@ -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();
});
});
@@ -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;
};
};