Skip to content

Commit

Permalink
Fix path error and HTML generate with asciidoc
Browse files Browse the repository at this point in the history
  • Loading branch information
javamind committed Sep 28, 2018
1 parent e0b1775 commit d887c07
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 6 deletions.
50 changes: 46 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ This module is made to be used in a GulpFile. You can read the link:./gulpfile.j
To install this module use for example with yarn

```
yarn add https://github.com/Dev-Mind/devmind-website.git
yarn add https://github.com/Dev-Mind/devmind-website.git#X.Y.Z
```

Find the good version X.Y.Z on https://github.com/Dev-Mind/devmind-website/releases

To import the module in your gulpfile you can use

[source,javascript]
Expand All @@ -28,7 +30,7 @@ You can also send parameters. Below I use the default values
[source,javascript]
----
const WEBSITE_PARAMS = {
path : '../../',
path : '../../../',
metadata : {
rss: 'src/metadata/rss.json',
blog: 'src/metadata/blog.json',
Expand All @@ -41,11 +43,51 @@ const website = require('./index')(WEBSITE_PARAMS);

== Extensions

=== apply-template
TODO

== Dev & prod
=== convert-to-blog-list
TODO

=== convert-to-blog-page
TODO

=== convert-to-html
TODO

=== convert-to-json
TODO

=== convert-to-rss
TODO

=== convert-to-sitemap
TODO

=== file-exist
TODO

Some modules make different things in dev mode or for prod.
=== files-exist
TODO

=== highlight-code
TODO

=== read-asciidoctor
TODO

=== read-html
TODO

=== read-index
TODO

== Use cases

TODO

== Dev & prod
TODO

== Compatibility
You have to use a
Expand Down
7 changes: 6 additions & 1 deletion extension/convert-to-blog-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ module.exports = (options, handlebarsTemplateFile, partials, blogIndexFile) => {
};
}

const content = handlebarsTemplate(file.templateModel)
.replace('<html><head></head><body>', '')
.replace('</body>', '')
.replace('</html>', '');

file.templateModel.contents = file.contents.toString();
file.contents = Buffer.from(handlebarsTemplate(file.templateModel));
file.contents = Buffer.from(content);

next(null, file);
});
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const isProd = process.env.NODE_ENV && process.env.NODE_ENV === 'prod';

const checkOptions = (options) => {
if (!options.path) {
options.path = '../../';
options.path = '../../../';
}
if(!options.metadata){
options.metadata = {};
Expand Down

0 comments on commit d887c07

Please sign in to comment.