mirror of
https://github.com/suitenumerique/docs
synced 2026-04-21 13:37:20 +00:00
🔧(frontend) remove deprecated routes and update service worker
- Removed the versioning route from the default configuration to streamline the documentation structure. - Updated the service worker to eliminate references to the deprecated versioning fallback, enhancing the offline experience for users.
This commit is contained in:
parent
a8a89def98
commit
42d9fa70a2
4 changed files with 0 additions and 38 deletions
|
|
@ -9,10 +9,6 @@ server {
|
|||
try_files $uri index.html $uri/ =404;
|
||||
}
|
||||
|
||||
location ~ ^/docs/(.*)/versions/(.*)/$ {
|
||||
error_page 404 /docs/[id]/versions/[versionId]/;
|
||||
}
|
||||
|
||||
location /docs/ {
|
||||
error_page 404 /docs/[id]/;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@ self.addEventListener('activate', function (event) {
|
|||
const FALLBACK = {
|
||||
offline: '/offline/',
|
||||
docs: '/docs/[id]/',
|
||||
versions: '/docs/[id]/versions/[versionId]/',
|
||||
images: '/assets/img-not-found.svg',
|
||||
};
|
||||
const precacheResources = [
|
||||
|
|
@ -104,7 +103,6 @@ const precacheResources = [
|
|||
FALLBACK.offline,
|
||||
FALLBACK.images,
|
||||
FALLBACK.docs,
|
||||
FALLBACK.versions,
|
||||
];
|
||||
|
||||
const precacheStrategy = getStrategy({
|
||||
|
|
@ -125,12 +123,6 @@ setCatchHandler(async ({ request, url, event }) => {
|
|||
case request.destination === 'document':
|
||||
if (url.pathname.match(/^\/docs\/([a-z0-9\-]+)\/$/g)) {
|
||||
return precacheStrategy.handle({ event, request: FALLBACK.docs });
|
||||
} else if (
|
||||
url.pathname.match(
|
||||
/^\/docs\/([a-z0-9\-]+)\/versions\/([a-z0-9\-]+)\/$/g,
|
||||
)
|
||||
) {
|
||||
return precacheStrategy.handle({ event, request: FALLBACK.versions });
|
||||
}
|
||||
|
||||
return precacheStrategy.handle({ event, request: FALLBACK.offline });
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
import { NextPageWithLayout } from '@/types/next';
|
||||
|
||||
import { DocLayout } from '../index';
|
||||
|
||||
const Page: NextPageWithLayout = () => {
|
||||
return null;
|
||||
};
|
||||
|
||||
Page.getLayout = function getLayout() {
|
||||
return <DocLayout />;
|
||||
};
|
||||
|
||||
export default Page;
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import { NextPageWithLayout } from '@/types/next';
|
||||
|
||||
import { DocLayout } from '../index';
|
||||
|
||||
const Page: NextPageWithLayout = () => {
|
||||
return null;
|
||||
};
|
||||
|
||||
Page.getLayout = function getLayout() {
|
||||
return <DocLayout />;
|
||||
};
|
||||
|
||||
export default Page;
|
||||
Loading…
Reference in a new issue