Page.vue 2.4 KB
Newer Older
1 2 3 4 5
<template>
  <main class="page">

    <slot name="top" />

6 7 8 9
    <BreadCrumb :key="$route.path" />



10 11
    <PageInfo :key="$route.path" />

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    <MyTransition v-if="pagePassword && !pageDescrypted" :delay="0.08" :disable="true">
      <Password
        :key="$route.path"
        :page="true"
        @password-verify="password = $event"
      />
    </MyTransition>

    <MyTransition v-else-if="isPathEncrypted" :delay="0.08" :disable="true">
      <Password
        :key="$route.path"
        :page="true"
        @password-verify="checkPathPassword"
      />
    </MyTransition>

    <template v-else>
29 30 31 32
      <MyTransition :delay="0.12" :disable="true">
        <Anchor :key="$route.path" />
      </MyTransition>

33
      <slot v-if="!pagePassword || pageDescrypted" name="content-top" />
34

35
      <MyTransition v-show="!pagePassword || pageDescrypted" :delay="0.08" :disable="true">
36 37 38
        <Content :key="$route.path" class="theme-default-content" />
      </MyTransition>

39
      <slot v-if="!pagePassword || pageDescrypted" name="content-bottom" />
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

      <MyTransition :delay="0.12" :disable="true">
        <PageMeta :key="$route.path" />
      </MyTransition>

      <MyTransition :delay="0.14" :disable="true">
        <PageNav :key="$route.path" v-bind="{ sidebarItems }" />
      </MyTransition>

      <MyTransition :delay="0.16" :disable="true">
        <Comment :key="$route.path" />
      </MyTransition>
    </template>

    <slot name="bottom" />

    <!-- Google tag (gtag.js) -->
    <!-- put here because the plugin didn't work -->
58
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-9KLVB8X0ME">      
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
    </script>

    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'G-9KLVB8X0ME');
    </script>
  </main>
</template>

<script src="./Page" />

<style lang="stylus">
.page
  display block
  box-sizing border-box
  min-height 100vh
  padding-left $sidebarWidth
  padding-bottom 2rem
  background var(--bgcolor)

  @media (max-width $MQMobile)
    min-height 100vh

  // narrow desktop / iPad
  @media (max-width $MQNarrow)
    padding-left $mobileSidebarWidth

  // wide mobile
  @media (max-width $MQMobile)
    padding-left 0

  @media (min-width $MQMobile)
    .theme-container:not(.has-sidebar) &
      padding-left 0

  @media (min-width $MQWide)
    .has-anchor &:not(.blog)
      padding-right 16rem
</style>