Skip to content
Draft
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
53 changes: 53 additions & 0 deletions .github/workflows/jackal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Jackal site
permissions: {}

on:
pull_request:
push:
branches:
- master
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build with Jackal
uses: LizardByte/jackal/.github/workflows/jekyll-build.yml@138318a0865e808d02fb7e7efd28a21366d38409
permissions:
contents: read
with:
upload_pages: true

preview:
name: Post the preview command
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id
needs: build
uses: LizardByte/jackal/.github/workflows/jekyll-preview-comment.yml@138318a0865e808d02fb7e7efd28a21366d38409
permissions:
contents: read
actions: read
pull-requests: write

deploy:
name: Deploy to GitHub Pages
if: needs.build.outputs.pages_artifact != ''
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Deploy
id: deploy
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
with:
artifact_name: ${{ needs.build.outputs.pages_artifact }}
Empty file removed .nojekyll
Empty file.
5 changes: 5 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: 404
title: Page not found
permalink: /404.html
---
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
<p>The Sunshine product page at <a href="https://sunshine.lizardbyte.dev/">sunshine.lizardbyte.dev</a>.</p>
</div>

GitHub Pages publishes `master` from the repository root. This is a static HTML, CSS, and JavaScript site with no
build step or runtime dependencies. Keep `.nojekyll` and `CNAME` at the repository root.
The Jackal workflow builds the site with Jekyll and deploys `master` using GitHub Pages. Keep `CNAME` at the repository root.

## Development

Serve the repository with a local static web server, for example `python -m http.server 8000`, then visit
`http://localhost:8000/`. Run the regression checks with `npm test` (Node.js 24 or newer).
When updating the stylesheet or main script, refresh its `?v=` value in `index.html` using the first 12 characters
of the file's SHA-256 hash so browsers receive the updated asset immediately after deployment.
Use the [Jackal build instructions](https://github.com/LizardByte/jackal/blob/master/docs/build-and-preview.md)
to build from source with the shared bundle.
On pull requests, the Jackal workflow posts a Docker command that serves the exact rendered
CI artifact, with no Ruby setup required for review.

Run the regression checks with `npm test` (Node.js 24 or newer).

The core downloads, documentation links, and featured Moonlight clients work without JavaScript. Optional enhancements
load the current Sunshine repository owner using GitHub repository ID `438803890`, display its latest stable release,
Expand Down
20 changes: 20 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Sunshine
url: https://sunshine.lizardbyte.dev
theme: jekyll-theme-jackal

jackal:
copyright: LizardByte
umbrella:
name: LizardByte
url: https://app.lizardbyte.dev/
logo: /assets/lizardbyte.svg

exclude:
- Gemfile
- Gemfile.lock
- LICENSE
- README.md
- package.json
- package-lock.json
- tests
18 changes: 18 additions & 0 deletions _includes/sunshine-icons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Adapted from https://github.com/SunshineStream/SunshineStream.github.io. SPDX-License-Identifier: AGPL-3.0-only -->
<svg class="icon-definitions" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<symbol id="arrow" viewBox="0 0 24 24"><path d="M5 12h14m-6-6 6 6-6 6"/></symbol>
<symbol id="external" viewBox="0 0 24 24"><path d="M7 17 17 7M7 7h10v10"/></symbol>
<symbol id="chip" viewBox="0 0 24 24"><rect x="5" y="5" width="14" height="14" rx="3"/><path d="M9 1v4m6-4v4M9 19v4m6-4v4M1 9h4m-4 6h4m14-6h4m-4 6h4"/><rect x="9" y="9" width="6" height="6" rx="1"/></symbol>
<symbol id="controller" viewBox="0 0 24 24"><path d="M7 6h10c3 0 4 3 5 10 1 5-3 5-6 0H8c-3 5-7 5-6 0C3 9 4 6 7 6Z"/><path d="M6 11h4m-2-2v4m8-2h.1m3 2h.1"/></symbol>
<symbol id="sliders" viewBox="0 0 24 24"><path d="M4 3v5m0 6v7M12 3v10m0 6v2M20 3v2m0 6v10M1 8h6m2 11h6m2-14h6"/><circle cx="4" cy="11" r="3"/><circle cx="12" cy="16" r="3"/><circle cx="20" cy="8" r="3"/></symbol>
<symbol id="desktop" viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8m-4-4v4"/></symbol>
<symbol id="phone" viewBox="0 0 24 24"><rect x="6" y="2" width="12" height="20" rx="3"/><path d="M10 5h4m-2 14h.1"/></symbol>
<symbol id="apple" viewBox="0 0 24 24"><path d="M15 2c0 2-1 4-3 4 0-2 1-4 3-4ZM19 14c-1 3-3 7-5 7-1 0-2-1-3-1s-2 1-3 1c-3 0-6-7-6-10 0-4 5-6 9-3 3-3 7-1 8 1-3 1-3 5 0 5Z"/></symbol>
<symbol id="windows" viewBox="0 0 24 24"><path d="M2 5 10 4v7H2zm11-1 9-2v9h-9zM2 14h8v7l-8-1zm11 0h9v9l-9-2z"/></symbol>
<symbol id="linux" viewBox="0 0 24 24"><path d="M8 9c0-6 1-7 4-7s4 1 4 7c4 3 6 9 3 11-2 2-4 1-7 1s-5 1-7-1c-3-2-1-8 3-11Z"/><path d="m9 11 3 2 3-2m-5-4h.1m3.9 0h.1M4 20l4-3m12 3-4-3"/></symbol>
<symbol id="github" viewBox="0 0 24 24"><path d="M9 19c-5 2-5-2-7-2m14 6v-4c0-1 0-2-1-3 4 0 7-2 7-6 0-1 0-3-2-4 0-1 0-3-1-4-2 0-4 2-4 2a15 15 0 0 0-6 0S7 2 5 2c-1 1-1 3-1 4-2 1-2 3-2 4 0 4 3 6 7 6-1 1-1 2-1 3v4"/></symbol>
<symbol id="terminal" viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="18" rx="3"/><path d="m6 8 4 4-4 4m7 0h5"/></symbol>
<symbol id="moon" viewBox="0 0 24 24"><path d="M21 13A9 9 0 0 1 11 3a9 9 0 1 0 10 10Z"/></symbol>
<symbol id="sun" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M2 12h2m16 0h2M5 5l2 2m10 10 2 2M5 19l2-2M17 7l2-2"/></symbol>
<symbol id="heart" viewBox="0 0 24 24"><path d="M20 5c-3-3-7-1-8 1-1-2-5-4-8-1-4 4 0 9 8 15 8-6 12-11 8-15Z"/></symbol>
</svg>
1 change: 1 addition & 0 deletions _includes/sunshine-scripts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script type="module" src="{{ '/assets/site.js' | relative_url }}"></script>
61 changes: 1 addition & 60 deletions assets/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,65 +92,6 @@ export async function enhanceClients(doc = document, fetcher = fetch) {
}
}

