Skip to content
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
30 changes: 30 additions & 0 deletions .github/redirects/check_redirects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import json
import sys
from http import HTTPStatus
from pathlib import Path

import requests


def check_redirect(url: str) -> bool:
url = f'http://localhost{url}'
print(f'checking URL: {url}')
response = requests.get(url)

if response.status_code != HTTPStatus.OK:
print(f'ERROR: URL {url} returned: {response.status_code}')
return False

return True


with Path('.github/redirects/urls.json').open() as fd:
urls = json.load(fd)

result = True

for url in urls:
result &= check_redirect(url)

if not result:
sys.exit(1)
84 changes: 84 additions & 0 deletions .github/redirects/urls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[
"/2021/05/28/django-django_tables2-and-bootstrap-table/",
"/2021/05/17/covid-19-montreal-dashboard/",
"/wp-content/uploads/2021/05/dashboard_before.jpg",
"/wp-content/uploads/2021/05/dashboard_relaunch.jpg",
"/2021/05/12/sepaq-availability-scraper/",
"/2021/05/12/setting-up-msmtp/",
"/2021/03/18/set-up-debian/",
"/2020/01/16/notes-on-traefik-v2-nextcloud-etc/",
"/2020/01/14/migrating-data-to-nextcloud/",
"/2020/01/08/notes-on-docker/",
"/2020/01/06/notes-on-setting-up-my-raspberry-pi/",
"/2019/12/12/making-emf-models-serialized-in-xmi-available-in-json-with-emfjson/",
"/2019/12/11/migrate-legacy-thunderbird-add-on-to-mailextension-for-thunderbird-68/",
"/2019/11/14/how-to-drag-music-and-videos-onto-iphone-ipad-using-itunes/",
"/2018/09/12/deploying-angular-application-on-apache-server/",
"/2018/07/25/digging-into-the-firefox-ui-for-the-tab-close-button/",
"/2017/12/08/airdrop-on-macos-working-unreliably/",
"/2016/01/04/ios-how-to-fix-or-change-voicemail-number/",
"/2016/01/04/firefox-close-tab-button-on-hover/",
"/2015/11/10/thunderbird-extension-hide-badge-icon/",
"/2015/11/10/thunderbird-extension-toggle-headers-updated/",
"/2015/08/19/mt4j-with-processing-2/",
"/2015/08/18/how-to-use-ocl-when-running-emf-standalone-with-eclipse-mars/",
"/2015/08/18/move-more-than-one-directory-into-a-new-repository/",
"/2015/06/19/move-directory-from-one-repository-to-another-preserving-history/",
"/2013/05/25/show-old-title-bar-in-thunderbird/",
"/wp-content/uploads/2013/05/thunderbird_17_titlebar.jpg",
"/wp-content/uploads/2013/05/thunderbird_17_titlebar_after.jpg",
"/2013/05/02/modifying-the-new-child-sub-menu-items-in-emf/",
"/2013/04/25/reducing-file-size-of-a-pdf-on-mac-os/",
"/2012/05/31/how-to-use-ocl-when-running-emf-standalone/",
"/2012/05/29/lyx-installing-unknown-document-classes/",
"/2012/05/19/postgresql-accepts-any-or-no-password-when-connecting/",
"/2012/05/10/using-multiple-svn-clients-with-the-svnssh-protocol-and-a-putty-profile/",
"/2012/02/07/thunderbird-extension-toggle-headers/",
"/2012/02/07/hide-star-besides-email-addresses-in-thunderbird/",
"/2011/04/14/things-discovered-in-struts-2/",
"/2011/03/30/mac-os-airport-not-connecting-automatically-to-wi-fi/",
"/2011/03/30/office-end-user-license-agreement-eula-has-to-be-accepted-every-time/",
"/2011/03/30/hide-the-network-icon-from-windows-7-explorer/",
"/2011/03/21/setting-up-apache-and-subversion-on-debian-wheezy/",
"/privacy-policy-2/",
"/projects/",
"/research/",
"/research/publications/",
"/",
"/blog/",
"/blog/page/2/",
"/legal-notice/",
"/wp-portfolio/digital-printing-workflow/",
"/wp-portfolio/covid-19-montreal-dashboard/",
"/wp-portfolio/sepaq-availability-scraper/",
"/wp-portfolio/docker-monitor/",
"/wp-portfolio/concernification-study/",
"/wp-portfolio/touchcore/",
"/wp-portfolio/tippspiel/",
"/wp-portfolio/kinect-project/",
"/wp-portfolio/hochseilgarten-nagold/",
"/wp-portfolio/max-payne-zone/",
"/category/distributed-version-control/",
"/category/frameworks/django/",
"/category/docker/",
"/category/frameworks/emf/",
"/category/firefox/",
"/category/frameworks/",
"/category/distributed-version-control/git/",
"/category/hints/",
"/category/howto/",
"/category/java/",
"/category/mac-os/",
"/category/nextcloud/",
"/category/office/",
"/category/raspberry-pi/",
"/category/frameworks/struts/",
"/category/thunderbird/",
"/category/tweaks/",
"/category/uncategorized/",
"/category/windows/",
"/category/windows/windows-7/",
"/portfolio-category/archive/",
"/portfolio-category/development/",
"/portfolio-category/side-projects/"
]
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ jobs:
- name: Check markdownlint results
run: |
cat markdownlint-cli2-sarif.sarif | grep -q '"results": \[\]'
- name: Build mkdocs site
run: uv run mkdocs build --strict
- name: Run the production stack
run: docker compose up --build -d
- name: Check
run: uv run --script .github/redirects/check_redirects.py
- name: Stop production stack
run: docker compose down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ RUN python -m mkdocs build --strict --site-dir /site
# production
FROM joseluisq/static-web-server:2.34.0

