Skip to content

Commit e602b88

Browse files
authored
Synced recent (code) updates (#698)
* synced recent code updates * disabled initHashLevelRedirects() temporarily
1 parent eacd90c commit e602b88

25 files changed

+434
-306
lines changed

_config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,3 @@ alias:
188188
examples/svg.html: v2/examples/svg.html
189189
examples/todomvc.html: v2/examples/todomvc.html
190190
examples/tree-view.html: v2/examples/tree-view.html
191-

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
"name": "cn.vuejs.org",
33
"private": true,
44
"hexo": {
5-
"version": "3.4.4"
5+
"version": "3.7.0"
66
},
77
"scripts": {
88
"start": "hexo server",
99
"build": "node pre-deploy.js && hexo clean && hexo generate",
1010
"deploy": "npm run build && hexo deploy"
1111
},
1212
"dependencies": {
13-
"hexo": "^3.4.2",
13+
"hexo": "^3.6.0",
1414
"hexo-deployer-git": "0.3.1",
1515
"hexo-generator-alias": "git+https://github.com/chrisvfritz/vuejs.org-hexo-generator-alias.git",
1616
"hexo-generator-archive": "^0.1.5",
1717
"hexo-generator-category": "^0.1.3",
1818
"hexo-generator-feed": "^1.2.2",
1919
"hexo-generator-index": "^0.2.1",
2020
"hexo-generator-tag": "^0.2.0",
21-
"hexo-offline": "^0.2.2",
21+
"hexo-offline": "^0.2.3",
2222
"hexo-renderer-ejs": "^0.3.1",
2323
"hexo-renderer-marked": "^0.3.0",
2424
"hexo-renderer-stylus": "^0.3.3",
25-
"hexo-server": "^0.2.2",
26-
"request": "^2.83.0"
25+
"hexo-server": "^0.3.1",
26+
"request": "^2.85.0"
2727
}
28-
}
28+
}

src/images/breakpoint_hit.png

610 KB
Loading

src/images/breakpoint_set.png

536 KB
Loading

src/images/components.png

-9.8 KB
Loading

src/images/config_add.png

518 KB
Loading

src/images/data.png

-38.4 KB
Loading

src/images/devtools-timetravel.gif

313 KB
Loading

src/images/hn-architecture.png

-107 KB
Loading

src/images/hn.png

-116 KB
Loading

src/images/mvvm.png

-26.8 KB
Loading

src/images/props-events.png

-16.8 KB
Loading

src/images/state.png

-22.2 KB
Loading
-158 KB
Loading

src/images/vue-component.png

-125 KB
Loading

src/images/vuetron-heirarchy.gif

3.37 MB
Loading

themes/vue/_config.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ platinum_sponsors:
1717
img: tooltwist.png
1818
- url: https://vueschool.io/?utm_source=Vuejs.org&utm_medium=Banner&utm_campaign=Sponsored%20Banner&utm_content=V1
1919
img: vueschool.png
20-
- url: https://www.datacamp.com/careers?utm_source=vuejs&utm_medium=sidebar
21-
img: datacamp.png
20+
- url: https://vehikl.com/
21+
img: vehikl.png
2222

2323
platinum_sponsors_china:
2424
- url: https://xiaozhuanlan.com/
@@ -55,6 +55,10 @@ gold_sponsors:
5555
img: bmqb.png
5656
- url: https://codepilot.ai
5757
img: codepilot.png
58+
- url: https://teamextension.io/
59+
img: teamextension.png
60+
- url: https://jsguru.io/
61+
img: jsguru.png
5862

5963
bronze_sponsors:
6064
- url: http://tighten.co/

themes/vue/layout/partials/toc.ejs

-16
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,8 @@
2727
<li><h3>更多</h3></li>
2828
<% } %>
2929
<% } %>
30-
<% if (type === 'cookbook') { %>
31-
<% if (p.order === 1.1) { %>
32-
<li><h3>Vue Instance</h3></li>
33-
<% } %>
34-
<!-- Move cookbook sections here once they have -->
35-
<!-- at least one recipe -->
36-
<% } %>
3730
<li>
3831
<a href="<%- url_for(p.path) %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.title %></a>
3932
</li>
4033
<% }) %>
41-
<% if (type === 'cookbook') { %>
42-
<li><h3>Components</h3></li>
43-
<li><h4>Form Inputs</h4></li>
44-
<li><h4>3rd-Party Integrations</h4></li>
45-
<li><h3>Transitions</h3></li>
46-
<li><h3>Directives</h3></li>
47-
<li><h3>Vue Router</h3></li>
48-
<li><h3>Vuex</h3></li>
49-
<% } %>
5034
</ul>

