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.

layouts/_partials/categories.ejs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<li class="level-<%= entry.level || 0 %>">
2+
<% if(entry.path) { %>
3+
<a class="block py-1 border-r-4 pr-2 hover:border-green <%= path === entry.path ? 'border-green text-green' : 'border-green-lightest text-blue-dark' %> no-underline leading-tight hover:underline" href="/<%= entry.path %>">
4+
<%= entry.title %>
5+
</a>
6+
<% } else if(entry.title) { %>
7+
<span><%= entry.title %></span>
8+
<% } %>
9+
10+
<% if(entry.children) { %>
11+
<ul class="list-reset">
12+
<% entry.children.forEach((item) => { %>
13+
<%- include('_partials/categories', { entry: item }) %>
14+
<% }) %>
15+
</ul>
16+
<% } %>
17+
</li>

layouts/_partials/header.ejs

Lines changed: 61 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,72 @@
1-
<div class="AppHeader">
2-
<div class="bg-blue-dark border-t-8 border-green">
3-
<div class="container flex items-center flex-wrap px-4 py-1 mx-auto">
4-
<a href="/" class="w-1/4 flex-1">
5-
<div class="relative w-16 h-16">
6-
<img class="w-16 h-16 absolute pin"
7-
src="https://art.nativescript-vue.org/NativeScript-Vue-White-Green.svg"
8-
alt="NativeScript-Vue Logo">
9-
<img class="w-16 h-16 absolute pin transition-all-ease hover:opacity-0"
10-
src="https://art.nativescript-vue.org/NativeScript-Vue-Green-White.svg"
11-
alt="NativeScript-Vue Logo">
12-
</div>
13-
</a>
14-
<div class="w-auto text-center relative">
15-
<input class="w-full md:w-48 px-4 py-2 text-blue-lightest bg-blue-light rounded-full"
16-
type="search"
17-
placeholder="Search coming soon."
18-
disabled
19-
>
20-
21-
<div class="hidden absolute ml-2 mt-2">
22-
<div class="border bg-white rounded shadow w-48"></div>
23-
</div>
1+
<div class="bg-blue-dark border-t-8 border-green">
2+
<div class="container flex items-center flex-wrap px-4 md:px-0 mx-auto">
3+
<a href="/" class="w-1/4 flex-1">
4+
<div class="relative w-16 h-16">
5+
<img class="w-16 h-16 absolute pin"
6+
src="https://art.nativescript-vue.org/NativeScript-Vue-White-Green.svg"
7+
alt="NativeScript-Vue Logo">
8+
<img class="w-16 h-16 absolute pin transition-all-ease hover:opacity-0"
9+
src="https://art.nativescript-vue.org/NativeScript-Vue-Green-White.svg"
10+
alt="NativeScript-Vue Logo">
2411
</div>
12+
</a>
13+
<div class="w-auto text-center relative">
14+
<input class="w-full md:w-48 px-4 py-2 text-blue-lightest bg-blue-light rounded-full"
15+
type="search"
16+
aria-label="Search"
17+
placeholder="Search coming soon."
18+
disabled
19+
>
2520

26-
<!-- Bars -->
27-
<div class="ml-4 md:hidden text-right" @click="navOpen = !navOpen">
28-
<div class="inline-block">
29-
<div class="w-6 h-2px bg-white mb-1"></div>
30-
<div class="w-6 h-2px bg-white mb-1"></div>
31-
<div class="w-6 h-2px bg-white"></div>
32-
</div>
21+
<div class="hidden absolute ml-2 mt-2">
22+
<div class="border bg-white rounded shadow w-48"></div>
3323
</div>
24+
</div>
3425

