vuepress-theme-uniapp-official 1.4.30 → 1.4.32

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.
@@ -160,11 +160,16 @@
160
160
  resultsScreen: { resultsText, noResultsText, askNoResultsText },
161
161
  },
162
162
  } = searchPageConfig;
163
+ const crawlerUrl = 'https://zh.uniapp.dcloud.io/'
163
164
 
164
- const resolveRoutePathFromUrl = (url, base = '/') =>
165
- url
165
+ const resolveRoutePathFromUrl = (url, base = '/') => {
166
+ if (url.indexOf(crawlerUrl) === 0) {
167
+ return url.replace(crawlerUrl, 'https://uniapp.dcloud.io/')
168
+ }
169
+ return url
166
170
  // remove url origin
167
- .replace(/^(https?:)?\/\/[^/]*/, '');
171
+ // .replace(/^(https?:)?\/\/[^/]*/, '');
172
+ }
168
173
 
169
174
  export default {
170
175
  name: 'DcloudSearchPage',
@@ -25,11 +25,18 @@ export function removeHighlightTags(hit) {
25
25
  if (!internalDocSearchHit.__docsearch_parent && !hit._highlightResult) {
26
26
  return hit.hierarchy.lvl0;
27
27
  }
28
+ const highlightResult = hit._highlightResult || {}
28
29
 
29
30
  const { value } =
30
- (internalDocSearchHit.__docsearch_parent
31
- ? ((internalDocSearchHit.__docsearch_parent._highlightResult || {}).hierarchy || {}).lvl0
32
- :((hit._highlightResult || {}).hierarchy || {}).lvl0) || {};
31
+ (
32
+ internalDocSearchHit.__docsearch_parent
33
+ ? ((internalDocSearchHit.__docsearch_parent._highlightResult || {}).hierarchy || {}).lvl0
34
+ :(
35
+ highlightResult.hierarchy
36
+ || (highlightResult.hierarchy_camel || [])[0]
37
+ || {}
38
+ ).lvl0
39
+ ) || {};
33
40
 
34
41
  let removeHighLightValue = value && regexHasHighlightTags.test(value)
35
42
  ? value.replace(regexHighlightTags, '')
@@ -49,4 +56,4 @@ export function isEditingContent(event) {
49
56
  tagName === 'SELECT' ||
50
57
  tagName === 'TEXTAREA'
51
58
  );
52
- }
59
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuepress-theme-uniapp-official",
3
- "version": "1.4.30",
3
+ "version": "1.4.32",
4
4
  "description": "uni-app official website theme for vuepress",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -27,12 +27,6 @@
27
27
  "enhanceApp.js",
28
28
  "index.js"
29
29
  ],
30
- "scripts": {
31
- "publish:patch": "npm version patch && npm publish",
32
- "publish:minor": "npm version minor && npm publish",
33
- "publish:major": "npm version major && npm publish",
34
- "postpublish": "cnpm sync vuepress-theme-uniapp-official"
35
- },
36
30
  "dependencies": {
37
31
  "@docsearch/css": "^3.6.0",
38
32
  "@vuepress/plugin-back-to-top": "^1.9.5",
@@ -42,11 +36,16 @@
42
36
  "markdown-it-raw-table": "^1.0.0",
43
37
  "markdown-it-task-lists": "^2.1.1",
44
38
  "qr-code-with-logo": "^1.1.0",
45
- "vuepress-plugin-check-md2": "^1.0.5",
46
- "vuepress-plugin-expandable-row": "^1.0.9",
47
39
  "vuepress-plugin-juejin-style-copy": "^1.0.4",
48
40
  "vuepress-plugin-mermaidjs": "1.9.1",
49
41
  "vuepress-plugin-named-chunks": "^1.1.4",
50
- "vuepress-plugin-zooming": "^1.1.8"
42
+ "vuepress-plugin-zooming": "^1.1.8",
43
+ "vuepress-plugin-check-md2": "^1.0.5",
44
+ "vuepress-plugin-expandable-row": "^1.0.9"
45
+ },
46
+ "scripts": {
47
+ "publish:patch": "npm version patch && npm publish",
48
+ "publish:minor": "npm version minor && npm publish",
49
+ "publish:major": "npm version major && npm publish"
51
50
  }
