bones-cli 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var bfinit = function() {
|
|
|
35
35
|
|
|
36
36
|
d = 'router';
|
|
37
37
|
fs.mkdirSync(d);
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
d = 'lib';
|
|
40
40
|
fs.mkdirSync(d);
|
|
41
41
|
|
|
@@ -152,10 +152,6 @@ var bfinit = function() {
|
|
|
152
152
|
dest = 'router/router-options.js';
|
|
153
153
|
fs.copyFileSync(`${__dirname}/${src}`, dest, fs.constants.COPYFILE_EXCL);
|
|
154
154
|
|
|
155
|
-
src = 'init-template/router-security.js.tmpl';
|
|
156
|
-
dest = 'router/router-security.js';
|
|
157
|
-
fs.copyFileSync(`${__dirname}/${src}`, dest, fs.constants.COPYFILE_EXCL);
|
|
158
|
-
|
|
159
155
|
src = 'init-template/router-sitemap.js.tmpl';
|
|
160
156
|
dest = 'router/router-sitemap.js';
|
|
161
157
|
fs.copyFileSync(`${__dirname}/${src}`, dest, fs.constants.COPYFILE_EXCL);
|
|
@@ -1 +1,28 @@
|
|
|
1
|
+
if (Meteor.isClient) {
|
|
1
2
|
|
|
3
|
+
import {FlowRouter} from 'meteor/ostrio:flow-router-extra';
|
|
4
|
+
import {FlowRouterMeta, FlowRouterTitle} from 'meteor/ostrio:flow-router-meta';
|
|
5
|
+
|
|
6
|
+
// ROUTER OPTIONS & DEFAULTS
|
|
7
|
+
// DOCS: https://atmospherejs.com/ostrio/flow-router-meta
|
|
8
|
+
FlowRouter.globals.push({
|
|
9
|
+
name: 'My Bones App',
|
|
10
|
+
meta: {
|
|
11
|
+
// <meta charset="UTF-8">
|
|
12
|
+
charset: {
|
|
13
|
+
charset: 'UTF-8'
|
|
14
|
+
},
|
|
15
|
+
robots: 'index, follow',
|
|
16
|
+
},
|
|
17
|
+
link: {
|
|
18
|
+
// <link rel="canonical" href="http://example.com">
|
|
19
|
+
canonical() {
|
|
20
|
+
return document.location.href;
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
});
|
|
25
|
+
new FlowRouterMeta(FlowRouter);
|
|
26
|
+
new FlowRouterTitle(FlowRouter);
|
|
27
|
+
|
|
28
|
+
}
|
|
File without changes
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { WebApp } from 'meteor/webapp';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
3
|
+
if (Meteor.isServer) {
|
|
4
|
+
|
|
5
|
+
// Define a route that writes to a text file
|
|
6
|
+
WebApp.connectHandlers.use('/sitemap.txt', (req, res, next) => {
|
|
7
|
+
res.writeHead(200, {'Content-Type': 'text/plain'});
|
|
8
|
+
let sitemapContent = [];
|
|
9
|
+
const baseURL = 'https://www.update-this-in-server-folder.com';
|
|
10
|
+
Bones.sitemap.forEach((route) => {
|
|
11
|
+
if (route.sitemap === true) {
|
|
12
|
+
sitemapContent.push(`${baseURL}${route.path}`);
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
res.end(sitemapContent.join("\n"));
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
}
|