Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SEO CI and fix issues #529

Merged
merged 10 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

104 changes: 104 additions & 0 deletions .github/workflows/seo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
name: SEO CI
on:
push:
branches:
- master
pull_request:
branches:
- master
- develop

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
with:
fail: true
args: |
--max-concurrency 20 --max-redirects 10 -a 403,429,500,502,503,999 .

seo_spy_orphan_pages:
runs-on: ubuntu-latest
name: Check orphan pages
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true

- name: Checkout SEO Spy
uses: actions/checkout@v3
with:
repository: 3mdeb/seo-spy
path: seo-spy

- uses: actions/setup-python@v3
with:
python-version: '3.9'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r seo-spy/requirements.txt

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
extended: true

- name: Serve site
run: |
npm install postcss-cli
hugo -s blog/
hugo serve -s blog/ -b http://localhost:1313 --bind=0.0.0.0 &

- name: Check orphan pages
uses: 3mdeb/seo-spy-action@main
with:
domain: 'http://localhost:1313'

seo_spy_canonical_links:
runs-on: ubuntu-latest
name: Check canonical links
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true

- name: Checkout SEO Spy
uses: actions/checkout@v3
with:
repository: 3mdeb/seo-spy
path: seo-spy

- uses: actions/setup-python@v3
with:
python-version: '3.9'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r seo-spy/requirements.txt

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
extended: true

- name: Serve site
run: |
npm install postcss-cli
hugo -s blog/
hugo serve -s blog/ -b http://localhost:1313 --bind=0.0.0.0 &

- name: Check canonical links
uses: 3mdeb/seo-spy-action@main
with:
domain: 'http://localhost:1313'
args: '-c'
8 changes: 8 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.Permalink
themes/3mdeb/layouts
[email protected]
https://www.embedded-world.de/
https://www.paypal.com/cgi-bin/webscr
https://www.aliexpress.com
https://twitter.com
localhost:1313
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
Loading
Loading