Skip to content

Commit

Permalink
.pre-commit-config.yaml: Add pre-commit hooks and fix issues
Browse files Browse the repository at this point in the history
Signed-off-by: Norbert Kamiński <[email protected]>
  • Loading branch information
Norbert Kamiński committed Jul 29, 2023
1 parent e0ee490 commit 9389f44
Show file tree
Hide file tree
Showing 274 changed files with 15,224 additions and 14,010 deletions.
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
skip = *.svg,*.pl.md,themes/3mbed/assets/*.js
16 changes: 16 additions & 0 deletions .conform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
policies:
- type: commit
spec:
header:
length: 80
imperative: false
invalidLastCharacters: .
body:
required: false
dco: true
gpg:
required: true
spellcheck:
locale: US
maximumOfOneCommit: false
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Build news-and-ideas
on:
push:
Expand Down Expand Up @@ -68,4 +69,3 @@ jobs:
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_DOMAIN: ${{ secrets.FTP_DOMAIN }}
run: cd ${GITHUB_WORKSPACE}/scripts && bash deploy.sh
41 changes: 41 additions & 0 deletions .markdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# MD013/line-length - Line length
MD013:
# Number of characters for code blocks
code_block_line_length: 400
tables: false


# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
MD041:
# Heading level
level: 1
# RegExp for matching title in front matter
front_matter_title: "^\\s*title\\s*[:=]"

# MD042/no-empty-links - No empty links
MD042: true

# MD046/code-block-style - Code block style
# MD046: Rule temporarily disabled, it prevents new tabs from being formatted
# correctly - eg. docs/unified/novacustom/overview.md:9
# Block style
# style: "fenced"

# MD047/single-trailing-newline - Files should end with a single newline character
MD047: true

# MD048/code-fence-style - Code fence style
MD048:
# Code fence style
style: "backtick"

# MD049/emphasis-style - Emphasis style should be consistent
MD049:
# Emphasis style should be consistent
style: "underscore"

# MD050/strong-style - Strong style should be consistent
MD050:
# Strong style should be consistent
style: "asterisk"
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# See https://pre-commit.com/hooks.html for more hooks
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending

- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
args: [-c=.yamllint]

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
hooks:
- id: markdownlint
args: [-c.markdown.yaml]
- id: markdownlint-fix
args: [-c.markdown.yaml]

- repo: https://github.com/talos-systems/conform
rev: v0.1.0-alpha.27
hooks:
- id: conform
stages:
- commit-msg

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args: [
-L,
'ser,exite,lew,isplay,erro,hart,hve,som,gir,\
synopsys,uests,datas,synopsys,tung,ot,hda,parm'
]

- repo: local
hooks:
- id: double_slashes_url_external
name: Check double slashes in external URLs
entry: https?:\/\/[^\s]*(?<!http:)((?<!https:)\/\/).*
language: pygrep
exclude: '^.*.(jpeg|jpg|png|pdf)$'
- id: double_slashes_url_markdown
name: Check double slashes in markdown URLs
entry: (^[^\s]*\:\s|]\()[^\s)]*(?<!git:)((?<!http:)((?<!https:)\/\/))
language: pygrep
exclude: '^.*.(jpeg|jpg|png|pdf)$'

ci:
autoupdate_commit_msg: 'pre-commit: autoupdate hooks'
autofix_prs: false
16 changes: 16 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
extends: default

rules:
comments:
require-starting-space: true
ignore-shebangs: true
min-spaces-from-content: 2
document-start:
present: true
level: error
indentation:
spaces: 2
line-length: disable
truthy:
check-keys: false
131 changes: 70 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# 3mdeb blog documentation

## Important note: The author needs to verify the content using [Grammarly](#grammarly) before requesting review. Ask your supervisor for the premium account access.
> Important note: The author needs to verify the content using
> [Grammarly](#grammarly---a-must-have-for-content-verification) before
> requesting review. Ask your supervisor for the premium account access
### Table of contents
## Table of contents

<!-- toc -->

- [Deployment status](#deployment-status)
- [Usage](#usage)
* [Add new post](#add-new-post)
+ [Categories and tags](#categories-and-tags)
* [Local preview](#local-preview)
* [Deployment on https://beta.3mdeb.com](#deployment-on-https---beta3mdebcom)
* [Deployment on `production` blog](#deployment-on--production--blog)
* [Add new profile page](#add-new-profile-page)
- [Add new post](#add-new-post)
- [Categories](#categories)
- [Tags](#tags)
- [Local preview](#local-preview)
- [Deployment on https://beta.3mdeb.com](#deployment-on-beta-blog)
- [Deployment on `production` blog](#deployment-on-production-blog)
- [Add new profile page](#add-new-profile-page)
- [Good practices](#good-practices)
* [Grammarly](#grammarly)
* [Markdown](#markdown)
* [Single or multiple authors](#single-or-multiple-authors)
* [SEO best known methods](#seo-best-known-methods)
- [Grammarly](#grammarly---a-must-have-for-content-verification)
- [Markdown](#markdown)
- [Single or multiple authors](#single-or-multiple-authors)
- [SEO best known methods](#seo-best-known-methods)

<!-- tocstop -->

Expand Down Expand Up @@ -47,13 +50,14 @@ To add new post to our blog, first prepare local repository:
1. Edit post: `vim blog/content/post/<filename>.md`

Some valuable information:
* Familiarize yourself with [good practices](#good-practices) section.
* Use [Markdown](#Markdown) to write your blog post.
* You can use [local preview](#local-preview)
* Finished blog post should get reviewed - please create Github Pull Request to

- Familiarize yourself with [good practices](#good-practices) section.
- Use [Markdown](#markdown) to write your blog post.
- You can use [local preview](#local-preview)
- Finished blog post should get reviewed - please create Github Pull Request to
`develop` branch as described [here](#deployment)
* If deployment to beta doesn't show any issues please ask maintainer for sync
to [master](#deployment).
- If deployment to beta doesn't show any issues please ask maintainer for sync
to [master](#deployment).

#### Categories

Expand All @@ -70,19 +74,22 @@ We have several categories you can choose from:
#### Tags

Basically, we have a huge pool of tags available. Before creating a new tag,
check the currently [available tags](https://blog.3mdeb.com/tags/). If there
is no tag that properly describes your blog, create a **one** new tag.
check the currently [available tags](https://blog.3mdeb.com/tags/). If there is
no tag that properly describes your blog, create a **one** new tag.

### Local preview

1. Generate blog: `./scripts/local-build.sh`
1. Generated files can be found in `blog/public`

There is possibility to check whether new post is well formatted:

1. Run local server: `./scripts/local-preview.sh`
1. Go to [http://localhost:1313/](http://localhost:1313/) to view the changes.

### Deployment on https://beta.3mdeb.com
## Deployment

### Deployment on beta blog

1. Push commits with your blog post to your branch. There are no strict rules
for branch naming. It should refer to the post title.
Expand All @@ -96,11 +103,11 @@ There is possibility to check whether new post is well formatted:

### Deployment on `production` blog

When the blog's status in [beta](https://beta.blog.3mdeb.com) is acceptable,
we can deploy to [production](https://blog.3dmeb.com). To do that, simply
create the Pull Request from `develop` to `master`. Once it gets merged, the
same version of blog should be deployed to
[production](https://blog.3mdeb.com). You can check the deploy job status on the
When the blog's status in [beta](https://beta.blog.3mdeb.com) is acceptable, we
can deploy to [production](https://blog.3dmeb.com). To do that, simply create
the Pull Request from `develop` to `master`. Once it gets merged, the same
version of blog should be deployed to [production](https://blog.3mdeb.com). You
can check the deploy job status on the
[travis-ci.com](https://travis-ci.com/3mdeb/news-and-ideas)

### Add new profile page
Expand All @@ -109,32 +116,32 @@ Employees and post authors profile pages are now implemented to our Hugo blog.
To add new profile page, follow steps below:

1. Add `_index.md` file to `blog/content/authors/name-surname/` with the content
about the author (look at other profile pages for template).
about the author (look at other profile pages for template).
1. Add `name.surname.json` file to `blog/data/authors/` with the content about
the author for the post footer (look for other .json files for template)
the author for the post footer (look for other .json files for template)
1. Add `name.surname.png` image to `blog/static/authors/` for profile image.
1. After rebuilding the site (locally), new profile should be visible in the
authors list page: http://localhost:1313/authors/
authors list page: <http://localhost:1313/authors/>

## Good practices

### Grammarly - a must have for content verification

Grammarly is a great, free tool for all bloggers and anyone who needs to write
documentation in English.
It will let you know if you skipped a coma or made a typo, as well, as it will
check advanced grammar mistakes, too. Bear in mind, that the free version has
its limits, so you need to keep an eye on it at all times and still, you are
the one who distinguishes when to use a/an or the, as it only suggests changes.
documentation in English. It will let you know if you skipped a coma or made a
typo, as well, as it will check advanced grammar mistakes, too. Bear in mind,
that the free version has its limits, so you need to keep an eye on it at all
times and still, you are the one who distinguishes when to use a/an or the, as
it only suggests changes.

Two versions of Grammarly are available: a plugin for Chrome/Chromium or online
application. You need to create an account (it's for free) to be able to use
Grammarly.

Visit the website [Grammarly](https://app.grammarly.com/) and create an account.

>It is a MUST-HAVE application for anyone who writes posts or documentation, so
feel obliged to use it.
> It is a MUST-HAVE application for anyone who writes posts or documentation, so
> feel obliged to use it.
### Markdown

Expand All @@ -145,70 +152,72 @@ It is awesome because it is short and clear.
However, here are some most important commands:

- #, ##, ###, ####, #####, ###### - headers (just like in HTML `<h1><h2><h3>`
etc.)
etc.)
- `- some text` - it is simply a list item for an unordered list. - `<li>` in
HTML
HTML
- `1. some text` - an ordered list. Number does not matter, it will be ordered
automatically.
automatically.
- `[Visible text](URL)` - a link
- ` - inline code. Can be used as an inline quote
- ` x3 - block of code. You can write, next to it (connected) a programming
language. Supported aliases for language highlighting are listed
[here](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages)
- \` - inline code. Can be used as an inline quote
- \` x3 - block of code. You can write, next to it (connected) a programming
language. Supported aliases for language highlighting are listed
[here](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages)

If your post includes any images, they must be located in `blog/static/img`
directory. To link them in file written in Markdown, use the format below:

```
```bash
![alt text](/img/image_name.jpg)
```

**Remember about newlines before markdown tables, lists, quotes (>) and blocks
of text (\`\`\`).**

I hope this will help. To see more, visit [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
I hope this will help. To see more, visit
[Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)

>You can write attach inline HTML into Markdown and it will work!
>`<span style="color: blue">Some text</span>`
> You can write attach inline HTML into Markdown and it will work!
> `<span style="color: blue">Some text</span>`
### Single or multiple authors

In general, author meta-field MUST be strictly formatted (lowercase, non-polish
letters):

```
```bash
author: name.surname
```

If post has multiple authors, author meta-field MUST be formatted as below:

```
```bash
author:
- name.surname
- name.surname
```

### SEO best known methods

* Meta description - each post should have single-sentence description with
- Meta description - each post should have single-sentence description with
proper keywords (try to add as many keywords as possible)
> previously set in the Yoast SEO plugin [TBD - how to set them now]

* Tags selection - use proper tags (good examples are tags for articles of our
competition and results from the Google first site)
> previously set in the Yoast SEO plugin \[TBD - how to set them now\]
- Tags selection - use proper tags (good examples are tags for articles of our
competition and results from the Google first site)

* Graphic/image title - description with keywords related to whole article. All
images uploaded to WordPress should be edited in terms of SEO (WP-admin panel in
the `Media` tab). It is required to complete the `Caption` field and add tags
with `Meta Tag manager` -> `Add Meta Tag` (at the bottom).
- Graphic/image title - description with keywords related to whole article. All
images uploaded to WordPress should be edited in terms of SEO (WP-admin panel
in the `Media` tab). It is required to complete the `Caption` field and add
tags with `Meta Tag manager` -> `Add Meta Tag` (at the bottom).

### Creating titles - Emotional Marketing Value Headline Analyzer

<https://www.aminstitute.com/headline/>

The free tool, which analyze headline to determine the Emotional Marketing Value
(EMV) score. Headline is analyzed and scored based on the total number
of EMV words it has in relation to the total number of words it contains. This
will determine the EMV score of headline. Most professional copywriters'
headlines will have 30%-40% EMV Words in their headlines, while the most gifted
(EMV) score. Headline is analyzed and scored based on the total number of EMV
words it has in relation to the total number of words it contains. This will
determine the EMV score of headline. Most professional copywriters' headlines
will have 30%-40% EMV Words in their headlines, while the most gifted
copywriters will have 50%-75% EMV words in headlines.
Loading

0 comments on commit 9389f44

Please sign in to comment.