diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index b2b002be..1a7812b0 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -5,6 +5,62 @@ const authors = require('./config/authors') const CANONICAL_BASE = process.env.CANONICAL_BASE || '' const IPFS_DEPLOY = process.env.IPFS_DEPLOY === 'true' || false +const themeConfigDefaults = { + dateFormat: 'DD MMMM YYYY', + socialLinks: [ + { + text: 'Github', + link: 'https://github.com/ipfs', + icon: 'github-icon', + }, + { + text: 'YouTube', + link: 'https://www.youtube.com/channel/UCdjsUXJ3QawK4O5L1kqqsew', + icon: 'youtube-icon', + }, + { + text: 'Twitter', + link: 'http://twitter.com/ipfs', + icon: 'twitter-icon', + }, + { + text: 'LinkedIn', + link: 'https://www.linkedin.com/company/protocollabs/', + icon: 'linkedin-icon', + }, + ], + footerLinks: [ + { text: 'Blog & news', link: '/' }, + { text: 'Press', link: 'https://ipfs.io/media/' }, + { + text: 'Code of conduct', + link: 'https://github.com/ipfs/community/blob/master/code-of-conduct.md', + }, + { + text: 'Security', + link: + 'https://github.com/ipfs/community/blob/master/CONTRIBUTING.md#security-issues', + }, + ], + footerLegal: '', + headerLinks: [ + { text: 'About', link: 'https://ipfs.io/#why' }, + { text: 'Install', link: 'https://ipfs.io/#install' }, + { text: 'Docs', link: 'https://docs.ipfs.io/' }, + { text: 'Team', link: 'https://ipfs.io/team' }, + { text: 'Blog', link: '/' }, + { text: 'Help', link: 'https://ipfs.io/help' }, + ], + mobileNavLinks: [ + { text: 'About', link: 'https://ipfs.io/#why' }, + { text: 'Install', link: 'https://ipfs.io/#install' }, + { text: 'Docs', link: 'https://docs.ipfs.io/' }, + { text: 'Team', link: 'https://ipfs.io/team' }, + { text: 'Blog', link: '/' }, + { text: 'Help', link: 'https://ipfs.io/help' }, + ], +} + module.exports = { title: 'IPFS Blog & News', description: @@ -18,6 +74,12 @@ module.exports = { description: 'All the latest information about the IPFS Project in one place: blog posts, release notes, videos, news coverage, and more.', }, + '/zh/': { + lang: 'zh-CN', + title: 'IPFS Blog & News', + description: + 'ZH - All the latest information about the IPFS Project in one place: blog posts, release notes, videos, news coverage, and more.', + }, }, head: require('./config/head'), dest: './dist', @@ -33,60 +95,42 @@ module.exports = { }, }, themeConfig: { - dateFormat: 'DD MMMM YYYY', - socialLinks: [ - { - text: 'Github', - link: 'https://github.com/ipfs', - icon: 'github-icon', + locales: { + '/': themeConfigDefaults, + '/zh/': { + ...themeConfigDefaults, + footerLinks: [ + { text: 'Blog & news', link: '/zh/' }, + { text: 'Press', link: 'https://ipfs.io/media/' }, + { + text: 'Code of conduct', + link: + 'https://github.com/ipfs/community/blob/master/code-of-conduct.md', + }, + { + text: 'Security', + link: + 'https://github.com/ipfs/community/blob/master/CONTRIBUTING.md#security-issues', + }, + ], + headerLinks: [ + { text: 'About', link: 'https://ipfs.io/#why' }, + { text: 'Install', link: 'https://ipfs.io/#install' }, + { text: 'Docs', link: 'https://docs.ipfs.io/' }, + { text: 'Team', link: 'https://ipfs.io/team' }, + { text: 'Blog', link: '/zh/' }, + { text: 'Help', link: 'https://ipfs.io/help' }, + ], + mobileNavLinks: [ + { text: 'About', link: 'https://ipfs.io/#why' }, + { text: 'Install', link: 'https://ipfs.io/#install' }, + { text: 'Docs', link: 'https://docs.ipfs.io/' }, + { text: 'Team', link: 'https://ipfs.io/team' }, + { text: 'Blog', link: '/zh/' }, + { text: 'Help', link: 'https://ipfs.io/help' }, + ], }, - { - text: 'YouTube', - link: 'https://www.youtube.com/channel/UCdjsUXJ3QawK4O5L1kqqsew', - icon: 'youtube-icon', - }, - { - text: 'Twitter', - link: 'http://twitter.com/ipfs', - icon: 'twitter-icon', - }, - { - text: 'LinkedIn', - link: 'https://www.linkedin.com/company/protocollabs/', - icon: 'linkedin-icon', - }, - ], - footerLinks: [ - { text: 'Blog & news', link: '/' }, - { text: 'Press', link: 'https://ipfs.io/media/' }, - { - text: 'Code of conduct', - link: - 'https://github.com/ipfs/community/blob/master/code-of-conduct.md', - }, - { - text: 'Security', - link: - 'https://github.com/ipfs/community/blob/master/CONTRIBUTING.md#security-issues', - }, - ], - footerLegal: '', - headerLinks: [ - { text: 'About', link: 'https://ipfs.io/#why' }, - { text: 'Install', link: 'https://ipfs.io/#install' }, - { text: 'Docs', link: 'https://docs.ipfs.io/' }, - { text: 'Team', link: 'https://ipfs.io/team' }, - { text: 'Blog', link: '/' }, - { text: 'Help', link: 'https://ipfs.io/help' }, - ], - mobileNavLinks: [ - { text: 'About', link: 'https://ipfs.io/#why' }, - { text: 'Install', link: 'https://ipfs.io/#install' }, - { text: 'Docs', link: 'https://docs.ipfs.io/' }, - { text: 'Team', link: 'https://ipfs.io/team' }, - { text: 'Blog', link: '/' }, - { text: 'Help', link: 'https://ipfs.io/help' }, - ], + }, }, plugins: [ ['@vuepress/last-updated'], @@ -151,6 +195,21 @@ module.exports = { lengthPerPage: Number.MAX_SAFE_INTEGER, }, }, + { + id: 'blog_zh', + dirname: '_blog_zh', + path: '/zh/', + itemPermalink: '/zh/:slug', + layout: 'Blog', + itemLayout: 'BlogPost', + frontmatter: { + title: 'Home', + description: 'Blog, news & more', + }, + pagination: { + lengthPerPage: Number.MAX_SAFE_INTEGER, + }, + }, ], }, ], diff --git a/src/.vuepress/theme/components/Footer.vue b/src/.vuepress/theme/components/Footer.vue index 340db08d..f4d406ed 100644 --- a/src/.vuepress/theme/components/Footer.vue +++ b/src/.vuepress/theme/components/Footer.vue @@ -53,7 +53,7 @@ export default { components: { SocialLinks, NewsletterForm, NavLink, FooterLegal }, computed: { footerLinks() { - return this.$site.themeConfig.footerLinks + return this.$themeLocaleConfig.footerLinks }, }, } diff --git a/src/.vuepress/theme/components/MobileNav.vue b/src/.vuepress/theme/components/MobileNav.vue index decba6ce..d14c0541 100644 --- a/src/.vuepress/theme/components/MobileNav.vue +++ b/src/.vuepress/theme/components/MobileNav.vue @@ -11,7 +11,7 @@