52
- }
51
+ }
@@ -1,248 +1,255 @@
1
- $w3cColor = #007aff
2
- $html5Color = #fb6f18
3
-
4
- .footNav
5
- width 90%
6
- display flex
7
- justify-content center
8
-
9
- /* 通用底部导航栏---公共 */
10
- #footNavBox
11
- max-width $contentWidth
12
- width 100%
13
- margin 30px auto 0
14
- padding-bottom 30px
15
- display flex
16
- flex-direction column
17
- flex-wrap wrap
18
- justify-content center
19
- align-items center
20
- background #fbfbfb
21
- box-shadow rgba(0, 0, (0 / 6%), .06) 0px -20px 15px -15px
22
-
23
- .w3c
24
- text-decoration none
25
- color $w3cColor !important
26
- font-weight 800 !important
27
-
28
- .html5
29
- text-decoration none
30
- color $html5Color !important
31
- font-weight 800 !important
32
-
33
- .hbLogo
34
- display inline-block
35
- width 160px
36
- height 25px
37
- margin-bottom 30px
38
- background url('https://web-assets.dcloud.net.cn/unidoc/zh/logo.svg') no-repeat center
39
-
40
- .beianBox
41
- display flex
42
- align-items center
43
-
44
- .domainImgBox
45
- display flex
46
- flex-direction row
47
- align-items center
48
-
49
- .domainImg
50
- width 20px
51
- height 20px
52
- margin-left 20px
53
- margin-right 5px
54
-
55
- .beian
56
- font-size 14px
57
- text-decoration none
58
- color $w3cColor !important
59
- cursor pointer
60
-
61
- &:hover
62
- color #333333 !important
63
- transition all 0.3s
64
-
65
- .footNavItem
66
- display flex
67
- flex-direction column
68
- align-items flex-start
69
- margin 20px 45px 0 0
70
-
71
- .navLine
72
- width 100%
73
- height 1px
74
- background #e1e1e1
75
- margin-bottom 15px
76
-
77
- .navItemTitle
78
- display flex
79
- // width 100px
80
- // height 35px
81
- line-height 35px
82
- font-size 16px
83
- font-weight bold
84
- font-family SourceHanSansCN-Regular serif
85
- color #414141
86
-
87
- .navItemDetail
88
- display inline-block
89
- cursor pointer
90
- text-decoration none
91
- color #3c3c3c !important
92
- text-align left
93
- margin-bottom 12px
94
- font-size 14px
95
- /* font-family CambayDevanagari arial,sans-serif */
96
- font-family SourceHanSansCN-Regular serif
97
- font-weight 400
98
- line-height 22px
99
-
100
- .navItemDetail:hover
101
- color $accentColor !important
102
- transition all 0.2s
103
-
104
- .companyBox
105
- display flex
106
- justify-content center
107
- margin 20px 0 20px 0
108
- text-align center
109
-
110
- .companyInfo, .anbaoInfo
111
- font-size 14px
112
- color #565656 !important
113
- font-family SourceHanSansCN-Regular serif
114
-
115
- .companyInfo-dcloud
116
- padding-right 10px
117
- position relative
118
- &::after
119
- content '®'
120
- position absolute
121
- top -2px
122
- font-size 10px
123
-
124
- .navItemDetailBox
125
- width 100%
126
- display flex
127
- flex-direction column
128
- flex-wrap wrap
129
- .introduce
130
- max-width 100%
131
- display flex
132
- flex-direction column
133
- white-space nowrap
134
- justify-items center
135
- .introduce-item
136
- display flex
137
- flex-wrap wrap
138
- .introduce-title
139
- font-size 16px
140
- font-weight bold
141
- color #414141
142
- a
143
- $gap = 10px
144
- margin-right $gap
145
- &:not(:last-child)::after
146
- content ' '
147
- border-right: 1px solid #e1e1e1
148
- margin-left $gap
149
-
150
- #aboutusBox
151
- display flex
152
- flex-direction column
153
- flex-wrap wrap
154
-
155
- @media screen and (max-width $MQMobile)
156
- #footNavBox
157
- #footNavClassify
158
- width 60%
159
-
160
- #aboutusBox
161
- // width 70%
162
-
163
- .footNavItem
164
- margin-right 20px
165
-
166
- @media screen and (max-width 880px)
167
- #footNavBox
168
- .companyBox
169
- height 50px
170
- flex-direction column
171
- justify-content space-around
172
-
173
- .footNav
174
- #aboutusBox
175
- height 655px !important
176
-
177
- @media screen and (max-width 1150px)
178
- #footNavBox
179
- .beianBox
180
- height 80px
181
- flex-direction column
182
- justify-content space-around
183
-
184
- /* 通用底部导航栏---移动端 */
185
- @media screen and (max-width 1050px)
186
- #footNavBox
187
- .footNav
188
- justify-content flex-start
189
-
190
- #footNavClassify
191
- width 60%
192
-
193
- #aboutusBox
194
- height 555px
195
-
196
- .footNavItem
197
- max-width 100px
198
-
199
- margin-right 10px
200
-
201
- @media screen and (max-width 1400px)
202
- #footNavBox
203
- #footNavClassify
204
- width 50%
205
-
206
- .footNavItem
207
- min-width 150px
208
-
209
- .navItemDetailBox
210
- height 550px
211
-
212
- .navItemDetail
213
- margin-right 0px
214
- width 50%
215
-
216
- #aboutusBox
217
- height 420px
218
-
219
- .footNavItem
220
- margin-right 20px
221
-
222
- @media screen and (min-width $MQMobile)
223
- #footNavBox
224
- .navLine
225
- // width 80%
226
- .footNavItem
227
- margin 20px 18px 0 0
228
- #footNavClassify
229
- width 70%
230
-
231
- .footNavItem
232
- min-width 240px
233
-
234
- .navItemDetailBox
235
- height 300px
236
- display flex
237
- justify-content flex-start
238
- flex-direction column
239
-
240
- .navItemDetail
241
- margin-right 1rem
242
-
243
- #aboutusBox
244
- width 70%
245
- height 400px
246
-
247
- .footNavItem:last-child
248
- margin-right 0
1
+ $w3cColor = #007aff
2
+ $html5Color = #fb6f18
3
+
4
+ .footNav
5
+ width 90%
6
+ display flex
7
+ justify-content center
8
+
9
+ /* 通用底部导航栏---公共 */
10
+ #footNavBox
11
+ max-width $contentWidth
12
+ width 100%
13
+ margin 30px auto 0
14
+ padding-bottom 30px
15
+ display flex
16
+ flex-direction column
17
+ flex-wrap wrap
18
+ justify-content center
19
+ align-items center
20
+ background #fbfbfb
21
+ box-shadow rgba(0, 0, (0 / 6%), .06) 0px -20px 15px -15px
22
+
23
+ .w3c
24
+ text-decoration none
25
+ color $w3cColor !important
26
+ font-weight 800 !important
27
+
28
+ .html5
29
+ text-decoration none
30
+ color $html5Color !important
31
+ font-weight 800 !important
32
+
33
+ .hbLogo
34
+ display inline-block
35
+ width 160px
36
+ height 25px
37
+ margin-bottom 30px
38
+ background url('https://web-assets.dcloud.net.cn/unidoc/zh/logo.svg') no-repeat center
39
+
40
+ .beianBox
41
+ display flex
42
+ align-items center
43
+
44
+ .domainImgBox
45
+ display flex
46
+ flex-direction row
47
+ align-items center
48
+
49
+ .domainImg
50
+ width 20px
51
+ height 20px
52
+ margin-left 20px
53
+ margin-right 5px
54
+
55
+ .beian
56
+ font-size 14px
57
+ text-decoration none
58
+ color $w3cColor !important
59
+ cursor pointer
60
+
61
+ &:hover
62
+ color #333333 !important
63
+ transition all 0.3s
64
+
65
+ .footNavItem
66
+ display flex
67
+ flex-direction column
68
+ align-items flex-start
69
+ margin 20px 45px 0 0
70
+
71
+ .navLine
72
+ width 100%
73
+ height 1px
74
+ background #e1e1e1
75
+ margin-bottom 15px
76
+
77
+ .navItemTitle
78
+ display flex
79
+ // width 100px
80
+ // height 35px
81
+ line-height 35px
82
+ font-size 16px
83
+ font-weight bold
84
+ font-family SourceHanSansCN-Regular serif
85
+ color #414141
86
+
87
+ .navItemDetail
88
+ display inline-block
89
+ cursor pointer
90
+ text-decoration none
91
+ color #3c3c3c !important
92
+ text-align left
93
+ margin-bottom 12px
94
+ font-size 14px
95
+ /* font-family CambayDevanagari arial,sans-serif */
96
+ font-family SourceHanSansCN-Regular serif
97
+ font-weight 400
98
+ line-height 22px
99
+
100
+ .navItemDetail:hover
101
+ color $accentColor !important
102
+ transition all 0.2s
103
+
104
+ .companyBox
105
+ display flex
106
+ justify-content center
107
+ margin 20px 0 20px 0
108
+ text-align center
109
+
110
+ .companyInfo, .anbaoInfo
111
+ font-size 14px
112
+ color #565656 !important
113
+ font-family SourceHanSansCN-Regular serif
114
+ margin 0 9px
115
+
116
+ .companyInfo-dcloud
117
+ padding-right 10px
118
+ position relative
119
+ &::after
120
+ content '®'
121
+ position absolute
122
+ top -2px
123
+ font-size 10px
124
+
125
+ .navItemDetailBox
126
+ width 100%
127
+ display flex
128
+ flex-direction column
129
+ flex-wrap wrap
130
+ .introduce
131
+ max-width 100%
132
+ display flex
133
+ flex-direction column
134
+ white-space nowrap
135
+ justify-items center
136
+ .introduce-item
137
+ display flex
138
+ flex-wrap wrap
139
+ .introduce-title
140
+ font-size 16px
141
+ font-weight bold
142
+ color #414141
143
+ a
144
+ $gap = 10px
145
+ margin-right $gap
146
+ &:not(:last-child)::after
147
+ content ' '
148
+ border-right: 1px solid #e1e1e1
149
+ margin-left $gap
150
+
151
+ #aboutusBox
152
+ display flex
153
+ flex-direction column
154
+ flex-wrap wrap
155
+
156
+ @media screen and (max-width $MQMobile)
157
+ #footNavBox
158
+ .introduce
159
+ max-width: 80% !important
160
+ #footNavClassify
161
+ width 60%
162
+
163
+ #aboutusBox
164
+ // width 70%
165
+
166
+ .footNavItem
167
+ margin-right 20px
168
+ max-width 80px !important
169
+
170
+
171
+ @media screen and (max-width 880px)
172
+ #footNavBox
173
+ .introduce
174
+ max-width: 80% !important
175
+ .companyBox
176
+ height 50px
177
+ flex-direction column
178
+ justify-content space-around
179
+
180
+ .footNav
181
+ #aboutusBox
182
+ height 655px !important
183
+
184
+ @media screen and (max-width 1150px)
185
+ #footNavBox
186
+ .beianBox
187
+ height 80px
188
+ flex-direction column
189
+ justify-content space-around
190
+
191
+ /* 通用底部导航栏---移动端 */
192
+ @media screen and (max-width 1050px)
193
+ #footNavBox
194
+ .footNav
195
+ justify-content flex-start
196
+
197
+ #footNavClassify
198
+ width 60%
199
+
200
+ #aboutusBox
201
+ height 555px
202
+
203
+ .footNavItem
204
+ max-width 100px
205
+
206
+ margin-right 10px
207
+
208
+ @media screen and (max-width 1400px)
209
+ #footNavBox
210
+ #footNavClassify
211
+ width 50%
212
+
213
+ .footNavItem
214
+ min-width 150px
215
+
216
+ .navItemDetailBox
217
+ height 550px
218
+
219
+ .navItemDetail
220
+ margin-right 0px
221
+ width 50%
222
+
223
+ #aboutusBox
224
+ height 420px
225
+
226
+ .footNavItem
227
+ margin-right 20px
228
+
229
+ @media screen and (min-width $MQMobile)
230
+ #footNavBox
231
+ .navLine
232
+ // width 80%
233
+ .footNavItem
234
+ margin 20px 18px 0 24px
235
+ #footNavClassify
236
+ width 70%
237
+
238
+ .footNavItem
239
+ min-width 240px
240
+
241
+ .navItemDetailBox
242
+ height 300px
243
+ display flex
244
+ justify-content flex-start
245
+ flex-direction column
246
+
247
+ .navItemDetail
248
+ margin-right 1rem
249
+
250
+ #aboutusBox
251
+ width 70%
252
+ height 400px
253
+
254
+ .footNavItem:last-child
255
+ margin-right 0