35-
<!-- Nav -->
36-
<div :class="{ hidden: isMobile && !navOpen, flex: isMobile && navOpen }"
37-
class="flex-col md:flex-row w-full md:w-auto">
38-
<a href="#" class="no-underline text-blue-lightest md:ml-6 mr-4 py-4">Quick Start</a>
39-
<a href="#" class="no-underline text-blue-lightest mr-4 py-4">Docs</a>
40-
<a href="/<%= collections.blog[0].path %>" class="no-underline text-blue-lightest mr-4 py-4">Blog</a>
41-
<div class="inline text-blue-lightest mr-4 py-4 relative group">
42-
Community
26+
<!-- Bars -->
27+
<div class="ml-4 md:hidden text-right" @click="navOpen = !navOpen">
28+
<div class="inline-block">
29+
<div class="w-6 h-2px bg-white mb-1"></div>
30+
<div class="w-6 h-2px bg-white mb-1"></div>
31+
<div class="w-6 h-2px bg-white"></div>
32+
</div>
33+
</div>
4334

44-
<div class="pl-4 mt-3 md:pl-0 md:hidden group-hover:block hover:block md:absolute md:bg-white md:shadow md:rounded md:pin-r overflow-hidden">
45-
<div class="flex flex-col">
46-
<a href="#" class="no-underline text-blue-lightest md:text-blue-dark hover:bg-green hover:text-white px-4 py-2">GitHub</a>
47-
<a href="#" class="no-underline text-blue-lightest md:text-blue-dark hover:bg-green hover:text-white px-4 py-2">Slack</a>
48-
</div>
49-
</div>
50-
</div>
51-
<div class="inline text-blue-lightest py-4 relative group">
52-
<svg class="w-4 h-4 fill-current -mb-px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><path d="M20,10c0,-5.532 -4.488,-10 -10,-10c-5.509,0 -10,4.465 -10,10c0,5.522 4.477,10 10,10c5.52,0 10,-4.475 10,-10Zm-1.678,2.581l-4.01,0c0.277,-1.73 0.266,-3.497 0.002,-5.162l4.008,0c0.517,1.67 0.517,3.492 0,5.162Zm-8.322,6.064c-1.239,-1.118 -2.183,-2.803 -2.72,-4.774l5.44,0c-0.537,1.971 -1.481,3.656 -2.72,4.774Zm-3.006,-6.064c-0.29,-1.669 -0.297,-3.449 0.001,-5.162l6.01,0c0.298,1.712 0.291,3.492 0.001,5.162l-6.012,0Zm3.006,-11.225c1.353,1.221 2.24,3.022 2.718,4.773l-5.436,0c0.48,-1.76 1.37,-3.556 2.718,-4.773Zm7.804,4.773l-3.75,0c-0.441,-1.78 -1.184,-3.375 -2.173,-4.635c2.588,0.569 4.762,2.295 5.923,4.635Zm-9.685,-4.635c-0.989,1.26 -1.732,2.855 -2.173,4.635l-3.75,0c1.161,-2.34 3.335,-4.066 5.923,-4.635Zm-6.441,5.925l4.008,0c-0.264,1.665 -0.275,3.432 0.002,5.162l-4.01,0c-0.517,-1.67 -0.517,-3.492 0,-5.162Zm0.518,6.452l3.755,0c0.443,1.781 1.188,3.38 2.17,4.636c-2.602,-0.572 -4.77,-2.308 -5.925,-4.636Zm9.683,4.636c0.982,-1.256 1.727,-2.855 2.17,-4.636l3.755,0c-1.157,2.332 -3.327,4.065 -5.925,4.636Z" style="fill-rule:nonzero;"/></svg>
53-
<span class="md:hidden">Language</span>
35+
<!-- Nav -->
36+
<div :class="{ hidden: isMobile && !navOpen, flex: isMobile && navOpen }"
37+
class="flex-col md:flex-row w-full md:w-auto">
38+
<span class="no-underline text-blue-lightest md:ml-6 mr-4 py-4">Quick Start</span>
39+
<a href="/en/docs/about-nativescript-vue" class="no-underline text-blue-lightest mr-4 py-4">Docs</a>
40+
<a href="/<%= collections.blog[0].path %>" class="no-underline text-blue-lightest mr-4 py-4">Blog</a>
41+
<div class="inline text-blue-lightest mr-4 py-4 relative group">
42+
Community
5443

