Skip to content

Commit 9bb6e79

Browse files
committed
doc: add changelog to site
1 parent ae01387 commit 9bb6e79

File tree

9 files changed

+43
-2066
lines changed

9 files changed

+43
-2066
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module.exports = {
7070
'no-var': 'error',
7171
'no-console': [2, { allow: ['warn', 'error'] }],
7272
'object-shorthand': 2,
73-
'no-unused-vars': [2, { ignoreRestSiblings: true, argsIgnorePattern: '^h$' }],
73+
'no-unused-vars': [2, { ignoreRestSiblings: true, argsIgnorePattern: '^_' }],
7474
'no-undef': 2,
7575
camelcase: 'off',
7676
'no-extra-boolean-cast': 'off',

CHANGELOG.en-US.md

Lines changed: 4 additions & 1020 deletions
Large diffs are not rendered by default.

CHANGELOG.zh-CN.md

Lines changed: 4 additions & 1024 deletions
Large diffs are not rendered by default.

plugin/md/markdown/markdown.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ export const createMarkdownRenderer = (options: MarkdownOptions = {}): MarkdownR
6969
.use(emoji)
7070
.use(anchor, {
7171
slugify,
72-
permalink: false,
72+
permalink: anchor.permalink.linkInsideHeader({
73+
symbol: `
74+
<span aria-hidden="true" class="anchor">#</span>
75+
`,
76+
}),
7377
permalinkBefore: true,
7478
permalinkSymbol: '#',
7579
permalinkAttrs: () => ({ 'aria-hidden': true }),

site/src/hooks/useMenus.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ const useMenus = (): {
4747
}
4848
})
4949
.map(r => ({ ...r.meta, path: r.path.split(':lang')[0].replace('-cn', '') }));
50-
if (category === 'docs') {
51-
ms.push({
52-
enTitle: 'Change Log',
53-
title: '更新日志',
54-
category: 'docs',
55-
target: '_blank',
56-
path: globalConfig.isZhCN.value
57-
? 'https://github.com/vueComponent/ant-design-vue/blob/next/CHANGELOG.zh-CN.md'
58-
: 'https://github.com/vueComponent/ant-design-vue/blob/next/CHANGELOG.en-US.md',
59-
} as any);
60-
}
50+
// if (category === 'docs') {
51+
// ms.push({
52+
// enTitle: 'Change Log',
53+
// title: '更新日志',
54+
// category: 'docs',
55+
// target: '_blank',
56+
// path: globalConfig.isZhCN.value
57+
// ? 'https://github.com/vueComponent/ant-design-vue/blob/next/CHANGELOG.zh-CN.md'
58+
// : 'https://github.com/vueComponent/ant-design-vue/blob/next/CHANGELOG.en-US.md',
59+
// } as any);
60+
// }
6161
return ms;
6262
});
6363
const activeMenuItem = computed(() => {

site/src/layouts/header/Navigation.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ export default defineComponent({
6767
() => route.path,
6868
pathname => {
6969
const modules = pathname.split('/');
70-
if (pathname === 'changelog' || pathname === 'changelog-cn') {
71-
activeMenuItem.value = 'docs/vue';
72-
} else if (pathname === '/docs/resources' || pathname === '/docs/resources-cn') {
70+
if (pathname === '/docs/resources' || pathname === '/docs/resources-cn') {
7371
activeMenuItem.value = 'docs/resources';
7472
} else if (modules[1] === 'components') {
7573
activeMenuItem.value = 'components';

site/src/layouts/index.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<a-anchor-link
4343
v-for="h in headers"
4444
:key="h.title"
45-
:href="h.href || `#${h.title}`"
45+
:href="h.href || `#${h.title.replace(/^(\d)/, '_$1')}`"
4646
:title="h.title"
4747
></a-anchor-link>
4848
</a-anchor>
@@ -117,10 +117,11 @@ export default defineComponent({
117117
}
118118
});
119119
120-
const themeMode = inject('themeMode', () => ({
120+
const themeMode = inject('themeMode', {
121121
theme: ref('default'),
122-
changeTheme: () => void 0,
123-
}));
122+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
123+
changeTheme: (_key: any) => void 0,
124+
});
124125
125126
watch(
126127
() => route.path,
@@ -141,7 +142,7 @@ export default defineComponent({
141142
const pageData = computed(() =>
142143
isDemo.value
143144
? matchCom.value[isZhCN.value ? 'CN' : 'US']?.pageData
144-
: matchCom.value?.pageData,
145+
: (matchCom.value as any)?.pageData,
145146
);
146147
const headers = computed(() => {
147148
if (isDemo.value) {

site/src/router/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ const routes = [
138138
meta: { enTitle: 'Sponsor', title: '支持我们', category: 'docs' },
139139
component: () => import('../vueDocs/sponsor.en-US.md'),
140140
},
141+
{
142+
path: 'vue/changelog-cn',
143+
meta: { enTitle: 'Change Log', title: '更新日志', category: 'docs' },
144+
component: () => import('../../../CHANGELOG.zh-CN.md'),
145+
},
146+
{
147+
path: 'vue/changelog',
148+
meta: { enTitle: 'Change Log', title: '更新日志', category: 'docs' },
149+
component: () => import('../../../CHANGELOG.en-US.md'),
150+
},
141151
{ path: '', redirect: '/docs/vue/introduce/' },
142152
],
143153
},

site/src/views/ComponentOverview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
</section>
5757
</template>
5858
<script lang="ts">
59-
import { GlobalConfig } from '../App.vue';
59+
import type { GlobalConfig } from '../App.vue';
6060
import { computed, defineComponent, inject, onMounted, ref } from 'vue';
6161
import { SearchOutlined } from '@ant-design/icons-vue';
6262
import { GLOBAL_CONFIG } from '../SymbolKey';

0 commit comments

Comments
 (0)