]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: wwads (#1014)
authorEduardo San Martin Morote <posva@users.noreply.github.com>
Mon, 31 Jan 2022 14:06:28 +0000 (15:06 +0100)
committerGitHub <noreply@github.com>
Mon, 31 Jan 2022 14:06:28 +0000 (15:06 +0100)
packages/docs/.vitepress/config.js
packages/docs/.vitepress/theme/Layout.ts
packages/docs/.vitepress/theme/custom.css
packages/docs/package.json
yarn.lock

index fd7b00a33f88ae993392bc542f5e492f91c934af..f04ff9941bc882fa9aa7434a37f77ee8472c6dc6 100644 (file)
@@ -38,10 +38,7 @@ module.exports = {
     ['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
     ['link', { rel: 'icon', type: 'image/png', href: '/logo.png' }],
 
-    [
-      'meta',
-      { name: 'wwads-cn-verify', content: '5878a7ab84fb43402106c575658472fa' },
-    ],
+    ['script', { src: 'https://cdn.wwads.cn/js/makemoney.js', async: '' }],
 
     [
       'meta',
index 5cb4cc428c64f726444630ccf887b52b43fedd60..c0c8ea356e8fbef269ad875a5b7b2897c9bf6c1e 100644 (file)
@@ -7,7 +7,78 @@ import { darkStorageConfig } from '../theme/dark-theme'
 import { useDark } from '@vueuse/core'
 
 export const Layout: FunctionalComponent = () => {
+  const showWwAds =
+    typeof navigator !== 'undefined' &&
+    typeof navigator.language === 'string' &&
+    navigator.language.startsWith('zh')
+
   const isDark = useDark(darkStorageConfig)
+
+  const slots = {
+    'sidebar-top': () =>
+      h('div', { class: 'sponsors sponsors-top' }, [
+        h('span', 'Platinum Sponsors'),
+        ...(sponsors.platinum.length
+          ? sponsors.platinum.map(({ href, imgSrcDark, imgSrcLight, alt }) =>
+              h(
+                'a',
+                {
+                  href,
+                  target: '_blank',
+                  rel: 'noopener',
+                },
+                [
+                  h('img', {
+                    src: isDark.value ? imgSrcDark : imgSrcLight,
+                    alt,
+                  }),
+                ]
+              )
+            )
+          : [
+              h(
+                'a',
+                {
+                  class: 'become-sponsor',
+                  href: 'https://github.com/sponsors/posva',
+                  target: '_blank',
+                  rel: 'noopener',
+                  alt: 'Your logo here',
+                },
+                'Become a Sponsor!'
+              ),
+            ]),
+      ]),
+    'sidebar-bottom': () =>
+      h('div', { class: 'sponsors' }, [
+        h('span', 'Sponsors'),
+        ...sponsors.gold.map(({ href, imgSrcDark, imgSrcLight, alt }) =>
+          h(
+            'a',
+            {
+              href,
+              target: '_blank',
+              rel: 'noopener',
+            },
+            [h('img', { src: isDark.value ? imgSrcDark : imgSrcLight, alt })]
+          )
+        ),
+      ]),
+  }
+
+  if (showWwAds) {
+    slots['page-top-ads'] = () =>
+      h('div', { id: 'wwads-container' }, [
+        h('div', {
+          class: 'wwads-cn wwads-vertical',
+          'data-id': 114,
+          style: {
+            maxWidth: '150px',
+          },
+        }),
+      ])
+  }
+
   return h(
     Theme.Layout,
     {
@@ -21,57 +92,7 @@ export const Layout: FunctionalComponent = () => {
         })
       },
     },
-    {
-      'sidebar-top': () =>
-        h('div', { class: 'sponsors sponsors-top' }, [
-          h('span', 'Platinum Sponsors'),
-          ...(sponsors.platinum.length
-            ? sponsors.platinum.map(({ href, imgSrcDark, imgSrcLight, alt }) =>
-                h(
-                  'a',
-                  {
-                    href,
-                    target: '_blank',
-                    rel: 'noopener',
-                  },
-                  [
-                    h('img', {
-                      src: isDark.value ? imgSrcDark : imgSrcLight,
-                      alt,
-                    }),
-                  ]
-                )
-              )
-            : [
-                h(
-                  'a',
-                  {
-                    class: 'become-sponsor',
-                    href: 'https://github.com/sponsors/posva',
-                    target: '_blank',
-                    rel: 'noopener',
-                    alt: 'Your logo here',
-                  },
-                  'Become a Sponsor!'
-                ),
-              ]),
-        ]),
-      'sidebar-bottom': () =>
-        h('div', { class: 'sponsors' }, [
-          h('span', 'Sponsors'),
-          ...sponsors.gold.map(({ href, imgSrcDark, imgSrcLight, alt }) =>
-            h(
-              'a',
-              {
-                href,
-                target: '_blank',
-                rel: 'noopener',
-              },
-              [h('img', { src: isDark.value ? imgSrcDark : imgSrcLight, alt })]
-            )
-          ),
-        ]),
-    }
+    slots
   )
 }
 
index 331e09a8fb1c18d99b683efbddd86911c2a95ec8..ed0a5c6a22916468df89b89e6d1f6348118dcf8e 100644 (file)
@@ -211,3 +211,27 @@ code {
   width: auto;
   max-width: 150px;
 }
+
+#wwads-container {
+  position: relative;
+  float: right;
+  z-index: 9;
+  margin: 0 0 16px 16px;
+}
+
+#wwads-container .wwads-text {
+  font-size: 12px;
+}
+
+.page .container .content {
+  clear: none !important;
+}
+
+@media (min-width: 1368px) {
+  #wwads-container {
+    position: fixed;
+    bottom: 10px;
+    right: 10px;
+    margin: 0;
+  }
+}
index a8620a0475c40fc090771e07d6e046884073aedc..55842252db2244e5fbec60d1681f646eb6692990 100644 (file)
@@ -10,6 +10,6 @@
   "dependencies": {
     "@vueuse/core": "^7.3.0",
     "pinia": "^2.0.0-rc.4",
-    "vitepress": "^0.20.5"
+    "vitepress": "^0.21.6"
   }
 }
