Initial commit

This commit is contained in:
Tom Raithel
2017-01-20 07:23:25 +01:00
commit 37ae2943d5
9 changed files with 136 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
dist
node_modules

19
package.json Normal file
View File

@@ -0,0 +1,19 @@
{
"name": "aoe_techradar_node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"create": "node ./scripts/create.js",
"clean": "node ./scripts/clean.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Tom Raithel <t.raithel@googlemail.com> (http://www.tomraithel.de)",
"license": "MIT",
"dependencies": {
"async": "2.1.4",
"front-matter": "2.1.1",
"fs-extra": "2.0.0",
"marked": "0.3.6"
}
}

View File

@@ -0,0 +1,27 @@
---
layout: post
title: "React"
ring: adopt
---
Hier steht eine Einleitung über *React* - super "cool"
Hier noch ein [link](http://www.google.de) zu google
<!--except-->
Hier steht der Rest!
History
-------
{% include
history-entry.html
ring="trial"
date="2017-12-10"
content="This is a history entry
- Foo
- Bar
"
%}

View File

@@ -0,0 +1,8 @@
---
layout: post
title: "Foo"
ring: trial
new: true
---
Foo

View File

@@ -0,0 +1,8 @@
---
layout: post
title: "Bar"
ring: assess
new: true
---
Bar

17
radar/v1/tools/grunt.md Normal file
View File

@@ -0,0 +1,17 @@
---
layout: post
title: "Grunt"
ring: hold
new: true
---
Hier steht was über *Grunt*
Hier noch ein [link](http://www.google.de) zu google
<!--except-->
Hier steht der Rest!
History
-------

24
scripts/clean.js Normal file
View File

@@ -0,0 +1,24 @@
var fs = require('fs-extra');
var async = require('async');
var file = require('./file');
var distDir = file.distDir();
console.log('<<< start cleaning dist dir: ', distDir);
async.series([
function(callback) {
fs.ensureDir(distDir, callback);
},
function(callback) {
fs.emptyDir(distDir, callback);
}
],
function(err, results) {
if (!err) {
console.log('done cleaning dist dir >>>');
} else {
console.error(err);
}
}
);

21
scripts/create.js Normal file
View File

@@ -0,0 +1,21 @@
var fs = require('fs-extra');
var frontmatter = require('front-matter');
var marked = require('marked');
var file = require('./file');
var fileName = file.path('radar/v1/tools/grunt.md');
fs.readFile(fileName, 'utf8', function(err, data) {
if (err) throw err;
var item = frontmatter(data);
var html = marked(item.body);
console.log(item.attributes);
console.log(html);
fs.outputFile(file.distDir() + '/test.html', html, function (err) {
console.log(err) // => null
})
});

10
scripts/file.js Normal file
View File

@@ -0,0 +1,10 @@
var path = require('path');
module.exports = {
path: function(relativePath) {
return path.resolve(__dirname, '..', relativePath)
},
distDir: function() {
return this.path('dist');
}
};