Skip to content

Commit 5f09551

Browse files
authored
Merge pull request #21 from 10gen/kk-refactor-navbar
Kk refactor navbar
2 parents 16a831f + de17509 commit 5f09551

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+13328
-94750
lines changed

config.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ contentDir = "content-html"
3636
name = "MongoDB Enterprise"
3737
facet = "product"
3838

39-
[[tags]]
40-
id = "driver"
41-
name = "Driver"
42-
facet = "product"
43-
4439
# Topic Options
4540
[[tags]]
4641
id = "administration"

themes/mongodb-tutorials/Gulpfile.js

Lines changed: 15 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -39,59 +39,13 @@ gulp.task('sass:build-navbar', function() {
3939
.pipe(gulp.dest('./static/css/'))
4040
})
4141

42-
gulp.task('sass', ['sass:lint', 'sass:build'])
43-
44-
gulp.task('js:build-home', function() {
45-
gulp.src('./src/home.js')
46-
.pipe(webpack({
47-
output: {
48-
filename: 'home.js'
49-
},
50-
devtool: 'source-maps',
51-
module: {
52-
loaders: [
53-
{
54-
test: /\.js$/,
55-
loader: 'babel-loader',
56-
query: {
57-
presets: ['es2015', 'react'],
58-
plugins: ['transform-class-properties']
59-
}
60-
}
61-
]
62-
}
63-
}))
64-
.pipe(gulp.dest('./static/js/'))
65-
})
66-
67-
gulp.task('js:build-single', function() {
68-
gulp.src('./src/single.js')
69-
.pipe(webpack({
70-
output: {
71-
filename: 'single.js'
72-
},
73-
devtool: 'source-maps',
74-
module: {
75-
loaders: [
76-
{
77-
test: /\.js$/,
78-
loader: 'babel-loader',
79-
query: {
80-
presets: ['es2015', 'react'],
81-
plugins: ['transform-class-properties']
82-
}
83-
}
84-
]
85-
}
86-
}))
87-
.pipe(gulp.dest('./static/js/'))
88-
})
42+
gulp.task('sass', ['sass:lint', 'sass:build', 'sass:build-navbar'])
8943

