{"id":23444863,"url":"https://github.com/webmasterish/vuepress-new-page","last_synced_at":"2025-04-13T13:33:35.777Z","repository":{"id":65519614,"uuid":"162498099","full_name":"webmasterish/vuepress-new-page","owner":"webmasterish","description":"A simple way to create a new VuePress page or post","archived":false,"fork":false,"pushed_at":"2020-06-01T01:04:36.000Z","size":110,"stargazers_count":9,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-15T19:48:58.197Z","etag":null,"topics":["cli","cli-app","generator","new-page","new-post","template","vue","vuejs","vuepress"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webmasterish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-19T22:35:30.000Z","updated_at":"2021-02-20T14:55:11.000Z","dependencies_parsed_at":"2023-01-27T02:10:25.473Z","dependency_job_id":null,"html_url":"https://github.com/webmasterish/vuepress-new-page","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fvuepress-new-page","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fvuepress-new-page/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fvuepress-new-page/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fvuepress-new-page/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webmasterish","download_url":"https://codeload.github.com/webmasterish/vuepress-new-page/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231007346,"owners_count":18314168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cli-app","generator","new-page","new-post","template","vue","vuejs","vuepress"],"created_at":"2024-12-23T19:19:38.916Z","updated_at":"2024-12-23T19:19:39.444Z","avatar_url":"https://github.com/webmasterish.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VuePress New Page\n\n\u003e A simple way to create a new [VuePress](https://vuepress.vuejs.org/) page or post\n\n[![Build Status](https://img.shields.io/travis/webmasterish/vuepress-new-page/master.svg?style=flat-square)](https://travis-ci.org/webmasterish/vuepress-new-page)\n[![Coverage Status](https://img.shields.io/coveralls/github/webmasterish/vuepress-new-page/master.svg?style=flat-square)](https://coveralls.io/github/webmasterish/vuepress-new-page?branch=master)\n[![npm version](https://img.shields.io/npm/v/vuepress-new-page.svg?style=flat-square)](http://npm.im/vuepress-new-page)\n[![Greenkeeper badge](https://badges.greenkeeper.io/webmasterish/vuepress-new-page.svg?style=flat-square)](https://greenkeeper.io/)\n[![MIT License](https://img.shields.io/npm/l/express.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n\n\n## Why\n\nI'm lazy, get bored easily, and make a lot of mistakes.\n\n\n## What\n\nIt would create the directory and file with initial [front matter](https://vuepress.vuejs.org/guide/frontmatter.html)\nsuch as `title` and current `date`.\n\n\n## Install\n\n\n```sh\n$ npm install --global vuepress-new-page\n```\n\n\n## Usage\n\n```sh\n$ vuepress-new-page --help\n\n  Usage: cli [options]\n\n  vuepress-new-page version 0.1.0\n  A simple way to create a new VuePress page or post\n\n  Options:\n    -v, --version                output the version number\n    -t, --title \u003ctitle\u003e          Page/Post title - required\n    -s, --slug [optional]        Page/Post slug\n    -d, --date [optional]        Page/Post date\n    -f, --dateformat [optional]  Page/Post dateformat - defaults to 'isoDateTime'\n    -D, --directory [optional]   Page/Post directory - defaults to 'docs'\n    -F, --filename [optional]    Page/Post filename - defaults to 'README.md'\n    -h, --help                   output usage information\n\n\n  Examples:\n    $ vuepress-new-page --title=\"My Post Title\"\n    \n    # or you can use the shorter alias `vp-new`\n    $ vp-new --title=\"My Page Title\" --directory=\"some/sub/dir\"\n\n```\n\n\n## Examples\n\n\n### Basic\n\n```sh\n$ vp-new --title=\"My Page Title\"\n```\n\nWould create `docs/my-page-title/README.md` having the following content:\n\n\n```\n---\n\ntitle: My Page Title\n\ndate: 2018-12-20T04:42:59+0200\n\n---\n\n# {{ $page.title }}\n\n```\n\n\n### Custom options using command args\n\n\n```sh\n$ vp-new \\\n  --title=\"My Blog Post Title\" \\\n  --directory=\"source/blog\" \\\n  --filename=\"index.md\" \\\n  --dateformat=\"yyyy-mm-dd HH:MM:ss\"\n```\n\nWould create `source/blog/my-blog-post-title/index.md` having the following content:\n\n\n```\n---\n\ntitle: My Blog Post Title\n\ndate: 2018-12-20 04:55:20\n\n---\n\n# {{ $page.title }}\n\n```\n\n\n\n### Using rc file(s)\n\nYou can simply create an rc file `.vuepress-new-pagerc` \nand place it in your project directory.\n\nHere's an example:\n\n```\n{\n  \"directory\": \"projects/node/cli\",\n  \"filename\": \"index.md\",\n  \"dateformat\": \"default\",\n  //\n  // here's how you can set your own template as an array\n  // the array is simply joined with \"\\n\"\n  //\n  \"template\": [\n    \"---\",\n    \"\",\n    \"title: %%title%%\",\n    \"\",\n    \"date: %%date%%\",\n    \"\",\n    \"author: [Webmasterish](https://webmasterish.com)\",\n    \"\",\n    \"description: A simple way to create a new VuePress page or post\",\n    \"\",\n    \"meta:\",\n    \"  - name: twitter:title\",\n    \"    content: %%title%%\",\n    \"  - name: twitter:description\",\n    \"    content: A simple way to create a new VuePress page or post\",\n    \"  - name: twitter:url\",\n    \"    content: {{ $site.url }}{{ $page.permalink }}\",\n    \"  - property: og:type\",\n    \"    content: article\",\n    \"  - property: og:title\",\n    \"    content: %%title%%\",\n    \"  - property: og:description\",\n    \"    content: A simple way to create a new VuePress page or post\",\n    \"  - property: og:url\",\n    \"    content: {{ $site.url }}{{ $page.permalink }}\",\n    \"\",\n    \"---\",\n    \"\",\n    \"# %%title%%\",\n    \"\",\n    \"\u003e on %%date%% i created %%title%%\",\n    \"\"\n  ]\n  //\n  // and here's an example having the template set as a string\n  //\"template\": \"---\\ntitle: %%title%%\\n---\"\n  //\n}\n\n```\n\nAssuming you have the same `rc` file as the above, and have placed at\n`./.vuepress-new-pagerc`, and then used `vp-new -t \"VuePress New Page - Node Cli App ✨\"`,\nthe result would be a file created at `./projects/node/cli/vuepress-new-page-node-cli-app/index.md` \nhaving the following content:\n\n\n```\n---\n\ntitle: VuePress New Page - Node Cli App ✨\n\ndate: Thu Dec 20 2018 06:05:14\n\nauthor: [Webmasterish](https://webmasterish.com)\n\ndescription: A simple way to create a new VuePress page or post\n\nmeta:\n  - name: twitter:title\n    content: VuePress New Page - Node Cli App ✨\n  - name: twitter:description\n    content: A simple way to create a new VuePress page or post\n  - name: twitter:url\n    content: {{ $site.url }}{{ $page.permalink }}\n  - property: og:type\n    content: article\n  - property: og:title\n    content: VuePress New Page - Node Cli App ✨\n  - property: og:description\n    content: A simple way to create a new VuePress page or post\n  - property: og:url\n    content: {{ $site.url }}{{ $page.permalink }}\n\n---\n\n# VuePress New Page - Node Cli App ✨\n\n\u003e on Thu Dec 20 2018 06:05:14 i created VuePress New Page - Node Cli App ✨\n\n```\n\n\n## Reference\n\n- Command args are parsed using [commander.js](https://github.com/tj/commander.js)\n- rc files are parsed using [rc package](https://github.com/dominictarr/rc)\n- Dates are formated using [dateformat package](https://github.com/felixge/node-dateformat)\n- Files and directories are created using [fs-extra](https://github.com/jprichardson/node-fs-extra)\n\n\n## License\n\nMIT © [webmasterish](https://webmasterish.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterish%2Fvuepress-new-page","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebmasterish%2Fvuepress-new-page","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterish%2Fvuepress-new-page/lists"}