-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4abdbd2
commit bf9e8e5
Showing
486 changed files
with
3,315 additions
and
10,335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,21 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
on: [ push, pull_request ] | ||
env: | ||
refinedSitesVersion: 0.1.0 | ||
jobs: | ||
build-frontend: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- run: npm ci | ||
- run: npm run build | ||
- run: rm -rf node_modules | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: frontend-output | ||
path: . | ||
build-website: | ||
runs-on: ubuntu-latest | ||
needs: build-frontend | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: 'refinedmods/sitegen' | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
- run: go build | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: frontend-output | ||
- run: chown $USER sitegen | ||
- run: ./sitegen build | ||
env: | ||
SITEGEN_GITHUB_TOKEN: ${{ secrets.GH_METADATA_TOKEN }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: output | ||
path: output/ | ||
deploy: | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
runs-on: ubuntu-latest | ||
needs: build-website | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: output | ||
path: output/ | ||
- name: Deploy to GitHub Pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: output/ | ||
- uses: actions/checkout@v3 | ||
- name: Use Refined Sites | ||
run: wget "https://github.com/refinedmods/refinedsites/releases/download/v$refinedSitesVersion/refinedsites-$refinedSitesVersion.jar" | ||
- name: Setup Java | ||
uses: refinedmods/refinedarchitect/.github/actions/setup-java@develop | ||
- name: Build site | ||
run: java -jar refinedsites-$refinedSitesVersion.jar . | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- run: npm ci | ||
- run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/ | ||
dist/ | ||
output/ | ||
.idea |
This file was deleted.
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/*! | ||
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/) | ||
* Copyright 2011-2023 The Bootstrap Authors | ||
* Licensed under the Creative Commons Attribution 3.0 Unported License. | ||
*/ | ||
|
||
(() => { | ||
'use strict' | ||
|
||
const getStoredTheme = () => localStorage.getItem('theme') | ||
const setStoredTheme = theme => localStorage.setItem('theme', theme) | ||
|
||
const getPreferredTheme = () => { | ||
const storedTheme = getStoredTheme() | ||
if (storedTheme) { | ||
return storedTheme | ||
} | ||
|
||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' | ||
} | ||
|
||
const setTheme = theme => { | ||
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) { | ||
document.documentElement.setAttribute('data-bs-theme', 'dark') | ||
} else { | ||
document.documentElement.setAttribute('data-bs-theme', theme) | ||
} | ||
} | ||
|
||
setTheme(getPreferredTheme()) | ||
|
||
const showActiveTheme = (theme, focus = false) => { | ||
const themeSwitcher = document.querySelector('#bd-theme') | ||
|
||
if (!themeSwitcher) { | ||
return | ||
} | ||
|
||
const themeSwitcherText = document.querySelector('#bd-theme-text') | ||
const activeThemeIcon = document.querySelector('.theme-icon-active') | ||
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`) | ||
|
||
document.querySelectorAll('[data-bs-theme-value]').forEach(element => { | ||
element.classList.remove('active') | ||
element.setAttribute('aria-pressed', 'false') | ||
}) | ||
|
||
document.querySelectorAll('.theme-check').forEach(element => { | ||
element.classList.add('d-none') | ||
}); | ||
|
||
btnToActive.querySelector('.theme-check').classList.remove('d-none') | ||
|
||
if (activeThemeIcon.classList.contains('bi-circle-half')) { | ||
activeThemeIcon.classList.remove('bi-circle-half') | ||
} | ||
if (activeThemeIcon.classList.contains('bi-sun-fill')) { | ||
activeThemeIcon.classList.remove('bi-sun-fill') | ||
} | ||
if (activeThemeIcon.classList.contains('bi-moon-stars-fill')) { | ||
activeThemeIcon.classList.remove('bi-moon-stars-fill') | ||
} | ||
activeThemeIcon.classList.add( | ||
theme === 'light' ? 'bi-sun-fill' : theme === 'dark' ? 'bi-moon-stars-fill' : 'bi-circle-half' | ||
) | ||
|
||
btnToActive.classList.add('active') | ||
btnToActive.setAttribute('aria-pressed', 'true') | ||
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})` | ||
themeSwitcher.setAttribute('aria-label', themeSwitcherLabel) | ||
|
||
if (focus) { | ||
themeSwitcher.focus() | ||
} | ||
} | ||
|
||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => { | ||
const storedTheme = getStoredTheme() | ||
if (storedTheme !== 'light' && storedTheme !== 'dark') { | ||
setTheme(getPreferredTheme()) | ||
} | ||
}) | ||
|
||
window.addEventListener('DOMContentLoaded', () => { | ||
showActiveTheme(getPreferredTheme()) | ||
|
||
document.querySelectorAll('[data-bs-theme-value]') | ||
.forEach(toggle => { | ||
toggle.addEventListener('click', () => { | ||
const theme = toggle.getAttribute('data-bs-theme-value') | ||
setStoredTheme(theme) | ||
setTheme(theme) | ||
showActiveTheme(theme, true) | ||
}) | ||
}) | ||
}) | ||
})() |
Oops, something went wrong.