55-
<div class="pl-4 mt-3 md:pl-0 md:hidden group-hover:block hover:block md:absolute md:bg-white md:shadow md:rounded md:pin-r overflow-hidden">
56-
<div class="flex flex-col">
57-
<a href="/" class="no-underline text-blue-lightest md:text-blue-dark hover:bg-green hover:text-white px-4 py-2">en</a>
58-
<a href="/hu" class="no-underline text-blue-lightest md:text-blue-dark hover:bg-green hover:text-white px-4 py-2">hu</a>
59-
</div>
44+
<div class="pl-4 mt-3 md:pl-0 md:hidden group-hover:block hover:block md:absolute md:bg-white md:shadow md:rounded md:pin-r overflow-hidden">
45+
<div class="flex flex-col">
46+
<a href="https://github.com/rigor789/nativescript-vue"
47+
class="no-underline text-blue-lightest md:text-blue-dark hover:bg-green hover:text-white px-4 py-2">GitHub</a>
48+
<a href="https://developer.telerik.com/wp-login.php?action=slack-invitation"
49+
class="no-underline text-blue-lightest md:text-blue-dark hover:bg-green hover:text-white px-4 py-2">Slack</a>
6050
</div>
6151
</div>
6252
</div>
53+
<!--<div class="inline text-blue-lightest py-4 relative group">-->
54+
<!--<svg role="img" aria-label="Language" class="w-4 h-4 fill-current -mb-px" viewBox="0 0 20 20"-->
55+
<!--version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve"-->
56+
<!--style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><path-->
57+
<!--d="M20,10c0,-5.532 -4.488,-10 -10,-10c-5.509,0 -10,4.465 -10,10c0,5.522 4.477,10 10,10c5.52,0 10,-4.475 10,-10Zm-1.678,2.581l-4.01,0c0.277,-1.73 0.266,-3.497 0.002,-5.162l4.008,0c0.517,1.67 0.517,3.492 0,5.162Zm-8.322,6.064c-1.239,-1.118 -2.183,-2.803 -2.72,-4.774l5.44,0c-0.537,1.971 -1.481,3.656 -2.72,4.774Zm-3.006,-6.064c-0.29,-1.669 -0.297,-3.449 0.001,-5.162l6.01,0c0.298,1.712 0.291,3.492 0.001,5.162l-6.012,0Zm3.006,-11.225c1.353,1.221 2.24,3.022 2.718,4.773l-5.436,0c0.48,-1.76 1.37,-3.556 2.718,-4.773Zm7.804,4.773l-3.75,0c-0.441,-1.78 -1.184,-3.375 -2.173,-4.635c2.588,0.569 4.762,2.295 5.923,4.635Zm-9.685,-4.635c-0.989,1.26 -1.732,2.855 -2.173,4.635l-3.75,0c1.161,-2.34 3.335,-4.066 5.923,-4.635Zm-6.441,5.925l4.008,0c-0.264,1.665 -0.275,3.432 0.002,5.162l-4.01,0c-0.517,-1.67 -0.517,-3.492 0,-5.162Zm0.518,6.452l3.755,0c0.443,1.781 1.188,3.38 2.17,4.636c-2.602,-0.572 -4.77,-2.308 -5.925,-4.636Zm9.683,4.636c0.982,-1.256 1.727,-2.855 2.17,-4.636l3.755,0c-1.157,2.332 -3.327,4.065 -5.925,4.636Z"-->
58+
<!--style="fill-rule:nonzero;"/></svg>-->
59+
<!--<span class="md:hidden">Language</span>-->
60+
61+
<!--<div class="hidden pl-4 mt-3 md:pl-0 md:hidden group-hover:block hover:block md:absolute md:bg-white md:shadow md:rounded md:pin-r overflow-hidden">-->
62+
<!--<div class="flex flex-col">-->
63+
<!--<a href="/"-->
64+
<!--class="no-underline text-blue-lightest md:text-blue-dark hover:bg-green hover:text-white px-4 py-2">en</a>-->
65+
<!--<a href="/hu"-->
66+
<!--class="no-underline text-blue-lightest md:text-blue-dark hover:bg-green hover:text-white px-4 py-2">hu</a>-->
67+
<!--</div>-->
68+
<!--</div>-->
69+
<!--</div>-->
6370
</div>
6471
</div>
65-
66-
<!-- Mobile Docs Nav -->
67-
<!--<div class="bg-grey-lighter md:hidden">-->
68-
<!--<div class="container mx-auto p-4">-->
69-
<!--<select class="w-full p-2">-->
70-
<!--&lt;!&ndash;<option v-for="item in flat_toc" :key="item.name" :value="item.path">{{ item.name }}</option>&ndash;&gt;-->
71-
<!--</select>-->
72-
<!--</div>-->
73-
<!--</div>-->
74-
</div>
72+
</div>