themes/vue/source/css/_demo.styl

+10-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
h1
1515
margin: 0 0 .5em
1616
font-size: 1.8em
17+
h2
18+
padding: 0
19+
border: none
20+
h2, h3, h4, h5, h6
21+
margin: 1em 0
1722
ul, ol
1823
padding-left: 1.5em
1924
padding-bottom: .2em !important
@@ -34,13 +39,13 @@
3439
p
3540
margin: 0 !important
3641
padding: 0 !important
37-
&:first-child
38-
margin-top: 0
39-
&:last-child
40-
margin-bottom: 0
4142
textarea
4243
width: 100%
4344
resize: vertical
45+
> :first-child
46+
margin-top: 0
47+
> :last-child
48+
margin-bottom: 0
4449

4550

4651

@@ -67,4 +72,4 @@ ul#demo, ul.demo
6772
page-break-inside: avoid
6873
padding: 1em
6974
margin-bottom: 1em
70-
border-width: 2px
75+
border-width: 2px

themes/vue/source/css/_sponsors-sidebar.styl

+10-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
font-size: .85em
44
.logo
55
color: $light
6-
margin-top: 6px
6+
margin-top: 10px
77
text-align: center
88
font-weight: bold
99
display block
1010
&:first-child
1111
margin-top: 12px
1212
&:last-child
13-
margin-bottom: 12px
13+
margin-bottom: 14px
1414
img, a
1515
width: 125px
1616

@@ -25,9 +25,12 @@
2525
text-align: center
2626
margin-bottom: 20px
2727

28+
#sidebar-sponsors-special
29+
margin-topL: -10px
30+
2831
@media screen and (min-width: 1300px)
29-
#sidebar-sponsors
30-
position fixed
31-
z-index 99
32-
top 90px
33-
right 20px
32+
#sidebar-sponsors-platinum
33+
position: fixed
34+
z-index: 99
35+
top: 90px
36+
right: 20px

themes/vue/source/images/jsguru.png

15 KB
Loading
34.1 KB
Loading

themes/vue/source/images/vehikl.png

5.95 KB
Loading

themes/vue/source/js/common.js