export function setupMenu(doc = document) {
const button = doc.querySelector('.menu-toggle');
const nav = doc.getElementById('navigation');
if (!button || !nav) return;
function close() {
nav.classList.remove('is-open');
button.setAttribute('aria-expanded', 'false');
}
button.addEventListener('click', () => {
const open = button.getAttribute('aria-expanded') !== 'true';
nav.classList.toggle('is-open', open);
button.setAttribute('aria-expanded', String(open));
});
nav.addEventListener('click', event => { if (event.target.closest('a')) close(); });
doc.addEventListener('keydown', event => {
if (event.key === 'Escape' && button.getAttribute('aria-expanded') === 'true') {
close();
button.focus();
}
});
}

/** Follow the device theme until the visitor chooses and saves a light or dark mode. */
export function setupTheme(doc = document, storage, media = globalThis.matchMedia?.('(prefers-color-scheme: dark)')) {
const button = doc.querySelector('.theme-toggle');
if (!button) return;
if (!storage) {
try { storage = globalThis.localStorage; } catch { /* Storage can be blocked. */ }
}
const root = doc.documentElement;
function effectiveTheme() {
if (['light', 'dark'].includes(root.dataset.theme)) return root.dataset.theme;
return media?.matches ? 'dark' : 'light';
}
function sync() {
const dark = effectiveTheme() === 'dark';
const label = dark ? 'Switch to light mode' : 'Switch to dark mode';
button.setAttribute('aria-label', label);
button.setAttribute('title', label);
doc.getElementById('theme-icon')?.setAttribute('href', dark ? '#sun' : '#moon');
doc.querySelector('meta[name="theme-color"]')?.setAttribute('content', dark ? '#181817' : '#f7f6f0');
doc.getElementById('sunshine-screenshot-dark')?.setAttribute('media', dark ? 'all' : 'not all');
}
button.addEventListener('click', () => {
const theme = effectiveTheme() === 'dark' ? 'light' : 'dark';
root.dataset.theme = theme;
try { storage?.setItem('sunshine-theme', theme); } catch { /* Keep the current-page preference. */ }
sync();
});
media?.addEventListener('change', sync);
button.hidden = false;
sync();
}

if (typeof document !== 'undefined') {
setupTheme();
setupMenu();
const year = document.getElementById('year');
if (year) year.textContent = String(new Date().getFullYear());
void enhanceRepository();
void enhanceClients();
await Promise.all([enhanceRepository(), enhanceClients()]);
}
Loading