layouts/_partials/meta.ejs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<meta charset="UTF-8">
2+
<meta name="viewport"
3+
content="width=device-width, initial-scale=1.0">
4+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
5+
<link rel="stylesheet" href="https://unpkg.com/github-markdown-css@2.9.0/github-markdown.css">
6+
<link rel="stylesheet" href="/styles.css">

layouts/_partials/navselect.ejs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div class="bg-grey-lighter md:hidden">
2+
<div class="container mx-auto p-4">
3+
<select v-nav class="w-full p-2" title="<%= title %>">
4+
<% items.forEach(item => { %>
5+
<option value="/<%= item.path %>" <%= path === item.path ? 'selected' : '' %>><%= item.title %></option>
6+
<% }) %>
7+
</select>
8+
</div>
9+
</div>

layouts/default.ejs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport"
6-
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
7-
<meta http-equiv="X-UA-Compatible" content="ie=edge">
4+
<%- include('_partials/meta') %>
85
<title><%= sitename %></title>
9-
<link rel="stylesheet" href="https://unpkg.com/github-markdown-css@2.9.0/github-markdown.css">
10-
<link rel="stylesheet" href="/styles.css">
116
</head>
127
<body>
138

layouts/docs.ejs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<%- include('_partials/meta') %>
5+
<title><%= sitename %></title>
6+
</head>
7+
<body>
8+
9+
<div id="app">
10+
<div class="font-sans leading-normal" :class="{'max-h-screen': modalVisible, 'overflow-hidden': modalVisible}">
11+
<!--<QuickStart />-->
12+
<%- include('_partials/header') %>
13+
<%- include('_partials/navselect', { title: 'Recent posts', items: collections.docs }) %>
14+
15+
16+
<div class="md:bg-docs-gradient min-h-screen">
17+
<div class="container mx-auto flex">
18+
<div class="hidden md:w-1/4 md:block">
19+
<div class="pl-4 md:pl-0 pt-4 md:pt-8">
20+
<ul id="docs-toc" class="list-reset">
21+
<%- include('_partials/categories', { entry: { children: docs_categories } }) %>
22+
</ul>
23+
</div>
24+
</div>
25+
<div class="w-full md:w-3/4 bg-white min-h-screen">
26+
<div class="pl-8 py-4 pr-4">
27+
<% if (typeof title !== 'undefined') { %>
28+
<div class="text-blue-dark text-4xl mt-4"><%= title %></div>
29+
<hr class="border-t-2 border-blue-lighter w-24 mx-0 mb-2">
30+
<% } %>
31+
<% if(typeof authors !== 'undefined') { %>
32+
<div class="text-blue-light mb-8">
33+
<%= moment(date).format('MMMM DD, YYYY') %>
34+
by <%- authors.map(author => `<a href="https://github.com/${author}" target="_blank" class="no-underline text-green hover:text-blue-dark">${author}</a>`).join(', ') %>
35+
</div>
36+
<% } %>
37+
38+
<div class="markdown-body">
39+
<%- contents %>
40+
</div>
41+
</div>
42+
</div>
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
48+
<script src="https://unpkg.com/vue@2.5.13/dist/vue.js"></script>
49+
<script src="/main.js"></script>
50+
</body>
51+
</html>

0 commit comments

Comments
 (0)