Skip to content

Commit

Permalink
feat: complete serviceless_blog_establishment post
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanyxh committed May 15, 2024
1 parent cc044d3 commit ba3b1e1
Show file tree
Hide file tree
Showing 14 changed files with 910 additions and 95 deletions.
3 changes: 2 additions & 1 deletion helpers/generateSw.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ generateSW({
cacheName: 'imageCache',
expiration: {
/** maximum cache 3 months */
maxAgeSeconds: 3 * 30 * 24 * 60 * 60
// maxAgeSeconds: 3 * 30 * 24 * 60 * 60
maxAgeSeconds: 7 * 24 * 60 * 60
},
cacheableResponse: {
statuses: [0, 200]
Expand Down
2 changes: 0 additions & 2 deletions helpers/vite-generate-sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ function viteGenerateSitemap(): PluginOption {
};
});

console.log('debug for git actions', links.length);

const smStream = new SitemapStream({ hostname: getEnv().VITE_DOMAIN_PATH });

return streamToPromise(Readable.from(links).pipe(smStream)).then((data) =>
Expand Down
7 changes: 4 additions & 3 deletions helpers/vite-prerender.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { submit } from './submit';
import type { ResolveRouteObject } from './utils';
import {
generateRouteJSON,
getEnv,
replacePlaceRoute,
resolve,
resolveFullRoutes,
ResolveRouteObject,
routesPath
} from './utils';
import { ArticleMeta } from './vite-route-generator';
import type { ArticleMeta } from './vite-route-generator';

import dayjs from 'dayjs';
import { readdirSync, readFileSync } from 'node:fs';
Expand All @@ -35,7 +35,8 @@ const excludeOutPathRewrite = [
'/examples',
'/books',
'/coder',
'/profile'
'/profile',
'/404'
];

function getMetaTag(meta: ArticleMeta | undefined, route: ResolveRouteObject) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"remark-mdx-toc": "^0.3.1",
"rollup-plugin-visualizer": "^5.12.0",
"serve": "^14.2.3",
"shiki": "^1.5.1",
"shiki": "^1.5.2",
"sitemap": "^7.1.1",
"stylelint": "^16.5.0",
"stylelint-config-recess-order": "^5.0.1",
Expand Down
84 changes: 42 additions & 42 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/coder/Wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { cloneDeep } from 'lodash-es';
import classNames from 'classnames';

import type { ResolveRouteObject } from '@/router';
import { Outlet, useHistory, useLocation, useRoute } from '@/router';
import { Outlet, useHistory, useLocation, useRoutes } from '@/router';

import styles from '@/coder/styles/Wrapper.module.less';

Expand Down Expand Up @@ -159,7 +159,7 @@ type FieldType = {
};

export default function Wrapper() {
const route = useRoute();
const route = useRoutes();
const location = useLocation();

const [open, setOpen] = useState(false);
Expand Down
Loading

0 comments on commit ba3b1e1

Please sign in to comment.