From b3e8f6edc281508de23d599c2bff314b841afc16 Mon Sep 17 00:00:00 2001 From: svyeh Date: Tue, 18 Jul 2023 21:43:16 +0800 Subject: [PATCH 1/6] add custom layout add a custom-layout and modify page staff --- layouts/app.vue | 161 ++++++++++++++++++++++++++++++++++++++++++ pages/about/staff.vue | 15 ++++ 2 files changed, 176 insertions(+) create mode 100644 layouts/app.vue diff --git a/layouts/app.vue b/layouts/app.vue new file mode 100644 index 0000000000..8881889098 --- /dev/null +++ b/layouts/app.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/pages/about/staff.vue b/pages/about/staff.vue index aff80016f2..7d14c29a09 100644 --- a/pages/about/staff.vue +++ b/pages/about/staff.vue @@ -39,12 +39,26 @@ import CoreH1 from '@/components/core/titles/H1' import i18n from '@/i18n/about/staff.i18n' export default { + layout(context) { + return 'app' + }, + /* + layout(context) { + return this.isAppMode ? 'app' : 'default' + }, */ i18n, name: 'PageStaff', components: { I18nPageWrapper, CoreH1, }, + /* + async fetch() { + const token = this.$nuxt.context.query.token + const store = this.$nuxt.context.store + await store.dispatch('$CCIPwhat?', { token }) + this.isAppMode = ? + }, */ data() { return { memberList: { @@ -284,6 +298,7 @@ export default { { name: 'JunWei Song', photo: 'program/JunWei Song.jpeg' }, ], }, + isAppMode: false, } }, head() { From f426850a372e7d046593ce23138c8783cbec8726 Mon Sep 17 00:00:00 2001 From: svyeh Date: Fri, 21 Jul 2023 22:18:30 +0800 Subject: [PATCH 2/6] fix: switch with ccip add if/else to switch layout with ccip in query --- layouts/{app.vue => ccip.vue} | 0 pages/about/staff.vue | 17 +++++------------ 2 files changed, 5 insertions(+), 12 deletions(-) rename layouts/{app.vue => ccip.vue} (100%) diff --git a/layouts/app.vue b/layouts/ccip.vue similarity index 100% rename from layouts/app.vue rename to layouts/ccip.vue diff --git a/pages/about/staff.vue b/pages/about/staff.vue index 7d14c29a09..d431867def 100644 --- a/pages/about/staff.vue +++ b/pages/about/staff.vue @@ -40,25 +40,18 @@ import i18n from '@/i18n/about/staff.i18n' export default { layout(context) { - return 'app' + const ccip = context.query.ccip // to determine if it's opass mobile app + if (ccip) { + return 'ccip' + } + return 'default' }, - /* - layout(context) { - return this.isAppMode ? 'app' : 'default' - }, */ i18n, name: 'PageStaff', components: { I18nPageWrapper, CoreH1, }, - /* - async fetch() { - const token = this.$nuxt.context.query.token - const store = this.$nuxt.context.store - await store.dispatch('$CCIPwhat?', { token }) - this.isAppMode = ? - }, */ data() { return { memberList: { From ad9bc1086c55b8bcd2c63a41f41cf519ab4e05dc Mon Sep 17 00:00:00 2001 From: svyeh Date: Sun, 6 Aug 2023 19:00:58 +0800 Subject: [PATCH 3/6] fix-unnecessary components --- layouts/ccip.vue | 108 +----------------------------------------- pages/about/staff.vue | 1 - 2 files changed, 2 insertions(+), 107 deletions(-) diff --git a/layouts/ccip.vue b/layouts/ccip.vue index 8881889098..28c81b4be5 100644 --- a/layouts/ccip.vue +++ b/layouts/ccip.vue @@ -10,114 +10,10 @@ export default { components: {}, data() { - return { - includeArr: ['PageConferenceSchedule'], - } + return {} }, head() { - const conferenceName = this.$store.state.configs.conferenceName - const conferenceYear = this.$store.state.configs.conferenceYear - return { - titleTemplate: (titleChunk) => { - const title = `${conferenceName} ${conferenceYear}` - return titleChunk && titleChunk !== title - ? `${titleChunk} | ${title}` - : title - }, - meta: [ - { charset: 'utf-8' }, - { - name: 'viewport', - content: 'width=device-width, initial-scale=1', - }, - { - hid: 'description', - name: 'description', - content: `${conferenceName} ${conferenceYear}`, - }, - { - hid: 'og:title', - property: 'og:title', - content: `${conferenceName} ${conferenceYear}`, - }, - { - hid: 'og:description', - property: 'og:description', - content: `${conferenceName} ${conferenceYear}`, - }, - { - hid: 'og:image', - property: 'og:image', - content: 'https://tw.pycon.org/2023/og-img.jpg', - }, - { - hid: 'og:url', - property: 'og:url', - content: 'https://tw.pycon.org' + this.$route.path, - }, - { hid: 'og:type', property: 'og:type', content: 'website' }, - ], - link: [ - { - rel: 'icon', - type: 'image/x-icon', - href: `/${conferenceYear}/favicon.ico`, - }, - { - rel: 'preconnect', - href: 'https://fonts.googleapis.com', - }, - { - rel: 'preconnect', - href: 'https://fonts.gstatic.com', - crossorigin: 'anonymous', - }, - { - rel: 'stylesheet', - href: 'https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;500;600;700;900&family=Source+Sans+Pro:wght@400;600;700;900&display=swap', - }, - { - rel: 'canonical', - href: 'https://tw.pycon.org' + this.$route.path, - }, - { - rel: 'alternate', - hreflang: 'x-default', - href: `https://tw.pycon.org/${conferenceYear}/en-us`, - }, - { - rel: 'alternate', - hreflang: 'en-us', - href: `https://tw.pycon.org/${conferenceYear}/en-us`, - }, - { - rel: 'alternate', - hreflang: 'zh-hant-tw', - href: `https://tw.pycon.org/${conferenceYear}/zh-hant`, - }, - ], - script: [ - { - type: 'application/ld+json', - json: { - '@context': 'https://schema.org', - '@type': 'Organization', - name: 'PyCon Taiwan', - url: 'https://tw.pycon.org', - logo: `https://tw.pycon.org/${conferenceYear}/og-img.jpg`, - sameAs: [ - 'https://www.facebook.com/pycontw/', - 'https://twitter.com/PyConTW/', - 'https://www.linkedin.com/company/pycontw', - 'https://www.youtube.com/channel/UCHLnNgRnfGYDzPCCH8qGbQw', - 'https://instagram.com/pycontw/', - 'https://github.com/pycontw/', - 'https://conf.python.tw', - ], - }, - }, - ], - } + return {} }, } diff --git a/pages/about/staff.vue b/pages/about/staff.vue index d431867def..afd2213034 100644 --- a/pages/about/staff.vue +++ b/pages/about/staff.vue @@ -291,7 +291,6 @@ export default { { name: 'JunWei Song', photo: 'program/JunWei Song.jpeg' }, ], }, - isAppMode: false, } }, head() { From e8150c6a6a30f2dbbef3fd54785768222ed486f4 Mon Sep 17 00:00:00 2001 From: svyeh Date: Sun, 6 Aug 2023 19:22:53 +0800 Subject: [PATCH 4/6] fix-unnecessary components related feature that related to #299 --- layouts/ccip.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/ccip.vue b/layouts/ccip.vue index 28c81b4be5..e74e5e7fee 100644 --- a/layouts/ccip.vue +++ b/layouts/ccip.vue @@ -1,7 +1,8 @@ From 3159337f44fa41d6acc119859deabdbf9f07084c Mon Sep 17 00:00:00 2001 From: svyeh Date: Sat, 19 Aug 2023 17:59:53 +0800 Subject: [PATCH 5/6] simplify codes - switch determination --- pages/about/staff.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pages/about/staff.vue b/pages/about/staff.vue index afd2213034..49dbc1347f 100644 --- a/pages/about/staff.vue +++ b/pages/about/staff.vue @@ -41,10 +41,7 @@ import i18n from '@/i18n/about/staff.i18n' export default { layout(context) { const ccip = context.query.ccip // to determine if it's opass mobile app - if (ccip) { - return 'ccip' - } - return 'default' + return ccip ? 'ccip' : 'default'; }, i18n, name: 'PageStaff', From ac5d11245dc56549a7fbf8f9ced38947f0211e98 Mon Sep 17 00:00:00 2001 From: Sivan Date: Sat, 19 Aug 2023 18:02:18 +0800 Subject: [PATCH 6/6] Update staff.vue --- pages/about/staff.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/about/staff.vue b/pages/about/staff.vue index 49dbc1347f..454af00481 100644 --- a/pages/about/staff.vue +++ b/pages/about/staff.vue @@ -41,7 +41,7 @@ import i18n from '@/i18n/about/staff.i18n' export default { layout(context) { const ccip = context.query.ccip // to determine if it's opass mobile app - return ccip ? 'ccip' : 'default'; + return ccip ? 'ccip' : 'default' }, i18n, name: 'PageStaff',