+102-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(function () {
2+
// initHashLevelRedirects()
23
initMobileMenu()
34
initVideoModal()
45
if (PAGE_TYPE) {
@@ -8,6 +9,95 @@
89
initLocationHashFuzzyMatching()
910
}
1011

12+
// Most redirects should be specified in Hexo's
13+
// _config.yml. However, it can't handle hash-level
14+
// redirects, such as:
15+
//
16+
// /foo#hello -> /bar#hello
17+
//
18+
// For these cases where a section on one page has
19+
// moved to a perhaps differently-named section on
20+
// another page, we need this.
21+
function initHashLevelRedirects() {
22+
checkForHashRedirect(/components\.html$/, {
23+
'What-are-Components': '/v2/guide/components.html',
24+
'Using-Components': '/v2/guide/components-registration.html',
25+
'Global-Registration':
26+
'/v2/guide/components-registration.html#Global-Registration',
27+
'Local-Registration':
28+
'/v2/guide/components-registration.html#Local-Registration',
29+
'Composing-Components':
30+
'/v2/guide/components.html#Organizing-Components',
31+
Props:
32+
'/v2/guide/components.html#Passing-Data-to-Child-Components-with-Props',
33+
'Passing-Data-with-Props':
34+
'/v2/guide/components.html#Passing-Data-to-Child-Components-with-Props',
35+
'camelCase-vs-kebab-case':
36+
'/v2/guide/components-props.html#Prop-Casing-camelCase-vs-kebab-case',
37+
'Dynamic-Props':
38+
'/v2/guide/components-props.html#Static-and-Dynamic-Props',
39+
'Literal-vs-Dynamic':
40+
'/v2/guide/components-props.html#Static-and-Dynamic-Props',
41+
'One-Way-Data-Flow':
42+
'/v2/guide/components-props.html#One-Way-Data-Flow',
43+
'Prop-Validation': '/v2/guide/components-props.html#Prop-Validation',
44+
'Non-Prop-Attributes':
45+
'/v2/guide/components-props.html#Non-Prop-Attributes',
46+
'Replacing-Merging-with-Existing-Attributes':
47+
'/v2/guide/components-props.html#Replacing-Merging-with-Existing-Attributes',
48+
'Custom-Events':
49+
'/v2/guide/components.html#Sending-Messages-to-Parents-with-Events',
50+
'Using-v-on-with-Custom-Events':
51+
'/v2/guide/components.html#Sending-Messages-to-Parents-with-Events',
52+
'Binding-Native-Events-to-Components':
53+
'/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components',
54+
'sync-Modifier':
55+
'/v2/guide/components-custom-events.html#sync-Modifier',
56+
'Form-Input-Components-using-Custom-Events':
57+
'/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components',
58+
'Customizing-Component-v-model':
59+
'/v2/guide/components-custom-events.html#Customizing-Component-v-model',
60+
'Non-Parent-Child-Communication': '/v2/guide/state-management.html',
61+
'Compilation-Scope':
62+
'/v2/guide/components-slots.html#Compilation-Scope',
63+
'Single-Slot': '/v2/guide/components-slots.html#Slot-Content',
64+
'Named-Slots': '/v2/guide/components-slots.html#Named-Slots',
65+
'Scoped-Slots': '/v2/guide/components-slots.html#Scoped-Slots',
66+
'Dynamic-Components': '/v2/guide/components.html#Dynamic-Components',
67+
'keep-alive':
68+
'/v2/guide/components-dynamic-async.html#keep-alive-with-Dynamic-Components',
69+
Misc: '/v2/guide/components-edge-cases.html',
70+
'Authoring-Reusable-Components':
71+
'/v2/guide/components.html#Organizing-Components',
72+
'Child-Component-Refs':
73+
'/v2/guide/components-edge-cases.html#Accessing-Child-Component-Instances-amp-Child-Elements',
74+
'Async-Components':
75+
'/v2/guide/components-dynamic-async.html#Async-Components',
76+
'Advanced-Async-Components':
77+
'/v2/guide/components-dynamic-async.html#Handling-Loading-State',
78+
'Component-Naming-Conventions':
79+
'/v2/guide/components-registration.html#Component-Names',
80+
'Recursive-Components':
81+
'/v2/guide/components-edge-cases.html#Recursive-Components',
82+
'Circular-References-Between-Components':
83+
'/v2/guide/components-edge-cases.html#Circular-References-Between-Components',
84+
'Inline-Templates':
85+
'/v2/guide/components-edge-cases.html#Inline-Templates',
86+
'X-Templates': '/v2/guide/components-edge-cases.html#X-Templates',
87+
'Cheap-Static-Components-with-v-once':
88+
'/v2/guide/components-edge-cases.html#Cheap-Static-Components-with-v-once'
89+
})
90+
function checkForHashRedirect(pageRegex, redirects) {
91+
// Abort if the current page doesn't match the page regex
92+
if (!pageRegex.test(window.location.pathname)) return
93+
94+
var redirectPath = redirects[window.location.hash.slice(1)]
95+
if (redirectPath) {
96+
window.location.href = window.location.origin + redirectPath
97+
}
98+
}
99+
}
100+
11101
function initApiSpecLinks () {
12102
var apiContent = document.querySelector('.content.api')
13103
if (apiContent) {
@@ -260,7 +350,17 @@
260350
}, true)
261351

262352
// make links clickable
263-
allHeaders.forEach(makeHeaderClickable)
353+
allHeaders
354+
.filter(function(el) {
355+
if (!el.querySelector('a')) {
356+
return false
357+
}
358+
var demos = [].slice.call(document.querySelectorAll('demo'))
359+
return !demos.some(function(demoEl) {
360+
return demoEl.contains(el)
361+
})
362+
})
363+
.forEach(makeHeaderClickable)
264364

265365
smoothScroll.init({
266366
speed: 400,
@@ -421,7 +521,7 @@
421521
.replace(rControl, '')
422522
// Replace special characters
423523
.replace(rSpecial, separator)
424-
// Remove continous separators
524+
// Remove continuous separators
425525
.replace(new RegExp(escapedSep + '{2,}', 'g'), separator)
426526
// Remove prefixing and trailing separtors
427527
.replace(new RegExp('^' + escapedSep + '+|' + escapedSep + '+$', 'g'), '')

0 commit comments

Comments
 (0)