# vue-autoblog

> A compile-time tool to generate Vue template files (*.vue) from markdown files (*.md)

Latest version **0.2.8** (published 2020-06-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install vue-autoblog
pnpm add vue-autoblog
yarn add vue-autoblog
bun add vue-autoblog
```

Provides the command `vue-autoblog`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.8 |
| Published | 2020-06-15 |
| First published | 2018-08-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 104.5 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin |
| Maintainers | kvnxiao |

## Links

- npm: https://www.npmjs.com/package/vue-autoblog
- Repository: https://github.com/kvnxiao/vue-autoblog
- Homepage: https://github.com/kvnxiao/vue-autoblog#readme
- Issues: https://github.com/kvnxiao/vue-autoblog/issues
- npm.io page: https://npm.io/package/vue-autoblog

## Dependencies (7)

- [moment](https://npm.io/package/moment.md) ^2.26.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.14.0
- [prettier](https://npm.io/package/prettier.md) ^2.0.5
- [handlebars](https://npm.io/package/handlebars.md) ^4.7.6
- [typescript](https://npm.io/package/typescript.md) ^3.9.5
- [js-beautify](https://npm.io/package/js-beautify.md) ^1.11.0
- [markdown-it](https://npm.io/package/markdown-it.md) ^11.0.0

## Recent versions

- 0.2.8 (latest) — 2020-06-15
- 0.2.7 — 2020-06-15
- 0.2.6 — 2020-06-15
- 0.2.5 — 2020-06-15
- 0.2.3 — 2020-06-15
- 0.2.2 — 2020-06-15
- 0.2.1 — 2018-08-12
- 0.2.0 — 2018-08-12
- 0.1.9 — 2018-08-12
- 0.1.8 — 2018-08-10
- 0.1.7 — 2018-08-10
- 0.1.6 — 2018-08-08

## README

# vue-autoblog
A compile-time tool to generate `.vue` single-file-components from markdown.

## Install

### **yarn**

```yarn add -D vue-autoblog```

### **npm**

```npm install vue-autoblog --save-dev```

## Usage

Run `npx vue-autoblog` or `./node_modules/vue-autoblog/bin/main.js` to generate `.vue` files to for your project.
A `.autoblog.json` configuration file is required in the root directory of your project for configuring the tool (see the configuration section below for example).

`vue-autoblog` reads `.md` files from your input folder and generates single-file `.vue` components.
Each `.md` file can have YAML front-matter at the top for specifying metadata and extra information for each post.

## Configuration

`vue-autoblog` reads a `.autoblog.json` file located in the root directory of your project for configuring the output of the generated files.

### Example `.autoblog.json` file
```json
{
  "markdownit": {
    "xhtmlOut": true,
    "linkify": true,
    "typographer": true
  },
  "directory": {
    "inputFolder": "src/md/",
    "outputFolder": "src/autoblog/"
  },
  "defaultStyle": "blog",
  "outputType": "vue",
  "typescript": true,
  "vue": {
    "outputMeta": true
  }
}
```

#### `markdownit` **(markdown-it config options)**

`vue-autoblog` uses [`markdown-it`](https://github.com/markdown-it/markdown-it) to parse markdown into HTML. Specify [markdown-it config options](https://github.com/markdown-it/markdown-it#init-with-presets-and-options) in the configuration JSON to configure the markdown parser.

#### `directory` **(input and output folder strings)**

* `inputFolder`: the folder to read `.md` files from

* `outputFolder`: the folder to output rendered `.vue` files to

NOTE: To avoid conflicts during `.vue` file generation, try to set `directory.outputFolder` to be different from `directory.inputFolder`.

#### `defaultStyle` **(string)**

#### `outputType` **(string)**

Specify the type of file to generate and output. Defaults to `"vue"`, but can be set to `"html"` if one wishes to simply generate `.html` files in the output folder.

#### `typescript` **(boolean)**

If you are using typescript, setting this value to true will generate `.d.ts` typings for the generated routes and posts files.

#### `vue` **(vue specific settings)**

* `outputMeta` **(boolean)**:

  Set this to true if you are using [`vue-meta`](https://github.com/declandewet/vue-meta) to output `metaInfo` values into the script portion of the generated `.vue` files.

---
_Source: https://npm.io/package/vue-autoblog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
