From 5685558aac7e91ef28a0fbb57f50cc640f0c46df Mon Sep 17 00:00:00 2001 From: Jan Sroka Date: Wed, 8 Jul 2026 20:24:51 +0200 Subject: [PATCH] chore: add CI checks, pin Ruby, fix OG fallback, and improve accessibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Brings the site up to date by closing gaps between configured tooling and what is actually enforced, plus a few correctness and a11y fixes. - ci: add pull_request workflow that builds the site and runs html-proofer, RuboCop and Prettier — none of these were gating changes before (the existing workflow only builds and deploys on push to main). - ci: pin Ruby via .ruby-version (single source of truth) and drop the hardcoded ruby-version from the deploy workflow. - seo/social: the default Open Graph/Twitter image referenced a file that does not exist, producing broken share previews. Drive it from a new site.og_image_default config value (empty by default) so no broken tag is emitted; the card degrades to summary when unset. Images to be added later. - cleanup: remove the deprecated Twitter follow-button iframe and the unused footer.links block from _config.yml. - a11y: add a skip-to-content link and wrap page content in
; give the footer logo a real alt text. - security: add rel="noopener" to all target="_blank" links. - seo: add robots.txt pointing at the generated sitemap. - repo hygiene: gitignore .DS_Store. Note: a full local Jekyll build could not be run in this environment (offline, gems not installed), so the Liquid/build is verified by the new CI workflow on this PR rather than locally. Prettier and YAML validation pass locally. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++ .github/workflows/jekyll.yml | 2 +- .gitignore | 1 + .ruby-version | 1 + README.MD | 4 +-- _config.yml | 28 +++++---------------- _includes/footer.html | 17 +++---------- _includes/head.html | 26 +++++++++---------- _includes/header.html | 3 ++- _layouts/default.html | 24 +++++++++--------- _layouts/home.html | 8 +++--- assets/css/custom.css | 19 ++++++++++++++ robots.txt | 9 +++++++ 13 files changed, 124 insertions(+), 66 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .ruby-version create mode 100644 assets/css/custom.css create mode 100644 robots.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..05d1548 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +# Validates changes before they can be merged. The deploy workflow +# (jekyll.yml) only runs on push to main, so this is the gate for PRs. +on: + pull_request: + branches: ["main"] + # Allow running manually from the Actions tab + workflow_dispatch: + +permissions: + contents: read + +jobs: + build-and-check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + # Ruby version comes from the .ruby-version file (single source of truth) + bundler-cache: true + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - name: Install npm dependencies + run: npm ci + + - name: Build with Jekyll + run: bundle exec jekyll build + env: + JEKYLL_ENV: production + + - name: Check internal links (html-proofer) + run: npm run test-links + + - name: Lint Ruby (RuboCop) + run: npm run rubocop + + - name: Check formatting (Prettier) + run: npx prettier --check . --ignore-path '' diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index eb964f5..e96d3b8 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -37,7 +37,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: "3.3" # Not needed with a .ruby-version file + # Ruby version comes from the .ruby-version file (single source of truth) bundler-cache: true # runs 'bundle install' and caches installed gems automatically cache-version: 1 # Increment this number if you need to re-download cached gems diff --git a/.gitignore b/.gitignore index 6930745..49406f3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ _site .jekyll-cache .jekyll-metadata vendor +.DS_Store # We want to track these !.vscode diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..2f4b607 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.4 diff --git a/README.MD b/README.MD index b71af64..2c83852 100644 --- a/README.MD +++ b/README.MD @@ -1,6 +1,6 @@ # README -Dieses Repo enthält unsere aktuelle Website. +Dieses Repo enthält unsere aktuelle Website. Gehostet sind wir auf Github Pages. ### Deploy wie? Die Website ist mit Jekyll gebaut. Bei jedem Push wird die Website neu gebaut und deployed. @@ -9,5 +9,5 @@ Die Website ist mit Jekyll gebaut. Bei jedem Push wird die Website neu gebaut un Lokal laufen lassen: `bundle exec jekyll serve --host localhost --port 4000 --open-url` -### Update aller Deps +### Update aller Deps `bundle update` diff --git a/_config.yml b/_config.yml index b5ba8b9..0c7e071 100644 --- a/_config.yml +++ b/_config.yml @@ -26,6 +26,12 @@ description: >- # this means to ignore newlines until "baseurl:" baseurl: "" # the subpath of your site, e.g. /blog url: "https://www.inoeg.de" # the base hostname & protocol for your site, e.g. http://example.com +# Default image for social-media link previews (Open Graph / Twitter cards). +# Ideal size: 1200x630 PNG. Leave empty until a proper image is added — an empty +# value means no image tag is emitted (no broken reference). Individual pages can +# override this via the `og_image` front-matter key. +og_image_default: "" + # Specify used plugins here and in the Gemfile to ensure full flexibility. # Note that github pages only supports plugins that are specified in _config.yml plugins: @@ -61,25 +67,3 @@ exclude: include: - _pages # static content - _posts # for blog / news posts - -# Site Footer -footer: - links: - - label: "Twitter" - icon: "fab fa-fw fa-twitter-square" - # url: - - label: "Facebook" - icon: "fab fa-fw fa-facebook-square" - # url: - - label: "GitHub" - icon: "fab fa-fw fa-github" - # url: - - label: "GitLab" - icon: "fab fa-fw fa-gitlab" - # url: - - label: "Bitbucket" - icon: "fab fa-fw fa-bitbucket" - # url: - - label: "Instagram" - icon: "fab fa-fw fa-instagram" - # url: diff --git a/_includes/footer.html b/_includes/footer.html index e36a9c7..660e997 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -4,7 +4,7 @@ diff --git a/_includes/head.html b/_includes/head.html index 31437f8..b3723ca 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -14,28 +14,27 @@ -{% if page.og_image %} - - - - -{% else %} - +{% comment %} + Per-page `og_image` wins; otherwise fall back to `site.og_image_default` + (set in _config.yml). If neither is set, no image tag is emitted so we never + reference a non-existent file. +{% endcomment %} +{% assign share_image = page.og_image | default: site.og_image_default %} +{% if share_image %} + {% endif %} - + -{% if page.og_image %} - -{% else %} - +{% if share_image %} + + {% endif %} - @@ -49,3 +48,4 @@ + diff --git a/_includes/header.html b/_includes/header.html index b32ffba..4f3995a 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,3 +1,4 @@ +
{% include logo.html %} @@ -5,7 +6,7 @@