Skip to content

Synced recent (code) updates #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,3 @@ alias:
examples/svg.html: v2/examples/svg.html
examples/todomvc.html: v2/examples/todomvc.html
examples/tree-view.html: v2/examples/tree-view.html

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"name": "cn.vuejs.org",
"private": true,
"hexo": {
"version": "3.4.4"
"version": "3.7.0"
},
"scripts": {
"start": "hexo server",
"build": "node pre-deploy.js && hexo clean && hexo generate",
"deploy": "npm run build && hexo deploy"
},
"dependencies": {
"hexo": "^3.4.2",
"hexo": "^3.6.0",
"hexo-deployer-git": "0.3.1",
"hexo-generator-alias": "git+https://github.com/chrisvfritz/vuejs.org-hexo-generator-alias.git",
"hexo-generator-archive": "^0.1.5",
"hexo-generator-category": "^0.1.3",
"hexo-generator-feed": "^1.2.2",
"hexo-generator-index": "^0.2.1",
"hexo-generator-tag": "^0.2.0",
"hexo-offline": "^0.2.2",
"hexo-offline": "^0.2.3",
"hexo-renderer-ejs": "^0.3.1",
"hexo-renderer-marked": "^0.3.0",
"hexo-renderer-stylus": "^0.3.3",
"hexo-server": "^0.2.2",
"request": "^2.83.0"
"hexo-server": "^0.3.1",
"request": "^2.85.0"
}
}
}
Binary file added src/images/breakpoint_hit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/breakpoint_set.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/components.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/config_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/devtools-timetravel.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/hn-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/hn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/mvvm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/props-events.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/vue-component-with-preprocessors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/vue-component.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/vuetron-heirarchy.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions themes/vue/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ platinum_sponsors:
img: tooltwist.png
- url: https://vueschool.io/?utm_source=Vuejs.org&utm_medium=Banner&utm_campaign=Sponsored%20Banner&utm_content=V1
img: vueschool.png
- url: https://www.datacamp.com/careers?utm_source=vuejs&utm_medium=sidebar
img: datacamp.png
- url: https://vehikl.com/
img: vehikl.png

platinum_sponsors_china:
- url: https://xiaozhuanlan.com/
Expand Down Expand Up @@ -55,6 +55,10 @@ gold_sponsors:
img: bmqb.png
- url: https://codepilot.ai
img: codepilot.png
- url: https://teamextension.io/
img: teamextension.png
- url: https://jsguru.io/
img: jsguru.png

bronze_sponsors:
- url: http://tighten.co/
Expand Down
16 changes: 0 additions & 16 deletions themes/vue/layout/partials/toc.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,8 @@
<li><h3>更多</h3></li>
<% } %>
<% } %>
<% if (type === 'cookbook') { %>
<% if (p.order === 1.1) { %>
<li><h3>Vue Instance</h3></li>
<% } %>
<!-- Move cookbook sections here once they have -->
<!-- at least one recipe -->
<% } %>
<li>
<a href="<%- url_for(p.path) %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.title %></a>
</li>
<% }) %>
<% if (type === 'cookbook') { %>
<li><h3>Components</h3></li>
<li><h4>Form Inputs</h4></li>
<li><h4>3rd-Party Integrations</h4></li>
<li><h3>Transitions</h3></li>
<li><h3>Directives</h3></li>
<li><h3>Vue Router</h3></li>
<li><h3>Vuex</h3></li>
<% } %>
</ul>
15 changes: 10 additions & 5 deletions themes/vue/source/css/_demo.styl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
h1
margin: 0 0 .5em
font-size: 1.8em
h2
padding: 0
border: none
h2, h3, h4, h5, h6
margin: 1em 0
ul, ol
padding-left: 1.5em
padding-bottom: .2em !important
Expand All @@ -34,13 +39,13 @@
p
margin: 0 !important
padding: 0 !important
&:first-child
margin-top: 0
&:last-child
margin-bottom: 0
textarea
width: 100%
resize: vertical
> :first-child
margin-top: 0
> :last-child
margin-bottom: 0



Expand All @@ -67,4 +72,4 @@ ul#demo, ul.demo
page-break-inside: avoid
padding: 1em
margin-bottom: 1em
border-width: 2px
border-width: 2px
17 changes: 10 additions & 7 deletions themes/vue/source/css/_sponsors-sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
font-size: .85em
.logo
color: $light
margin-top: 6px
margin-top: 10px
text-align: center
font-weight: bold
display block
&:first-child
margin-top: 12px
&:last-child
margin-bottom: 12px
margin-bottom: 14px
img, a
width: 125px

Expand All @@ -25,9 +25,12 @@
text-align: center
margin-bottom: 20px

#sidebar-sponsors-special
margin-topL: -10px

