From 03ee06ffacaf4d4c00f9a1ca86c3822513edd75a Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 2 Jun 2020 00:01:49 +0200 Subject: [PATCH] add markdownlint to ci --- .drone.yml | 34 +++++++++++++++------- CHANGELOG.md | 1 + exampleSite/content/usage/code_blocks.md | 19 ++++++++---- exampleSite/content/usage/color_schemes.md | 2 ++ 4 files changed, 41 insertions(+), 15 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6c368a3..d84f4f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,15 +7,6 @@ platform: arch: amd64 steps: -- name: spellcheck - image: node:lts-alpine - commands: - - npm install -g spellchecker-cli - - spellchecker --files 'exampleSite/content/**/*.md' 'README.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions - environment: - FORCE_COLOR: true - NPM_CONFIG_LOGLEVEL: error - - name: assets image: node:lts commands: @@ -118,6 +109,24 @@ concurrency: limit: 1 steps: +- name: markdownlint + image: node:lts-alpine + commands: + - npm install -g markdownlint-cli + - markdownlint 'exampleSite/content/**/*.md' 'README.md' + environment: + FORCE_COLOR: true + NPM_CONFIG_LOGLEVEL: error + +- name: spellcheck + image: node:lts-alpine + commands: + - npm install -g spellchecker-cli + - spellchecker --files 'exampleSite/content/**/*.md' 'README.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions + environment: + FORCE_COLOR: true + NPM_CONFIG_LOGLEVEL: error + - name: assets image: byrnedo/alpine-curl commands: @@ -142,11 +151,16 @@ steps: from_secret: s3_secret_access_key source: exampleSite/public/ strip_prefix: exampleSite/public/ + when: + ref: + - refs/heads/master + - refs/tags/** trigger: ref: - refs/heads/master - refs/tags/** + - refs/pull/** depends_on: - build @@ -192,6 +206,6 @@ depends_on: --- kind: signature -hmac: 1145f38b73b28a6a9e659bd19008fcdf24c808e22db91fc2768740bbf9e138e9 +hmac: 49898e6b496014772113f110dae80acca1f525f1ae0545669eba5ba468f7a4da ... diff --git a/CHANGELOG.md b/CHANGELOG.md index 0aef670..011830c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * resfactor expand shortcode to use valid html * fix formatting of nested shortcodes markdown * INTERNAL + * add markdown linting to CI (markdownlint-cli) * add spellchecking to CI (spellcheck-cli) * add html/css validation to CI (nu.validator) * add page validation to CI (lighthouse-ci) diff --git a/exampleSite/content/usage/code_blocks.md b/exampleSite/content/usage/code_blocks.md index eb5bc3d..aefb344 100644 --- a/exampleSite/content/usage/code_blocks.md +++ b/exampleSite/content/usage/code_blocks.md @@ -1,17 +1,20 @@ There are multiple ways to add code blocks. Most of them works out of the box only the Hugo shortcode `` need some configuration to work properly. ## Inline code + To display an inline shortcode use single quotes: -``` + +```plain `some code` ``` **Example:** `some code` ## Code blocks + Code blocks can be uses without language specification: -```` +````markdown ``` some code ``` @@ -19,13 +22,13 @@ some code **Example:** -``` +```plain some code ``` ... or if you need language specific syntax highlighting: -```` +````markdown ```Shell # some code echo "Hello world" @@ -45,22 +48,26 @@ Hugo has a build-in shortcode for syntax highlighting. To work properly with thi {{< tabs "uniqueid" >}} {{< tab "TOML" >}} + ```TOML pygmentsUseClasses=true pygmentsCodeFences=true ``` + {{< /tab >}} {{< tab "YAML" >}} + ```YAML pygmentsUseClasses: true pygmentsCodeFences: true ``` + {{< /tab >}} {{< /tabs >}} You can use it like every other shortcode: -```Markdown +```markdown {{}} # some code echo "Hello World" @@ -69,7 +76,9 @@ echo "Hello World" **Example:** + {{< highlight Shell "linenos=table" >}} # some code echo "Hello World" {{< /highlight >}} + diff --git a/exampleSite/content/usage/color_schemes.md b/exampleSite/content/usage/color_schemes.md index c8e4317..ab53349 100644 --- a/exampleSite/content/usage/color_schemes.md +++ b/exampleSite/content/usage/color_schemes.md @@ -2,6 +2,7 @@ If you want to customize the color scheme of the theme to give it your individua All necessary class names are listed below. If you miss some classes required for a color scheme you are very welcome to create an [Issue](https://github.com/xoxys/hugo-geekdoc/issues) or Pull Request. For some inspiration you can have a look at [https://www.color-hex.com/color-palettes/](https://www.color-hex.com/). The following listing use the _HC-primary_ color palette as an example: + {{< highlight CSS "linenos=table" >}} /* default link color */ a { color: #1c388e; } @@ -30,6 +31,7 @@ a:visited { color: #73bfb8 } .gdoc-hint.warning { background: #fef5dc; border-color: #e4ba48; color: black; } .gdoc-hint.danger { background: #fae1db; border-color: #cf5f46; color: black; } {{< /highlight >}} + And that is how the result will looks like. Happy customizing!