vuepress-theme-uniapp-official 1.4.43 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -237,7 +237,7 @@ export default {
237
237
  }
238
238
  }
239
239
 
240
- if (vnode.tag === 'noscript') {
240
+ if (vnode.tag === 'div' && vnode.data.staticClass.indexOf('noscript') > -1) {
241
241
  noscriptDom.push(vnode)
242
242
  }
243
243
  }
@@ -8,6 +8,14 @@ function vnode2h(vnode) {
8
8
  return h(vnode.tag, vnode.data, vnode.children ? vnode.children.map(vnode2h) : [])
9
9
  }
10
10
 
11
+ function renderClass(url) {
12
+ if (url.indexOf('github.com') !== -1) {
13
+ return 'github-url icon-github'
14
+ } else if (url.indexOf('gitcode.com') !== -1) {
15
+ return 'gitcode-url icon-gitcode'
16
+ }
17
+ }
18
+
11
19
  export default defineComponent({
12
20
  setup(props, { slots }) {
13
21
  const { proxy } = getCurrentInstance()
@@ -46,18 +54,29 @@ export default defineComponent({
46
54
  H.data,
47
55
  [
48
56
  h('span', null, H.children.map(vnode2h)),
49
- h('span', { style: { marginLeft: '10px', alignSelf: 'center', fontSize: 'initial' } },
57
+ h('span', { style: { alignSelf: 'center', fontSize: 'initial' } },
50
58
  Object.keys(sources).map(git => h('a', {
51
59
  attrs: {
52
60
  href: sources[git],
53
61
  target: '_blank',
54
62
  rel: 'noopener noreferrer',
55
63
  },
64
+ class: renderClass(sources[git]),
56
65
  style: { marginLeft: '5px' }
57
- }, git))
66
+ }))
58
67
  )
59
68
  ]
60
69
  )
61
70
  }
62
71
  });
63
72
  </script>
73
+
74
+ <style scoped>
75
+ a.github-url::after {
76
+ content: "GitHub";
77
+ }
78
+
79
+ a.gitcode-url::after {
80
+ content: "GitCode";
81
+ }
82
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuepress-theme-uniapp-official",
3
- "version": "1.4.43",
3
+ "version": "1.5.0",
4
4
  "description": "uni-app official website theme for vuepress",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -43,9 +43,9 @@
43
43
  "vuepress-plugin-mermaidjs": "1.9.1",
44
44
  "vuepress-plugin-named-chunks": "^1.1.4",
45
45
  "vuepress-plugin-zooming": "^1.1.8",
46
- "vuepress-plugin-expandable-row": "^1.0.10",
47
46
  "vuepress-plugin-check-md2": "^1.0.5",
48
- "vuepress-plugin-noscript-code": "^1.0.1"
47
+ "vuepress-plugin-noscript-code": "^1.0.2",
48
+ "vuepress-plugin-expandable-row": "^1.0.10"
49
49
  },
50
50
  "resolutions": {
51
51
  "terser-webpack-plugin": "1.4.6",