@media screen and (min-width: 1300px)
#sidebar-sponsors
position fixed
z-index 99
top 90px
right 20px
#sidebar-sponsors-platinum
position: fixed
z-index: 99
top: 90px
right: 20px
Binary file added themes/vue/source/images/jsguru.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/vue/source/images/teamextension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/vue/source/images/vehikl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 102 additions & 2 deletions themes/vue/source/js/common.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(function () {
// initHashLevelRedirects()
initMobileMenu()
initVideoModal()
if (PAGE_TYPE) {
Expand All @@ -8,6 +9,95 @@
initLocationHashFuzzyMatching()
}

// Most redirects should be specified in Hexo's
// _config.yml. However, it can't handle hash-level
// redirects, such as:
//
// /foo#hello -> /bar#hello
//
// For these cases where a section on one page has
// moved to a perhaps differently-named section on
// another page, we need this.
function initHashLevelRedirects() {
checkForHashRedirect(/components\.html$/, {
'What-are-Components': '/v2/guide/components.html',
'Using-Components': '/v2/guide/components-registration.html',
'Global-Registration':
'/v2/guide/components-registration.html#Global-Registration',
'Local-Registration':
'/v2/guide/components-registration.html#Local-Registration',
'Composing-Components':
'/v2/guide/components.html#Organizing-Components',
Props:
'/v2/guide/components.html#Passing-Data-to-Child-Components-with-Props',
'Passing-Data-with-Props':
'/v2/guide/components.html#Passing-Data-to-Child-Components-with-Props',
'camelCase-vs-kebab-case':
'/v2/guide/components-props.html#Prop-Casing-camelCase-vs-kebab-case',
'Dynamic-Props':
'/v2/guide/components-props.html#Static-and-Dynamic-Props',
'Literal-vs-Dynamic':
'/v2/guide/components-props.html#Static-and-Dynamic-Props',
'One-Way-Data-Flow':
'/v2/guide/components-props.html#One-Way-Data-Flow',
'Prop-Validation': '/v2/guide/components-props.html#Prop-Validation',
'Non-Prop-Attributes':
'/v2/guide/components-props.html#Non-Prop-Attributes',
'Replacing-Merging-with-Existing-Attributes':
'/v2/guide/components-props.html#Replacing-Merging-with-Existing-Attributes',
'Custom-Events':
'/v2/guide/components.html#Sending-Messages-to-Parents-with-Events',
'Using-v-on-with-Custom-Events':
'/v2/guide/components.html#Sending-Messages-to-Parents-with-Events',
'Binding-Native-Events-to-Components':
'/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components',
'sync-Modifier':
'/v2/guide/components-custom-events.html#sync-Modifier',
'Form-Input-Components-using-Custom-Events':
'/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components',
'Customizing-Component-v-model':
'/v2/guide/components-custom-events.html#Customizing-Component-v-model',
'Non-Parent-Child-Communication': '/v2/guide/state-management.html',
'Compilation-Scope':
'/v2/guide/components-slots.html#Compilation-Scope',
'Single-Slot': '/v2/guide/components-slots.html#Slot-Content',
'Named-Slots': '/v2/guide/components-slots.html#Named-Slots',
'Scoped-Slots': '/v2/guide/components-slots.html#Scoped-Slots',
'Dynamic-Components': '/v2/guide/components.html#Dynamic-Components',
'keep-alive':
'/v2/guide/components-dynamic-async.html#keep-alive-with-Dynamic-Components',
Misc: '/v2/guide/components-edge-cases.html',
'Authoring-Reusable-Components':
'/v2/guide/components.html#Organizing-Components',
'Child-Component-Refs':
'/v2/guide/components-edge-cases.html#Accessing-Child-Component-Instances-amp-Child-Elements',
'Async-Components':
'/v2/guide/components-dynamic-async.html#Async-Components',
'Advanced-Async-Components':
'/v2/guide/components-dynamic-async.html#Handling-Loading-State',
'Component-Naming-Conventions':
'/v2/guide/components-registration.html#Component-Names',
'Recursive-Components':
'/v2/guide/components-edge-cases.html#Recursive-Components',
'Circular-References-Between-Components':
'/v2/guide/components-edge-cases.html#Circular-References-Between-Components',
'Inline-Templates':
'/v2/guide/components-edge-cases.html#Inline-Templates',
'X-Templates': '/v2/guide/components-edge-cases.html#X-Templates',
'Cheap-Static-Components-with-v-once':
'/v2/guide/components-edge-cases.html#Cheap-Static-Components-with-v-once'
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个后面还得翻译……现在这样处理 .js 文件不能无脑同步了……

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,我其实已经把入口注释掉了,打算等 components 都翻译完上线了之后再更新这里。所以这个 PR 是可以现在就 review 的🙂

function checkForHashRedirect(pageRegex, redirects) {
// Abort if the current page doesn't match the page regex
if (!pageRegex.test(window.location.pathname)) return

var redirectPath = redirects[window.location.hash.slice(1)]
if (redirectPath) {
window.location.href = window.location.origin + redirectPath
}
}
}

function initApiSpecLinks () {
var apiContent = document.querySelector('.content.api')
if (apiContent) {
Expand Down Expand Up @@ -260,7 +350,17 @@
}, true)

// make links clickable
allHeaders.forEach(makeHeaderClickable)
allHeaders
.filter(function(el) {
if (!el.querySelector('a')) {
return false
}
var demos = [].slice.call(document.querySelectorAll('demo'))
return !demos.some(function(demoEl) {
return demoEl.contains(el)
})
})
.forEach(makeHeaderClickable)

smoothScroll.init({
speed: 400,
Expand Down Expand Up @@ -421,7 +521,7 @@
.replace(rControl, '')
// Replace special characters
.replace(rSpecial, separator)
// Remove continous separators
// Remove continuous separators
.replace(new RegExp(escapedSep + '{2,}', 'g'), separator)
// Remove prefixing and trailing separtors
.replace(new RegExp('^' + escapedSep + '+|' + escapedSep + '+$', 'g'), '')
Expand Down
Loading