Skip to content

Commit

Permalink
seo.yml: Add oprhan pages and canonical links jobs
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 28, 2023
1 parent fd72c6c commit 3140f93
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 2 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/seo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,82 @@ jobs:
with:
fail: true
args: --max-redirects 10 -a 403,500,503 .

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: |
hugo serve -b http://localhost:1313 --bind=0.0.0.0 &
sleep 10
- 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: |
hugo serve -b http://localhost:1313 --bind=0.0.0.0 &
sleep 10
- name: Check canonical links
uses: 3mdeb/seo-spy-action@main
with:
domain: 'http://localhost:1313'
args: '-c'
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ http://localhost:1313/
https://www.embedded-world.de/en/all-about-the-exhibition
.email
.sales
https://twitter.com/dwizzzleMSFT
6 changes: 4 additions & 2 deletions themes/3mbed/layouts/_default/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
{{- if .Permalink -}}
{{ if not (strings.HasSuffix .Permalink "/praca/") }}
{{- if not (strings.HasSuffix .Permalink "/my-account/") -}}
{{ if not (strings.HasSuffix .Permalink "/elements/") }}<url>
{{ if not (strings.HasSuffix .Permalink "/elements/") }}
{{- if not (strings.HasSuffix .Permalink "/tags/") -}}
{{ if not (strings.HasSuffix .Permalink "/categories/") }}<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
Expand All @@ -20,5 +22,5 @@
hreflang="{{ .Language.LanguageCode }}"
href="{{ .Permalink }}"
/>{{ end }}
</url>{{ end }}{{- end -}}{{ end }}{{- end -}}{{ end }}
</url>{{ end }}{{- end -}}{{ end }}{{- end -}}{{ end }}{{- end -}}{{ end }}
</urlset>

0 comments on commit 3140f93

Please sign in to comment.