Skip to content

Instantly share code, notes, and snippets.

@swsalim
Last active May 31, 2021 08:59
Show Gist options
  • Select an option

  • Save swsalim/f709ff9d9d79dd3a70d50ebd6d081aad to your computer and use it in GitHub Desktop.

Select an option

Save swsalim/f709ff9d9d79dd3a70d50ebd6d081aad to your computer and use it in GitHub Desktop.

Revisions

  1. swsalim revised this gist May 31, 2021. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions About.vue
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    <template>
    <div>
    <div class="prose prose-lg">
    <prismic-rich-text :field="page.content" />
    </div>
    </div>
    </template>

    <script>
    export default {
    name: 'AboutPage',
  2. swsalim revised this gist May 31, 2021. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions About.vue
    Original file line number Diff line number Diff line change
    @@ -27,11 +27,6 @@ export default {
    .asText(this.page.meta_description)
    .substring(0, 158)
    }
    ],
    script: [
    {
    src: 'https://scripts.simpleanalyticscdn.com/embed.js'
    }
    ]
    }
    }
  3. swsalim created this gist May 31, 2021.
    39 changes: 39 additions & 0 deletions About.vue
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    <script>
    export default {
    name: 'AboutPage',
    async asyncData({ $prismic, error }) {
    try {
    const pageContent = (await $prismic.api.getSingle('about_page')).data
    return {
    page: pageContent
    }
    } catch (e) {
    error({ statusCode: 404, message: 'Page not found' })
    }
    },
    data() {
    return {
    page: null
    }
    },
    head() {
    return {
    title: this.$prismic.asText(this.page.meta_title),
    meta: [
    {
    hid: 'description',
    name: 'description',
    content: this.$prismic
    .asText(this.page.meta_description)
    .substring(0, 158)
    }
    ],
    script: [
    {
    src: 'https://scripts.simpleanalyticscdn.com/embed.js'
    }
    ]
    }
    }
    }
    </script>