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
61 changes: 61 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy Jekyll site to GitHub Pages

on:
push:
branches:
- master
- copilot/update-page-with-just-the-docs-template
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- name: Generate build info
run: |
mkdir -p _data
SHORT_SHA="${GITHUB_SHA:0:7}"
echo "sha: \"$GITHUB_SHA\"" > _data/build_info.yml
echo "short_sha: \"$SHORT_SHA\"" >> _data/build_info.yml
echo "datetime: \"$(date -u '+%Y-%m-%d %H:%M:%S UTC')\"" >> _data/build_info.yml

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Build with Jekyll
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production

- name: Upload artifact
uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

gem "just-the-docs", "0.12.0"
gem "webrick", "~> 1.8"
34 changes: 34 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
title: Peter Kirschner
description: >-
Conference talks and OSGi/Eclipse development resources by Peter Kirschner.
baseurl: ""
url: "https://peterkir.github.io"

theme: just-the-docs

color_scheme: light

search_enabled: true
search_tokenizer_separator: /[\s/]+/

nav_sort: order

back_to_top: true
back_to_top_text: "Back to top"

heading_anchors: true

aux_links:
"GitHub":
- "https://github.com/peterkir"
aux_links_new_tab: true

footer_content: ""

exclude:
- Gemfile.lock
- vendor/
- node_modules/
- "201410_EclipseCon_Europe/presentation/node_modules/"
- "201410_EclipseCon_Europe/presentation/test/"
- doc/
3 changes: 3 additions & 0 deletions _data/build_info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sha: "local"
short_sha: "local"
datetime: "local build"
7 changes: 7 additions & 0 deletions _includes/footer_custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% if site.data.build_info %}
<div class="build-info">
Built: {{ site.data.build_info.datetime }}
&bull;
SHA: <a href="https://github.com/peterkir/peterkir.github.io/commit/{{ site.data.build_info.sha }}" target="_blank" rel="noopener">{{ site.data.build_info.short_sha }}</a>
</div>
{% endif %}
9 changes: 9 additions & 0 deletions _includes/head_custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script>
// Apply theme before paint to prevent flash of unstyled content (FOUC)
(function () {
var saved = localStorage.getItem('theme');
var preferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
document.documentElement.setAttribute('data-theme', saved || preferred);
})();
</script>
<link rel="stylesheet" href="{{ '/assets/css/dark-mode.css' | relative_url }}">
31 changes: 31 additions & 0 deletions _includes/header_custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<button id="theme-toggle" class="theme-toggle" aria-label="Toggle dark mode" title="Toggle light/dark mode">
<span class="moon-icon" aria-hidden="true">🌙</span>
<span class="sun-icon" aria-hidden="true">☀️</span>
</button>

<script>
(function () {
function applyTheme(theme) {
document.documentElement.setAttribute('data-theme', theme);
localStorage.setItem('theme', theme);
}

function updateButton(theme) {
var btn = document.getElementById('theme-toggle');
if (!btn) return;
btn.setAttribute('aria-pressed', theme === 'dark' ? 'true' : 'false');
btn.title = theme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode';
}

document.addEventListener('DOMContentLoaded', function () {
var current = document.documentElement.getAttribute('data-theme') || 'light';
updateButton(current);

document.getElementById('theme-toggle').addEventListener('click', function () {
var next = document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';
applyTheme(next);
updateButton(next);
});
});
})();
</script>
Loading
Loading