Skip to content

Commit 3421f6e

Browse files
authored
Fix/escsp 6128 fix images not showing (#728)
* fix: update media path * fix: add absolute path for images * fix: images * fix: remove query params * fix: rollback media path * fix: tag id adding rule * fix: update tests
1 parent 025b40f commit 3421f6e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cypress/integration/subpage.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ describe('Sub section page', () => {
2626
it('Should work as expected for internal links', () => {
2727
cy.visit('/momentum/1st-level/test');
2828
cy.contains('Internal Link').click();
29-
cy.location('pathname').should('eq', '/momentum/1st-level/');
29+
cy.location('pathname').should('eq', '/momentum/1st-level');
3030
});
3131

3232
it('Should allow for relative links in the current directory', () => {
3333
cy.visit('/momentum/1st-level/test');
3434
cy.contains('Relative to current directory Link').click();
35-
cy.location('pathname').should('eq', '/momentum/1st-level/relative-link-test/');
35+
cy.location('pathname').should('eq', '/momentum/1st-level/relative-link-test');
3636
});
3737
});
3838
});

next.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const SentryPlugin = require('@sentry/webpack-plugin');
44
module.exports = {
55
reactStrictMode: true,
66
swcMinify: true,
7-
trailingSlash: true,
7+
trailingSlash: false,
88

99
// Sourcemaps are enabled to be uploaded to Sentry
1010
// Warning: Can significantly increase build times

pages/docs/[...slug].tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ const PostPage = (props: PostPageProps): JSX.Element => {
3333
const router = useRouter();
3434

3535
useEffect(() => {
36-
const path = router.asPath.split('?')[0];
36+
const [path, queryParams] = router.asPath.split('?');
3737
const tagId = router.asPath.split('#')[1];
3838

39-
router.push(path + (tagId ? '#' + tagId : ''))
39+
router.push(path + (tagId && queryParams ? '#' + tagId : ''))
4040
// eslint-disable-next-line react-hooks/exhaustive-deps
4141
}, []);
4242

0 commit comments

Comments
 (0)