doc: add changelog to site
parent
ae01387d90
commit
9bb6e79db0
|
@ -70,7 +70,7 @@ module.exports = {
|
|||
'no-var': 'error',
|
||||
'no-console': [2, { allow: ['warn', 'error'] }],
|
||||
'object-shorthand': 2,
|
||||
'no-unused-vars': [2, { ignoreRestSiblings: true, argsIgnorePattern: '^h$' }],
|
||||
'no-unused-vars': [2, { ignoreRestSiblings: true, argsIgnorePattern: '^_' }],
|
||||
'no-undef': 2,
|
||||
camelcase: 'off',
|
||||
'no-extra-boolean-cast': 'off',
|
||||
|
|
1024
CHANGELOG.en-US.md
1024
CHANGELOG.en-US.md
File diff suppressed because it is too large
Load Diff
1028
CHANGELOG.zh-CN.md
1028
CHANGELOG.zh-CN.md
File diff suppressed because it is too large
Load Diff
|
@ -69,7 +69,11 @@ export const createMarkdownRenderer = (options: MarkdownOptions = {}): MarkdownR
|
|||
.use(emoji)
|
||||
.use(anchor, {
|
||||
slugify,
|
||||
permalink: false,
|
||||
permalink: anchor.permalink.linkInsideHeader({
|
||||
symbol: `
|
||||
<span aria-hidden="true" class="anchor">#</span>
|
||||
`,
|
||||
}),
|
||||
permalinkBefore: true,
|
||||
permalinkSymbol: '#',
|
||||
permalinkAttrs: () => ({ 'aria-hidden': true }),
|
||||
|
|
|
@ -47,17 +47,17 @@ const useMenus = (): {
|
|||
}
|
||||
})
|
||||
.map(r => ({ ...r.meta, path: r.path.split(':lang')[0].replace('-cn', '') }));
|
||||
if (category === 'docs') {
|
||||
ms.push({
|
||||
enTitle: 'Change Log',
|
||||
title: '更新日志',
|
||||
category: 'docs',
|
||||
target: '_blank',
|
||||
path: globalConfig.isZhCN.value
|
||||
? 'https://github.com/vueComponent/ant-design-vue/blob/next/CHANGELOG.zh-CN.md'
|
||||
: 'https://github.com/vueComponent/ant-design-vue/blob/next/CHANGELOG.en-US.md',
|
||||
} as any);
|
||||
}
|
||||
// if (category === 'docs') {
|
||||
// ms.push({
|
||||
// enTitle: 'Change Log',
|
||||
// title: '更新日志',
|
||||
// category: 'docs',
|
||||
// target: '_blank',
|
||||
// path: globalConfig.isZhCN.value
|
||||
// ? 'https://github.com/vueComponent/ant-design-vue/blob/next/CHANGELOG.zh-CN.md'
|
||||
// : 'https://github.com/vueComponent/ant-design-vue/blob/next/CHANGELOG.en-US.md',
|
||||
// } as any);
|
||||
// }
|
||||
return ms;
|
||||
});
|
||||
const activeMenuItem = computed(() => {
|
||||
|
|
|
@ -67,9 +67,7 @@ export default defineComponent({
|
|||
() => route.path,
|
||||
pathname => {
|
||||
const modules = pathname.split('/');
|
||||
if (pathname === 'changelog' || pathname === 'changelog-cn') {
|
||||
activeMenuItem.value = 'docs/vue';
|
||||
} else if (pathname === '/docs/resources' || pathname === '/docs/resources-cn') {
|
||||
if (pathname === '/docs/resources' || pathname === '/docs/resources-cn') {
|
||||
activeMenuItem.value = 'docs/resources';
|
||||
} else if (modules[1] === 'components') {
|
||||
activeMenuItem.value = 'components';
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<a-anchor-link
|
||||
v-for="h in headers"
|
||||
:key="h.title"
|
||||
:href="h.href || `#${h.title}`"
|
||||
:href="h.href || `#${h.title.replace(/^(\d)/, '_$1')}`"
|
||||
:title="h.title"
|
||||
></a-anchor-link>
|
||||
</a-anchor>
|
||||
|
@ -117,10 +117,11 @@ export default defineComponent({
|
|||
}
|
||||
});
|
||||
|
||||
const themeMode = inject('themeMode', () => ({
|
||||
const themeMode = inject('themeMode', {
|
||||
theme: ref('default'),
|
||||
changeTheme: () => void 0,
|
||||
}));
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
changeTheme: (_key: any) => void 0,
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.path,
|
||||
|
@ -141,7 +142,7 @@ export default defineComponent({
|
|||
const pageData = computed(() =>
|
||||
isDemo.value
|
||||
? matchCom.value[isZhCN.value ? 'CN' : 'US']?.pageData
|
||||
: matchCom.value?.pageData,
|
||||
: (matchCom.value as any)?.pageData,
|
||||
);
|
||||
const headers = computed(() => {
|
||||
if (isDemo.value) {
|
||||
|
|
|
@ -138,6 +138,16 @@ const routes = [
|
|||
meta: { enTitle: 'Sponsor', title: '支持我们', category: 'docs' },
|
||||
component: () => import('../vueDocs/sponsor.en-US.md'),
|
||||
},
|
||||
{
|
||||
path: 'vue/changelog-cn',
|
||||
meta: { enTitle: 'Change Log', title: '更新日志', category: 'docs' },
|
||||
component: () => import('../../../CHANGELOG.zh-CN.md'),
|
||||
},
|
||||
{
|
||||
path: 'vue/changelog',
|
||||
meta: { enTitle: 'Change Log', title: '更新日志', category: 'docs' },
|
||||
component: () => import('../../../CHANGELOG.en-US.md'),
|
||||
},
|
||||
{ path: '', redirect: '/docs/vue/introduce/' },
|
||||
],
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
</section>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { GlobalConfig } from '../App.vue';
|
||||
import type { GlobalConfig } from '../App.vue';
|
||||
import { computed, defineComponent, inject, onMounted, ref } from 'vue';
|
||||
import { SearchOutlined } from '@ant-design/icons-vue';
|
||||
import { GLOBAL_CONFIG } from '../SymbolKey';
|
||||
|
|
Loading…
Reference in New Issue