From 6170cd55c3318a1f5bf65cac631e066cb9f1f2cd Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 21 Mar 2022 11:50:16 +0100 Subject: [PATCH] adds contributing help --- contributing.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 contributing.md diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..54aa60d --- /dev/null +++ b/contributing.md @@ -0,0 +1,57 @@ +# Contributing to [OCram85.com](https://ocram85.com) blog + +## Usage + +To use the sources for local development you need to install the dependencies first: + +```bash +npm install +``` + +### How to add new posts + +To simplify the workflow for adding new posts you can run the npm script `new:post` with a valid path: + +```bash +npm run new:post -- posts/my-new-post/index.md +``` + +This creates a new post file an populates the values from default [template file](./archetypes/default.md) + +## npm scripts + +### `build` + +Use `npm run build` to build the html files for production. + +### `check` + +Use `npm run check` to get the current version for the embedded hugo version. + +### `clean` + +Use `npm run clean` to clean the _public_ content. + +### `lint:markdown` + +Use `npm run lint:markdown` to run the markdown linter for identifying markdown issues. + +### `start` + +Use `npm run start` as alias for `npm run server`. + +### `server` + +Use `npm run server` to start the development server which renders also draft posts. You can access the development server via `http://localhost:1313` + +### `test` + +Use `npm run test` all nested test tasks. For now this points to _lint:markdown_. + +### `postinstall` + +`npm run postinstall` is used by `npm install` to get the latest embedded hugo binary version. + +### `new:post` + +Use `npm run new:post` to create a new blog post based on the archetype template. diff --git a/package.json b/package.json index 06e49ee..4509afe 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "start": "npm run server", "server": "exec-bin node_modules/.bin/hugo/hugo server --bind=0.0.0.0 -D", "test": "npm run lint:markdown", - "postinstall": "hugo-installer --version otherDependencies.hugo --extended --destination node_modules/.bin/hugo" + "postinstall": "hugo-installer --version otherDependencies.hugo --extended --destination node_modules/.bin/hugo", + "new:post": "exec-bin node_modules/.bin/hugo/hugo new" }, "repository": { "type": "git",