Skip to content

Commit

Permalink
Fix asciidoc dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
javamind committed Sep 28, 2018
1 parent 6bfef30 commit e0b1775
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
52 changes: 51 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,56 @@

image::https://api.travis-ci.org/Dev-Mind/devmind-website.svg?branch=master[Travis status]

This project is used to build the Dev-Mind websites. The aim is to use https://github.com/wycats/handlebars.js[handlebars] as template solution and https://asciidoctor.org/docs/asciidoctor.js/[asciidoctor.js] to writes dynamic pages as a blog. Several others extensions help to generate a rss file, a sitemap file...

image::https://www.dev-mind.fr/img/logo/logo_1500.png[Dev-Mind]

More informations very soon
== Use this module

This module is made to be used in a GulpFile. You can read the link:./gulpfile.js[gulpfile.js] used to test the extensions or you can see the gulpfile used on the main Dev-Mind website (https://github.com/Dev-Mind/dev-mind.fr).

To install this module use for example with yarn

```
yarn add https://github.com/Dev-Mind/devmind-website.git
```

To import the module in your gulpfile you can use

[source,javascript]
----
const website = require('devmind-website')();
----

You can also send parameters. Below I use the default values

[source,javascript]
----
const WEBSITE_PARAMS = {
path : '../../',
metadata : {
rss: 'src/metadata/rss.json',
blog: 'src/metadata/blog.json',
html: 'src/metadata/html.json',
sitemap: 'src/metadata/sitemap.json'
}
};
const website = require('./index')(WEBSITE_PARAMS);
----

== Extensions


== Dev & prod

Some modules make different things in dev mode or for prod.


== Compatibility
You have to use a

* node version >= 10.0
* gulp >= 4.0.0

== License
`devmind-website` is released under the MIT license.
3 changes: 2 additions & 1 deletion extension/read-asciidoctor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const map = require('map-stream');
const asciidoctor = require('../node_modules/asciidoctor.js/dist/node/asciidoctor')();
const moment = require('moment');

const asciidoctorOptions = {
Expand All @@ -26,6 +25,8 @@ const asciidoctorOptions = {
*/
module.exports = function (options) {

const asciidoctor = require(`${options.path}node_modules/asciidoctor.js/dist/node/asciidoctor`)();

return map((file, next) => {

const opts = Object.assign({}, asciidoctorOptions, {});
Expand Down

0 comments on commit e0b1775

Please sign in to comment.