add markdownlint to ci

This commit is contained in:
Robert Kaussow 2020-06-02 00:01:49 +02:00
parent 6d4ec21b43
commit 03ee06ffac
4 changed files with 41 additions and 15 deletions

View file

@ -7,15 +7,6 @@ platform:
arch: amd64 arch: amd64
steps: 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 - name: assets
image: node:lts image: node:lts
commands: commands:
@ -118,6 +109,24 @@ concurrency:
limit: 1 limit: 1
steps: 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 - name: assets
image: byrnedo/alpine-curl image: byrnedo/alpine-curl
commands: commands:
@ -142,11 +151,16 @@ steps:
from_secret: s3_secret_access_key from_secret: s3_secret_access_key
source: exampleSite/public/ source: exampleSite/public/
strip_prefix: exampleSite/public/ strip_prefix: exampleSite/public/
when:
ref:
- refs/heads/master
- refs/tags/**
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
- refs/tags/** - refs/tags/**
- refs/pull/**
depends_on: depends_on:
- build - build
@ -192,6 +206,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: 1145f38b73b28a6a9e659bd19008fcdf24c808e22db91fc2768740bbf9e138e9 hmac: 49898e6b496014772113f110dae80acca1f525f1ae0545669eba5ba468f7a4da
... ...

View file

@ -3,6 +3,7 @@
* resfactor expand shortcode to use valid html * resfactor expand shortcode to use valid html
* fix formatting of nested shortcodes markdown * fix formatting of nested shortcodes markdown
* INTERNAL * INTERNAL
* add markdown linting to CI (markdownlint-cli)
* add spellchecking to CI (spellcheck-cli) * add spellchecking to CI (spellcheck-cli)
* add html/css validation to CI (nu.validator) * add html/css validation to CI (nu.validator)
* add page validation to CI (lighthouse-ci) * add page validation to CI (lighthouse-ci)

View file

@ -1,17 +1,20 @@
There are multiple ways to add code blocks. Most of them works out of the box only the Hugo shortcode `<highlight>` need some configuration to work properly. There are multiple ways to add code blocks. Most of them works out of the box only the Hugo shortcode `<highlight>` need some configuration to work properly.
## Inline code ## Inline code
To display an inline shortcode use single quotes: To display an inline shortcode use single quotes:
```
```plain
`some code` `some code`
``` ```
**Example:** `some code` **Example:** `some code`
## Code blocks ## Code blocks
Code blocks can be uses without language specification: Code blocks can be uses without language specification:
```` ````markdown
``` ```
some code some code
``` ```
@ -19,13 +22,13 @@ some code
**Example:** **Example:**
``` ```plain
some code some code
``` ```
... or if you need language specific syntax highlighting: ... or if you need language specific syntax highlighting:
```` ````markdown
```Shell ```Shell
# some code # some code
echo "Hello world" echo "Hello world"
@ -45,22 +48,26 @@ Hugo has a build-in shortcode for syntax highlighting. To work properly with thi
{{< tabs "uniqueid" >}} {{< tabs "uniqueid" >}}
{{< tab "TOML" >}} {{< tab "TOML" >}}
```TOML ```TOML
pygmentsUseClasses=true pygmentsUseClasses=true
pygmentsCodeFences=true pygmentsCodeFences=true
``` ```
{{< /tab >}} {{< /tab >}}
{{< tab "YAML" >}} {{< tab "YAML" >}}
```YAML ```YAML
pygmentsUseClasses: true pygmentsUseClasses: true
pygmentsCodeFences: true pygmentsCodeFences: true
``` ```
{{< /tab >}} {{< /tab >}}
{{< /tabs >}} {{< /tabs >}}
You can use it like every other shortcode: You can use it like every other shortcode:
```Markdown ```markdown
{{</* highlight Shell "linenos=table" */>}} {{</* highlight Shell "linenos=table" */>}}
# some code # some code
echo "Hello World" echo "Hello World"
@ -69,7 +76,9 @@ echo "Hello World"
**Example:** **Example:**
<!-- markdownlint-disable -->
{{< highlight Shell "linenos=table" >}} {{< highlight Shell "linenos=table" >}}
# some code # some code
echo "Hello World" echo "Hello World"
{{< /highlight >}} {{< /highlight >}}
<!-- markdownlint-enable -->

View file

@ -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: 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:
<!-- markdownlint-disable -->
{{< highlight CSS "linenos=table" >}} {{< highlight CSS "linenos=table" >}}
/* default link color */ /* default link color */
a { color: #1c388e; } a { color: #1c388e; }
@ -30,6 +31,7 @@ a:visited { color: #73bfb8 }
.gdoc-hint.warning { background: #fef5dc; border-color: #e4ba48; color: black; } .gdoc-hint.warning { background: #fef5dc; border-color: #e4ba48; color: black; }
.gdoc-hint.danger { background: #fae1db; border-color: #cf5f46; color: black; } .gdoc-hint.danger { background: #fae1db; border-color: #cf5f46; color: black; }
{{< /highlight >}} {{< /highlight >}}
<!-- markdownlint-enable -->
And that is how the result will looks like. Happy customizing! And that is how the result will looks like. Happy customizing!