https://github.com/ehnap/vuepress-mdgen-cli
https://github.com/ehnap/vuepress-mdgen-cli
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/ehnap/vuepress-mdgen-cli
- Owner: ehnap
- License: mit
- Created: 2024-12-10T02:16:15.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-12-11T03:11:35.000Z (5 months ago)
- Last Synced: 2025-04-12T20:53:00.592Z (about 1 month ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vuepress-mdgen-cli
A CLI tool to generate Markdown files with your custom meta info by templates for VuePress2 project.
## Install
```shell
npm install -g vuepress-mdgen-cli
```## Use
```shell
mdgen [templatename]
```## Custom Templates
You can add custom templates in your project directory by creating a `.mdgen-templates` folder. The folder should include a `config.json` file and any additional template files.
### Example
1. Create a `.mdgen-templates` folder at `{You vuepress project root}\src` or `{You vuepress project root}\docs`:
2. Add a `config.json` file at the folder to define your templates:
```json
{
"default": {
"directory": "./src",
"categories": "Uncategorized",
"template": "default.md"
},
"custom-template": {
"directory": "./docs/custom",
"categories": "Custom",
"template": "custom.md"
}
}
```3. Add a Markdown template file, e.g., custom-template.md:
```markdown
---
title: {{ title }}
date: {{ date }}
categories: {{ categories }}
---# {{ title }}
Welcome to your custom markdown template.
```