metalsmith-markdown-partials 2.0.1 → 2.0.2
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/README.md +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,15 +12,15 @@ This allows for modular markdown and promotes reuse of markdown partials.
|
|
|
12
12
|
|
|
13
13
|
A markdown file that will be transformed into an html file via a template
|
|
14
14
|
|
|
15
|
-
## Markdown
|
|
15
|
+
## Markdown Partial
|
|
16
16
|
|
|
17
17
|
A markdown file to be inserted into a Page Markdown file
|
|
18
18
|
|
|
19
|
-
Markdown partials are located in a separate directory, for example
|
|
19
|
+
Markdown partials are located in a separate directory, for example `/markdown-library/`. This directory should be located inside `/src/` .
|
|
20
20
|
|
|
21
|
-
Partial markdown files have the extention
|
|
21
|
+
Partial markdown files have the extention `.md`. A markdown partial file does NOT have frontmatter metadata, only the markdown to be inserted into a page markdown file.
|
|
22
22
|
|
|
23
|
-
The markdown partials directory's default location is
|
|
23
|
+
The markdown partials directory's default location is `./src/markdown-library/`. The partials directory can be set via the libraryPath option.
|
|
24
24
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
@@ -35,7 +35,7 @@ var mdPartials = require('metalsmith-markdown-partials');
|
|
|
35
35
|
|
|
36
36
|
...
|
|
37
37
|
.use(mdPartials({
|
|
38
|
-
libraryPath: './
|
|
38
|
+
libraryPath: './markdown-partials/',
|
|
39
39
|
fileSuffix: '.md.njk',
|
|
40
40
|
}))
|
|
41
41
|
...
|
|
@@ -46,20 +46,20 @@ var mdPartials = require('metalsmith-markdown-partials');
|
|
|
46
46
|
|
|
47
47
|
**libraryPath**
|
|
48
48
|
|
|
49
|
-
The default libraryPath is
|
|
49
|
+
The default libraryPath is `./markdown-partials/`. This default assumes that all pages are located in `./src/` so the markdown partials are located inside the metalsmith source directory.
|
|
50
50
|
|
|
51
51
|
```js
|
|
52
52
|
const mdPartials = require('metalsmith-markdown-partials');
|
|
53
53
|
|
|
54
54
|
metalsmith(__dirname)
|
|
55
55
|
.use(mdPartials({
|
|
56
|
-
libraryPath: './
|
|
56
|
+
libraryPath: './markdown-partials/'
|
|
57
57
|
})
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
**fileSuffix**
|
|
61
61
|
|
|
62
|
-
The default fileSuffix is
|
|
62
|
+
The default fileSuffix is `.md`, but depending on which templating language is used, the suffix will have two parts. For example for Nunjucks it will be `md.njk`.
|
|
63
63
|
|
|
64
64
|
```js
|
|
65
65
|
const mdPartials = require('metalsmith-markdown-partials').use(
|