index dd5a93ee6bdf7903d4e28fc3f82fbae5ef554f4c..64f334e5f56c65688029db6725d6e11170f2ebd8 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -8238,7 +8238,7 @@ verror@1.10.0:
     core-util-is "1.0.2"
     extsprintf "^1.2.0"
 
-vite@^2.7.0, vite@^2.7.1:
+vite@^2.7.1, vite@^2.7.12:
   version "2.7.13"
   resolved "https://registry.yarnpkg.com/vite/-/vite-2.7.13.tgz#99b56e27dfb1e4399e407cf94648f5c7fb9d77f5"
   integrity sha512-Mq8et7f3aK0SgSxjDNfOAimZGW9XryfHRa/uV0jseQSilg+KhYDSoNb9h1rknOy6SuMkvNDLKCYAYYUMCE+IgQ==
@@ -8250,17 +8250,17 @@ vite@^2.7.0, vite@^2.7.1:
   optionalDependencies:
     fsevents "~2.3.2"
 
-vitepress@^0.20.5:
-  version "0.20.10"
-  resolved "https://registry.yarnpkg.com/vitepress/-/vitepress-0.20.10.tgz#18266182aee192191db76f63b68203eea3ac148d"
-  integrity sha512-dKgH6k1yxdEjIIxoXGI0vMg3lpBLvMarre/vvt4beuxd+rXOUB1a7DAtXDmgIXOMGQ7IcF+4zyd2132IedhjtQ==
+vitepress@^0.21.6:
+  version "0.21.6"
+  resolved "https://registry.yarnpkg.com/vitepress/-/vitepress-0.21.6.tgz#aa9e7a597efad607a08a79a020417771bec081c7"
+  integrity sha512-OzwD2cTfvoK5VKV0UWSqu4XvUOz4vWFJ4Bdi0z8GoVkTFXkfmbFawEDVXAZwzu0Hn4/VLopgmEyooc91iGKFlg==
   dependencies:
     "@docsearch/css" "^3.0.0-alpha.41"
     "@docsearch/js" "^3.0.0-alpha.41"
     "@vitejs/plugin-vue" "^2.0.0"
     prismjs "^1.25.0"
-    vite "^2.7.0"
-    vue "^3.2.26"
+    vite "^2.7.12"
+    vue "^3.2.27"
 
 vscode-oniguruma@^1.6.1:
   version "1.6.1"
@@ -8296,7 +8296,7 @@ vue-router@^4.0.12:
   resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235"
   integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==
 
-vue@^3.2.26:
+vue@^3.2.26, vue@^3.2.27:
   version "3.2.29"
   resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.29.tgz#3571b65dbd796d3a6347e2fd45a8e6e11c13d56a"
   integrity sha512-cFIwr7LkbtCRanjNvh6r7wp2yUxfxeM2yPpDQpAfaaLIGZSrUmLbNiSze9nhBJt5MrZ68Iqt0O5scwAMEVxF+Q==