Skip to content

Commit 8075e99

Browse files
committed
wip
1 parent 96fd941 commit 8075e99

23 files changed

+269
-108
lines changed

build/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const moment = require('moment');
1515

1616
// custom plugins
1717
const link_index = require('./plugins/link_index');
18+
const categories = require('./plugins/categories');
1819
const changeExt = require('./plugins/change-ext');
1920
const markdown = require('./plugins/markdown');
2021
const layouts = require('./plugins/layouts');
@@ -49,6 +50,7 @@ Metalsmith(cwd)
4950
"layouts/**/*": '**/*.md',
5051
}
5152
})))
53+
.use(categories())
5254
// group certain files into collections
5355
.use(collections({
5456
blog: {
@@ -66,7 +68,7 @@ Metalsmith(cwd)
6668
// use multiple languages
6769
.use(multiLanguage({
6870
default: 'en',
69-
locales: ['en', 'hu']
71+
locales: ['en']
7072
}))
7173
// render markdown using our own plugin around marked
7274
.use(markdown())

build/plugins/categories.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const path = require('path');
2+
const fs = require('fs');
3+
4+
5+
function plugin(opts) {
6+
7+
8+
return function (files, metalsmith, done) {
9+
const meta = metalsmith.metadata();
10+
const map = {};
11+
12+
Object.keys(files).forEach((file) => {
13+
const data = files[file];
14+
const info = path.parse(file);
15+
16+
if (info.dir.includes('docs')) {
17+
data.categories = data.categories || info.dir.split(path.sep).splice(2);
18+
const p = data.categories.join(':');
19+
map[p] = map[p] || [];
20+
map[p].push(data);
21+
22+
data.layout = data.layout || 'docs.ejs';
23+
}
24+
});
25+
26+
console.log(map);
27+
meta.docs_categories = Object.keys(map).reduce((acc, curr) => {
28+
acc.push({
29+
title: curr || 'introduction',
30+
children: map[curr],
31+
level: curr.split(':').length
32+
});
33+
return acc;
34+
}, []);
35+
done();
36+
}
37+
}
38+
39+
module.exports = plugin;

build/plugins/link_index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function plugin(opts) {
1010
}
1111
});
1212

13-
console.log(links);
13+
// console.log(links);
1414
done();
1515
}
1616
}

build/plugins/toc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function plugin(opts) {
1313
if (data.toc === true) {
1414
try {
1515
data.toc = new tocJSON().generateJSON(data.contents.toString());
16-
console.log(data.contents.toString())
16+
// console.log(data.contents.toString())
1717
} catch (err) {
1818
return done(err);
1919
}
@@ -27,7 +27,7 @@ function plugin(opts) {
2727
}
2828
} else {
2929
data.toc = false;
30-
data.layout = data.layout || 'no_sidebar.ejs'
30+
data.layout = data.layout || 'no_sidebar.ejs';
3131
}
3232
});
3333
done();

content/docs/en/elements/Label.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

content/docs/en/troubleshooting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
title: Troubleshooting
23
original: https://raw.githubusercontent.com/NativeScript/docs/master/docs/start/troubleshooting.md
34
---
45

content/docs/en/using-nativescript-plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Using NativeScript Plugins
44

55
Plugins work as in any other NativeScript app, but you may wonder how UI plugins would work with Vue.
66

7-
UI plugins work almost identically to how you'd use a NativeScript UI plugin in an Angular app. For instance consider this example usage of [nativescript-gradient](https://github.com/EddyVerbruggen/nativescript-gradient) which is used in the [listview sample](samples/app/app-with-list-view.js):
7+
UI plugins work almost identically to how you'd use a NativeScript UI plugin in an Angular app. For instance consider this example usage of [nativescript-gradient](https://github.com/EddyVerbruggen/nativescript-gradient) which is used in the [listview sample](https://github.com/rigor789/nativescript-vue/tree/master/samples/app/app-with-list-view.js):
88

99
Install the plugin by running this command in the samples folder:
1010

content/docs/en/using-vue-modules.md renamed to content/docs/en/using-vue-plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Using NativeScript Plugins
2+
title: Using Vue Plugins
33
---
44

55
## vue-router

content/index_en.ejs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: landing.ejs
33
---
44

55
<div class="bg-blue-light">
6-
<div class="container mx-auto px-4 py-8">
6+
<div class="container mx-auto py-8">
77

88
<div class="w-1/2 my-8">
99
<h1 class="text-5xl leading-tight text-white">Truly native apps using Vue.js and NativeScript</h1>
@@ -15,7 +15,8 @@ layout: landing.ejs
1515
NativeScript-Vue is the right choice for you!
1616
</p>
1717

18-
<a href="#" class="px-8 py-4 inline-block bg-green text-white font-bold text-lg no-underline mt-8">
18+
<!-- TODO set the correct link for getting started -->
19+
<a href="/" class="px-8 py-4 inline-block bg-green text-white font-bold text-lg no-underline mt-8">
1920
Get Started
2021
</a>
2122
</div>

content/index_hu.ejs

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy