-
Notifications
You must be signed in to change notification settings - Fork 626
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
Showing
58 changed files
with
3,187 additions
and
1,121 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
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
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,16 @@ | ||
name: Label Enforcer | ||
|
||
# Run action on pull request creation, reopening, or label changes | ||
on: | ||
pull_request: | ||
types: [opened, reopened, labeled, unlabeled] | ||
|
||
jobs: | ||
# Ensure that PR has desired labels | ||
enforce-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: yogevbd/[email protected] | ||
with: | ||
REQUIRED_LABELS_ANY: "automerge,breaking-change,bug-fix,enhancement,feature,translation" | ||
REQUIRED_LABELS_ANY_DESCRIPTION: "The PR must have at least one these labels: ['automerge','breaking-change','bug-fix','enhancement','feature','translation']" |
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
# checkout to the commit that has been pushed | ||
- uses: actions/checkout@v4.1.5 | ||
- uses: actions/checkout@v4.2.2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
|
@@ -35,7 +35,7 @@ jobs: | |
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4.1.5 | ||
- uses: actions/checkout@v4.2.2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
|
@@ -73,20 +73,11 @@ jobs: | |
timeout: 5 | ||
urls: "${{ steps.preview.outputs.url }},${{ steps.preview.outputs.url }}/posts/,${{ steps.preview.outputs.url }}/posts/markdown-sample/,${{ steps.preview.outputs.url }}/posts/shortcodes/" | ||
|
||
# Ensure that PR has desired labels | ||
enforce-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: yogevbd/[email protected] | ||
with: | ||
REQUIRED_LABELS_ANY: "automerge,breaking-change,bug-fix,enhancement,feature,translation" | ||
REQUIRED_LABELS_ANY_DESCRIPTION: "The PR must have at least one these labels: ['automerge','breaking-change','bug-fix','enhancement','feature','translation']" | ||
|
||
# Check for any broken links | ||
markdown-link-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# checkout to latest commit | ||
- uses: actions/checkout@v4.1.5 | ||
- uses: actions/checkout@v4.2.2 | ||
# run markdown linter | ||
- uses: gaurav-nelson/[email protected] |
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
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,9 @@ | ||
let theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'light' | ||
if (theme === 'system') { | ||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { | ||
theme = 'dark' | ||
} else { | ||
theme = 'light' | ||
} | ||
} | ||
document.documentElement.setAttribute('data-theme', theme) |
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,22 @@ | ||
addCopyButtons(navigator.clipboard) | ||
|
||
function addCopyButtons(clipboard) { | ||
document.querySelectorAll('pre > code').forEach(function (codeBlock) { | ||
const button = document.createElement('button') | ||
button.title = "Copy" | ||
button.className = 'copy-code-button btn btn-sm' | ||
button.innerHTML = "<i class='fa-regular fa-copy'></i>" | ||
|
||
button.addEventListener('click', function () { | ||
clipboard.writeText(codeBlock.innerText) | ||
}) | ||
|
||
const pre = codeBlock.parentNode | ||
if (pre.parentNode.classList.contains('highlight')) { | ||
const highlight = pre.parentNode | ||
highlight.parentNode.insertBefore(button, highlight) | ||
} else { | ||
pre.parentNode.insertBefore(button, pre) | ||
} | ||
}) | ||
} |
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 @@ | ||
import './copyCode' |
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
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,88 @@ | ||
import * as params from '@params'; | ||
const PERSISTENCE_KEY = 'theme-scheme' | ||
|
||
const themeOptions = params.theme || {} | ||
const THEME_DARK = typeof themeOptions.dark === 'undefined' ? true : themeOptions.dark; | ||
const THEME_LIGHT = typeof themeOptions.light === 'undefined' ? true : themeOptions.light; | ||
const THEME_DEFAULT = typeof themeOptions.default === 'undefined' ? "system" : themeOptions.default; | ||
|
||
window.addEventListener('load', async () => { | ||
const menu = document.getElementById('themeMenu') | ||
const $icon = document.getElementById('navbar-theme-icon-svg') | ||
if (menu == null || $icon == null) return | ||
|
||
const btns = menu.getElementsByTagName('a') | ||
const iconMap = Array.from(btns).reduce((map, btn) => { | ||
const $img = btn.getElementsByTagName('img')[0] | ||
map[btn.dataset.scheme] = $img.src | ||
return map | ||
}, {}) | ||
|
||
|
||
function checkScheme(scheme) { | ||
if (THEME_LIGHT === false) return "dark" | ||
if (THEME_DARK === false) return "light" | ||
return scheme | ||
} | ||
|
||
function loadScheme() { | ||
return localStorage.getItem(PERSISTENCE_KEY) || loadDefaultScheme() | ||
} | ||
|
||
function loadDefaultScheme() { | ||
return THEME_DEFAULT || "system" | ||
} | ||
|
||
function saveScheme(scheme) { | ||
localStorage.setItem(PERSISTENCE_KEY, scheme) | ||
} | ||
|
||
function getPreferredColorScheme() { | ||
const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches; | ||
return isDarkMode ? "dark" : "light"; | ||
} | ||
|
||
function setScheme(newScheme) { | ||
let theme = newScheme | ||
if (newScheme === 'system') { | ||
theme = getPreferredColorScheme() | ||
} | ||
// set data-theme attribute on html tag | ||
document.querySelector("html").dataset.theme = theme; | ||
|
||
// update icon | ||
$icon.src = iconMap[newScheme] | ||
|
||
// save preference to local storage | ||
saveScheme(newScheme) | ||
|
||
setImages(theme) | ||
} | ||
|
||
const checkedScheme = checkScheme(loadScheme()) | ||
setScheme(checkedScheme) | ||
|
||
Array.from(menu.getElementsByTagName('a')).forEach((btn) => { | ||
btn.addEventListener('click', () => { | ||
const { scheme } = btn.dataset | ||
setScheme(scheme) | ||
}) | ||
}) | ||
}) | ||
|
||
function setImages(newScheme) { | ||
const els = Array.from(document.getElementsByClassName('logo-holder')); | ||
for (const el of els) { | ||
const light = el.querySelector('.light-logo'); | ||
const dark = el.querySelector('.dark-logo'); | ||
|
||
if (newScheme === "dark" && dark !== null) { | ||
if (light !== null) light.style.display = 'none' | ||
dark.style.display = 'inline' | ||
} | ||
else { | ||
if (light !== null) light.style.display = 'inline' | ||
if (dark !== null) dark.style.display = 'none' | ||
} | ||
} | ||
} |
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
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
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,15 @@ | ||
import Filterizr from 'filterizr' | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
// ================== Skill cards ===================== | ||
|
||
// setup skill filter buttons | ||
const skillCardHolder = document.getElementById('skill-card-holder') | ||
if (skillCardHolder != null && skillCardHolder.children.length !== 0) { | ||
// eslint-disable-next-line no-new | ||
new Filterizr('.filtr-skills', { | ||
layout: 'sameWidth', | ||
controlsSelector: '.skill-filtr-control' | ||
}) | ||
} | ||
}) |
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
Oops, something went wrong.