9044
gulp.task('js:build-navbar', function() {
91-
gulp.src('./src/navbar-docs.js')
45+
gulp.src('./src/navbar.js')
9246
.pipe(webpack({
9347
output: {
94-
filename: 'navbar-docs.js'
48+
filename: 'navbar.js'
9549
},
9650
devtool: 'source-maps',
9751
module: {
@@ -110,34 +64,11 @@ gulp.task('js:build-navbar', function() {
11064
.pipe(gulp.dest('./static/js/'))
11165
})
11266

113-
gulp.task('js:build-navbar-landing', function() {
114-
gulp.src('./src/navbar-landing.js')
115-
.pipe(webpack({
116-
output: {
117-
filename: 'navbar-landing.js'
118-
},
119-
devtool: 'source-maps',
120-
module: {
121-
loaders: [
122-
{
123-
test: /\.js$/,
124-
loader: 'babel-loader',
125-
query: {
126-
presets: ['es2015', 'react'],
127-
plugins: ['transform-class-properties']
128-
}
129-
}
130-
]
131-
}
132-
}))
133-
.pipe(gulp.dest('./static/js/'))
134-
})
135-
136-
gulp.task('js:build-navbar-tools', function() {
137-
gulp.src('./src/navbar-tools.js')
67+
gulp.task('js:build-home', function() {
68+
gulp.src('./src/home.js')
13869
.pipe(webpack({
13970
output: {
140-
filename: 'navbar-tools.js'
71+
filename: 'home.js'
14172
},
14273
devtool: 'source-maps',
14374
module: {
@@ -156,11 +87,11 @@ gulp.task('js:build-navbar-tools', function() {
15687
.pipe(gulp.dest('./static/js/'))
15788
})
15889

159-
gulp.task('js:build-navbar-cloud', function() {
160-
gulp.src('./src/navbar-cloud.js')
90+
gulp.task('js:build-single', function() {
91+
gulp.src('./src/single.js')
16192
.pipe(webpack({
16293
output: {
163-
filename: 'navbar-cloud.js'
94+
filename: 'single.js'
16495
},
16596
devtool: 'source-maps',
16697
module: {
@@ -179,11 +110,11 @@ gulp.task('js:build-navbar-cloud', function() {
179110
.pipe(gulp.dest('./static/js/'))
180111
})
181112

182-
gulp.task('js:build-landing-sidebar', function() {
113+
gulp.task('js:build-landing', function() {
183114
gulp.src('./src/landing.js')
184115
.pipe(webpack({
185116
output: {
186-
filename: 'landing-sidebar.js'
117+
filename: 'landing.js'
187118
},
188119
devtool: 'source-maps',
189120
module: {
@@ -202,39 +133,11 @@ gulp.task('js:build-landing-sidebar', function() {
202133
.pipe(gulp.dest('./static/js/'))
203134
})
204135

205-
gulp.task('js:build-landing-list', function() {
206-
gulp.src('./src/landing-list.js')
207-
.pipe(webpack({
208-
output: {
209-
filename: 'landing-list.js'
210-
},
211-
devtool: 'source-maps',
212-
module: {
213-
loaders: [
214-
{
215-
test: /\.js$/,
216-
loader: 'babel-loader',
217-
query: {
218-
presets: ['es2015', 'react'],
219-
plugins: ['transform-class-properties']
220-
}
221-
}
222-
]
223-
}
224-
}))
225-
.pipe(gulp.dest('./static/js/'))
226-
})
227-
228-
gulp.task('js', ['js:build-home', 'js:build-single'])
229-
230-
gulp.task('landing', [
136+
gulp.task('js', [
137+
'js:build-home',
138+
'js:build-single',
231139
'js:build-navbar',
232-
'js:build-navbar-landing',
233-
'js:build-navbar-tools',
234-
'js:build-navbar-cloud',
235-
'js:build-landing-sidebar',
236-
'js:build-landing-list',
237-
'sass:build-navbar',
140+
'js:build-landing'
238141
])
239142

240143
gulp.task('watch', function() {
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
{{ partial "header.html" . }}
2-
<div id="root">
3-
</div>
2+
43
<div class="main">
54
{{.Content}}
65
</div>
76

8-
<script>
9-
window.__baseURL__ = '{{.Site.BaseURL}}';
10-
</script>
117
<script src="{{.Site.BaseURL}}js/single.js"></script>
12-
</body>
13-
</html>
8+
9+
{{ partial "footer.html" . }}
Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,7 @@
11
{{ partial "header.html" . }}
22

3-
<div id="root">
4-
<nav class="navbar">
5-
<div class="navbar__left">
6-
<a href="{{.Site.BaseURL}}">
7-
<img src="{{.Site.BaseURL}}images/mongodb-logo.svg" class="navbar-brand" alt="MongoDB Logo" />
8-
</a>
3+
<div id="main" data-mainprops='{"assetsPrefix": ""}'></div>
94

10-
<div class="navbar-dropdown">
11-
<span>Documentation</span>
12-
</div>
13-
</div>
14-
15-
<div class="navbar__middle">
16-
<a href="#" class="navbar-link">Server</a>
17-
<a href="#" class="navbar-link">Drivers</a>
18-
<a href="#" class="navbar-link">Cloud</a>
19-
<a href="#" class="navbar-link">Tools</a>
20-
<a href="{{.Site.BaseURL}}" class="navbar-link navbar-link--active">Tutorials</a>
21-
</div>
22-
23-
<a href="#" class="navbar-download">Download MongoDB</a>
24-
<img src="{{.Site.BaseURL}}images/download-icon.svg" alt="Download Icon" />
25-
26-
<div class="navbar__right">
27-
<input type="text" class="navbar-search" placeholder="Search" />
28-
</div>
29-
</nav>
30-
31-
<div class="main">
32-
<aside class="main__sidebar">
33-
<div class="facets">
34-
</div>
35-
</aside>
36-
37-
<div class="main__content">
38-
<h1>MongoDB Tutorials</h1>
39-
40-
<div class="tutorials">
41-
{{- range first 10 .Data.Pages }}
42-
<h4><a href="{{ .Permalink }}">{{ .Title }}</a></h4>
43-
{{- end }}
44-
</div>
45-
</div>
46-
</div>
47-
</div>
48-
49-
<script>
50-
window.__baseURL__ = '{{.Site.BaseURL}}';
51-
</script>
525
<script src="{{.Site.BaseURL}}js/home.js"></script>
53-
</body>
54-
</html>
556

7+
{{ partial "footer.html" . }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<script src="{{.Site.BaseURL}}/js/bundle.js"></script>
1+
<script src="{{.Site.BaseURL}}js/navbar.js"></script>
22
</body>
33
</html>

themes/mongodb-tutorials/layouts/partials/header.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
<title>{{ .Title }}</title>
55
<link rel="shortcut icon" href="{{ .Site.BaseURL }}images/favicon.ico" type="image/x-icon">
66
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/app.min.css" />
7+
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/navbar.min.css" />
78
</head>
89
<body>
10+
<div id="navbar" data-navprops='{"assetsPrefix": "","links": [{"url": "/redesign/manual/","text": "Server"},{"url": "/redesign/ecosystem/drivers/","text": "Drivers"},{"url": "/redesign/cloud/","text": "Cloud"},{"url": "/redesign/tools","text": "Tools"},{"url": "/redesign/tutorials/","text": "Tutorials","active": true}],"dropdown": {"home": "/redesign/","documentation": {"server": "/redesign/manual/","drivers": {"c": "http://mongoc.org/libmongoc/current/","cpp11": "https://mongodb.github.io/mongo-cxx-driver/","cs": "/redesign/ecosystem/drivers/csharp/","java": "http://mongodb.github.io/mongo-java-driver/","node": "https://mongodb.github.io/node-mongodb-native/","perl": "/redesign/ecosystem/drivers/perl/","php": "/redesign/ecosystem/drivers/php/","python": "/redesign/ecosystem/drivers/python/","ruby": "/redesign/ruby-driver/master/","scala": "/redesign/ecosystem/drivers/scala/"},"cloud": {"mongodb-atlas": "https://www.mongodb.com/cloud/atlas","mongodb-cloud-manager": "https://www.mongodb.com/cloud/cloud-manager","mongodb-ops-manager": "https://www.mongodb.com/products/ops-manager"},"tools": "/redesign/tools/","tutorials": "/redesign/tutorials/"},"company": "https://www.mongodb.com/","university": "https://university.mongodb.com/","community": "https://www.mongodb.com/community","what-is-mongodb": "https://www.mongodb.com/what-is-mongodb","download-mongodb": "https://www.mongodb.com/download-center?jmp=docs","contact-us": "#"}}'></div>

themes/mongodb-tutorials/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"license": "ISC",
1212
"dependencies": {
1313
"classnames": "^2.2.5",
14-
"dom-slider": "^1.2.4",
1514
"dynamics.js": "^1.1.5",
1615
"element-class": "^0.2.2",
1716
"lodash.capitalize": "^4.2.1",
18-
"lunr": "i80and/lunr.js#19a85e62ae8103a48ce5a1fad507f758cf6016d9",
17+
"lunr": "^2.1.0",
1918
"react": "^15.4.2",
20-
"react-dom": "^15.4.2"
19+
"react-dom": "^15.4.2",
20+
"velocity-animate": "^1.5.0"
2121
},
2222
"devDependencies": {
2323
"babel-core": "^6.24.0",

themes/mongodb-tutorials/src/SearchChannel.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default class SearchChannel {
2020
}
2121

2222
this.busy = false
23+
2324
if (this.pending !== null) {
2425
this.search(this.pending)
2526
}
@@ -33,12 +34,12 @@ export default class SearchChannel {
3334
search(query) {
3435
if (!this.busy) {
3536
if (!query) {
36-
this.onresults([])
37+
this.onresults(null)
3738
} else {
3839
this.worker.postMessage({ 'search': query })
40+
this.busy = true
3941
}
4042
this.pending = null
41-
this.busy = true
4243
} else {
4344
this.pending = query
4445
}

0 commit comments

Comments
 (0)