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 @@