COPY deploy/sws.toml /config.toml

COPY --from=build /site /public
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
app:
build:
context: .
restart: unless-stopped
ports:
- "80:80"
141 changes: 141 additions & 0 deletions deploy/sws.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
[advanced]

### URL Redirects

# publications to research index
[[advanced.redirects]]
source = "/research/publications/"
destination = "/research/"
kind = 301

# old legal notice
[[advanced.redirects]]
source = "/legal-notice/"
destination = "/imprint/"
kind = 301

# old privacy policy
[[advanced.redirects]]
source = "/privacy-policy-2/"
destination = "/privacy-policy/"
kind = 301

# papers
[[advanced.redirects]]
source = "/wp-content/papercite-data/pdf/{*}.pdf"
destination = "/assets/papers/$1.pdf"
kind = 301

# blog categories that don't exist anymore
[[advanced.redirects]]
source = "/category/{uncategorized,frameworks,hints,howto,office,tweaks,windows}/"
destination = "/blog/"
kind = 301

[[advanced.redirects]]
source = "/category/java/"
destination = "/blog/category/eclipse-modeling-framework-emf/"
kind = 301

[[advanced.redirects]]
source = "/category/frameworks/struts/"
destination = "/blog/"
kind = 301

[[advanced.redirects]]
source = "/category/windows/windows-7/"
destination = "/blog/"
kind = 301

[[advanced.redirects]]
source = "/category/distributed-version-control/"
destination = "/blog/category/git/"
kind = 301

# blog categories that exist but under a different structure
[[advanced.redirects]]
source = "/category/frameworks/django/"
destination = "/blog/category/django/"
kind = 301

[[advanced.redirects]]
source = "/category/distributed-version-control/git/"
destination = "/blog/category/git/"
kind = 301

[[advanced.redirects]]
source = "/category/frameworks/emf/"
destination = "/blog/category/eclipse-modeling-framework-emf/"
kind = 301

[[advanced.redirects]]
source = "/category/{raspberry-pi,nextcloud}/"
destination = "/blog/category/self-hosting/"
kind = 301

# categories that still exist
[[advanced.redirects]]
source = "/category/{*}/"
destination = "/blog/category/$1/"
kind = 301

# old blog categories
[[advanced.redirects]]
source = "/category/{*}/"
destination = "/blog/category/$1/"
kind = 301

