-
Notifications
You must be signed in to change notification settings - Fork 27
Basic example with markdown
Kevin Van Lierde edited this page Dec 3, 2022
·
3 revisions
You can use @metalsmith/in-place
with metalsmith's Javascript API or the CLI. For this example we'll use the CLI:
npm install metalsmith @metalsmith/in-place
In this case we'll use markdown, so we'll also need to install jstransformer-markdown
:
npm install jstransformer-markdown
We'll create a metalsmith.json configuration file and a file for @metalsmith/in-place to process:
./metalsmith.json
{
"source": "src",
"destination": "build",
"plugins": [
{ "@metalsmith/in-place": { }}
]
}
./src/index.md
## A title
A paragraph of text here, with a [link](http://www.page.com).
To build just run the metalsmith CLI (note that you'll need [email protected] or higher to use npx):
$ npx metalsmith
Which will output the following file:
./build/index.html
<h2>A title</h2>
<p>A paragraph of text here, with a <a href="http://www.page.com">link</a>.</p>