Javascript-Posts template: Use this template to write your posts in markdown

Posts template

Use this template to write your posts in markdown.

How to use

Create your repository from this template and clone your new repo.

Run npm i to get the deps installed.

To compile everything and watch for changes:

npm run watch

To compile without watch run:

npm run build

You can pass a --file argument to both commands, watch and run, for example:

npm run build -- --file posts/

If you have the global gulp tool installed, you can run it more easily. Replace npm run with gulp, and the -- is unnecessary, for example:

gulp watch --file posts/

VS Code support

There are VS Code tasks on the .vscode directory. The build task will compile and watch the current file.

Update your syntax highlight preferences

When writing code snippets like this:

WriteLine("Hello world");

The output will be like this:

<pre class="brush: csharp">WriteLine("Hello world");</pre>

You can change this by changing the highlight function on gulpfile.mjs.


Questions, comments, bug reports, and pull requests are all welcome. Submit them at the project on GitHub.

Bug reports that include steps-to-reproduce (including code) are the best. Even better, make them in the form of pull requests.


Giovanni Bassi


Licensed under the MIT license.