# blog archive: month not accessible anymore
[[advanced.redirects]]
source = "/{[0-9][0-9][0-9][0-9]}/{[0-9][0-9]}/"
destination = "/blog/archive/$1/"
kind = 301

# blog posts
[[advanced.redirects]]
source = "/{[0-9][0-9][0-9][0-9]}/{[0-9][0-9]}/{[0-9][0-9]}/{*}/"
destination = "/blog/$1/$2/$3/$4"
kind = 301

# uploads for blog posts

# COVID-19 Montreal Dashboard
[[advanced.redirects]]
source = "/wp-content/uploads/2021/05/{*}"
destination = "/blog/2021/covid-19-montreal-dashboard/$1"
kind = 301

# Thunderbird titlebar
[[advanced.redirects]]
source = "/wp-content/uploads/2013/05/{*}"
destination = "/blog/2013/show-old-title-bar-in-thunderbird/$1"
kind = 301

# portfolio pages
[[advanced.redirects]]
source = "/wp-portfolio/{*}/"
destination = "/projects/#{$1}"
kind = 301

# portfolio categories
[[advanced.redirects]]
source = "/portfolio-category/development/"
destination = "/projects/#software-engineering"
kind = 301

[[advanced.redirects]]
source = "/portfolio-category/{*}/"
destination = "/projects/"
kind = 301

# image uploads
[[advanced.redirects]]
source = "/wp-content/*/*/*/{*}.jpg"
destination = "/assets/images/$1.jpg"
kind = 301

# video uploads
[[advanced.redirects]]
source = "/wp-content/*/*/*/{*}.{mp4,mov}"
destination = "/assets/videos/$1.$2"
kind = 301
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ migrated: true
date:
created: 2011-03-30
updated: 2011-03-30
# categories:
# - macOS
categories:
- Mac OS
slug: mac-os-airport-not-connecting-automatically-to-wi-fi
---
# Mac OS: Airport not connecting automatically to Wi-Fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
migrated: true
date:
created: 2012-02-06
updated: 2012-02-06
created: 2012-02-07
updated: 2012-02-07
categories:
- Thunderbird
# - Tweaks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
migrated: true
date:
created: 2012-05-28
created: 2012-05-29
updated: 2013-04-05
# categories:
# - Mac OS
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/posts/2012/thunderbird-extension-toggle-headers.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
migrated: true
date:
created: 2012-02-06
updated: 2012-02-06
created: 2012-02-07
updated: 2012-02-07
categories:
- Thunderbird
slug: thunderbird-extension-toggle-headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ The default case is implemented in `ItemProviderAdapter`.

There seem to be two approaches, depending on what your goal is.

<!-- more -->

## General Approach

If you want to change the text independent from the element, meaning for all elements, you should change the `_UI_CreateChild_text` key in `plugin.properties`.
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/posts/2013/reducing-file-size-of-a-pdf-on-mac-os.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ migrated: true
date:
created: 2013-04-25
updated: 2017-12-12
# categories:
categories:
# - Howto
# - Mac OS
- Mac OS
slug: reducing-file-size-of-a-pdf-on-mac-os
---
# Reducing file size of a PDF on Mac OS
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/posts/2015/mt4j-with-processing-2.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
migrated: true
date:
created: 2015-08-18
updated: 2015-08-18
created: 2015-08-19
updated: 2015-08-19
# categories:
# - Java
slug: mt4j-with-processing-2
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/posts/2015/thunderbird-extension-hide-badge-icon.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
migrated: true
date:
created: 2015-11-09
updated: 2015-11-09
created: 2015-11-10
updated: 2015-11-10
categories:
# - Mac OS
- Thunderbird
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
migrated: true
date:
created: 2015-11-09
updated: 2015-11-09
created: 2015-11-10
updated: 2015-11-10
categories:
- Thunderbird
slug: thunderbird-extension-toggle-headers-updated
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/posts/2017/airdrop-on-macos-working-unreliably.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ migrated: true
date:
created: 2017-12-08
updated: 2017-12-08
# categories:
# - Mac OS
categories:
- Mac OS
slug: airdrop-on-macos-working-unreliably
---
# AirDrop on macOS working unreliably
Expand Down
Loading
Loading