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
2 changes: 1 addition & 1 deletion .github/workflows/codeberg-mirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
mirror-repo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Use Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: 22
node-version: 26
cache: npm
cache-dependency-path: ./package-lock.json
- name: Load Project Dependencies
run: npm install --frozen-lockfile
- name: Run Build
run: npm run build
- uses: cloudflare/wrangler-action@v3
- uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Expand All @@ -34,24 +34,24 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: 22
node-version: 26
cache: npm
cache-dependency-path: package-lock.json
- name: Load Project Dependencies
run: npm install --frozen-lockfile
- name: Run Build
run: npm run build
- uses: cloudflare/wrangler-action@v3
- uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }}
- uses: actions/upload-pages-artifact@v3
- uses: actions/upload-pages-artifact@v5
with:
path: dist

Expand All @@ -66,5 +66,5 @@ jobs:
url: ${{ steps.gh-deploy.outputs.page_url }}
needs: [release]
steps:
- uses: actions/deploy-pages@v4.0.2
- uses: actions/deploy-pages@v5.0.1
id: gh-deploy
30 changes: 13 additions & 17 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
"files": {
"includes": [
"**",
"!**/src/components/ui/**",
"!**/src/lib/**",
"!**/dist/**",
"!**/src/assets/**"
]
"includes": ["**", "!**/src/components/ui", "!**/src/lib", "!**/dist", "!**/src/assets"]
},
"formatter": {
"enabled": true,
Expand All @@ -27,8 +21,11 @@
},
"linter": {
"enabled": true,
"domains": {
"tailwind": "all"
},
"rules": {
"recommended": true,
"preset": "recommended",
"a11y": {},
"complexity": {
"noBannedTypes": "error",
Expand Down Expand Up @@ -119,9 +116,7 @@
"noConsole": {
"level": "warn",
"options": {
"allow": [
"log"
]
"allow": ["log"]
}
}
},
Expand All @@ -144,6 +139,9 @@
}
},
"css": {
"parser": {
"tailwindDirectives": true
},
"formatter": {
"enabled": true,
"lineWidth": 120,
Expand All @@ -163,9 +161,7 @@
"indentWidth": 2
}
},
"html":{
"formatter":{

}
"html": {
"formatter": {}
}
}
}
41 changes: 34 additions & 7 deletions eleventy.config.mjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
import { HtmlBasePlugin, IdAttributePlugin, InputPathToUrlTransformPlugin } from '@11ty/eleventy';
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
import { dirname, resolve as resolveFile } from 'node:path';
import { HtmlBasePlugin, IdAttributePlugin, InputPathToUrlTransformPlugin } from '@11ty/eleventy';
// import { feedPlugin } from "@11ty/eleventy-plugin-rss";
import { eleventyImageTransformPlugin } from '@11ty/eleventy-img';
import tailwindcss from '@tailwindcss/postcss';
import htmlmin from 'html-minifier-terser';
import { DateTime } from 'luxon';
import postcss from 'postcss/lib/postcss';
import { createHighlighterCoreSync, createJavaScriptRegexEngine } from 'shiki';
// import ansi from 'shiki/langs/ansi.mjs';
import c from 'shiki/langs/c.mjs';
import csharp from 'shiki/langs/csharp.mjs';
import css from 'shiki/langs/css.mjs';
import html_derivative from 'shiki/langs/html-derivative.mjs';
import html from 'shiki/langs/html.mjs';
import ini from 'shiki/langs/ini.mjs';
import java from 'shiki/langs/java.mjs';
import javascript from 'shiki/langs/javascript.mjs';
import nix from 'shiki/langs/nix.mjs';
import perl from 'shiki/langs/perl.mjs';
import rust from 'shiki/langs/rust.mjs';
import shell from 'shiki/langs/shell.mjs';
import tsx from 'shiki/langs/tsx.mjs';
import typescript from 'shiki/langs/typescript.mjs';
import html_derivative from 'shiki/langs/html-derivative.mjs';
import vitesse_dark from 'shiki/themes/vitesse-dark.mjs';
import vitesse_light from 'shiki/themes/vitesse-light.mjs';

Expand All @@ -30,7 +33,7 @@ export default async function (eleventyConfig) {
************************/
eleventyConfig.on('eleventy.before', async () => {
const tailwindInputPath = resolveFile('./src/main.css');
const tailwindOutputPath = './src/assets/compiled.css';
const tailwindOutputPath = './dist/assets/styles.css';
const cssContent = readFileSync(tailwindInputPath, 'utf8');
const outputDir = dirname(tailwindOutputPath);

Expand Down Expand Up @@ -78,7 +81,7 @@ export default async function (eleventyConfig) {
'./src/assets/fonts': 'assets/fonts',
'./src/assets/pfp.webp': 'assets/pfp.webp',
'./src/assets/thumbs': 'assets/thumbs',
'./src/assets/compiled.css': 'assets/styles.css',
// './src/assets/compiled.css': 'assets/styles.css',
})
.addPassthroughCopy('./content/feed/pretty-atom-feed.xsl');

Expand Down Expand Up @@ -108,7 +111,7 @@ export default async function (eleventyConfig) {
//Make a singleton Shiki Highlighter
const highlighter = createHighlighterCoreSync({
themes: [vitesse_light, vitesse_dark],
langs: [rust, java, perl, html, tsx, typescript, javascript, c, csharp, shell, css, html_derivative],
langs: [rust, java, perl, html, tsx, typescript, javascript, c, csharp, shell, css, html_derivative, nix, ini],
engine: createJavaScriptRegexEngine(),
});
const langs = highlighter.getLoadedLanguages();
Expand Down Expand Up @@ -138,8 +141,23 @@ export default async function (eleventyConfig) {
});
};

//Override the default render rule (irrevocably)
mdLib.renderer.rules.fence = function (tokens, idx, _options, _env, slf) {
//Hijack the link normalizer to process the href for common URLs
const normalizeLinkProxy = mdLib.normalizeLink.bind({});
mdLib.normalizeLink = function (/** @type {string}*/ url) {
const linkMatched = /(wiki|gh):(.*)/.exec(url);
if (linkMatched) {
switch (linkMatched[1]) {
case 'wiki':
return normalizeLinkProxy(`https://en.wikipedia.com/wiki/${linkMatched[2]}`);
case 'gh':
return normalizeLinkProxy(`https://github.com/${linkMatched[2]}`);
}
}
return normalizeLinkProxy(url);
};

//Override the default fence render rule (irrevocably)
mdLib.renderer.rules.fence = function (tokens, idx, _options, env, slf) {
const token = tokens[idx];
const info = token.info ? mdLib.utils.unescapeAll(token.info).trim() : '';
let fenceName = '';
Expand All @@ -163,6 +181,15 @@ export default async function (eleventyConfig) {
<figcaption>${imgCaption}</figcaption>
</figure>`;
}
if (fenceName === 'editorial') {
const contentRendered = mdLib.render(token.content, env).trim();
return `<div class="editorial">
<h5>Editor's Note</h5>
${contentRendered}
</div>

`;
}

const highlighted = highlight(token.content, fenceName, fenceAttrs);
if (highlighted.indexOf('<pre') === 0) {
Expand Down
Loading
Loading