Skip to content

Commit

Permalink
Remove syntax highlighting and minification
Browse files Browse the repository at this point in the history
Only adds complexity and mental weight.
  • Loading branch information
brookback committed Jan 9, 2024
1 parent 2ec1399 commit c3b9461
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 225 deletions.
29 changes: 1 addition & 28 deletions _config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,21 @@ import postcss from 'lume/plugins/postcss.ts';
import esbuild from 'lume/plugins/esbuild.ts';
import date from 'lume/plugins/date.ts';
import inline from 'lume/plugins/inline.ts';
import minifyHTML from 'lume/plugins/minify_html.ts';
import { minifier } from './deps.ts';
import { readingTime } from './src/_lume-plugins/reading-time.ts';
import { extractExcerpt } from './src/_lume-plugins/excerpts.ts';
import { loadLanguages, prismMarkdown } from './src/_lume-plugins/prism.ts';
import { typeset } from './src/_lume-plugins/typeset.ts';
import sourceMaps from 'lume/plugins/source_maps.ts';
import { idOf } from './src/_includes/permalinks.ts';

const DEST = 'build';
const MINIFY = Deno.env.get('ENV') == 'production';

loadLanguages();

const site = lume(
{
src: 'src',
dest: DEST,
location: new URL('https://johan.im'), // Ignored in dev
},
{
markdown: {
options: {
highlight: prismMarkdown,
},
},
},
}
);

site
Expand Down Expand Up @@ -107,19 +95,4 @@ site
// Don't the entire site rebuild when --watching or --serving if .css files change
.scopedUpdates((path) => path.endsWith('.css'));

if (MINIFY) {
site.addEventListener('afterBuild', () => {
console.log('Minifying CSS…');
minifyCss();
});

site.use(minifyHTML());
}

const minifyCss = () => {
const css = Deno.readTextFileSync(`./${DEST}/johan.css`);
const minified = minifier.minify('css', css);
Deno.writeTextFileSync(`./${DEST}/johan.css`, minified);
};

export default site;
2 changes: 0 additions & 2 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export * as minifier from 'https://deno.land/x/[email protected]/mod.ts';
export type { Endpoints } from 'https://cdn.skypack.dev/@octokit/types@^6?dts';
export * as prism from 'https://cdn.skypack.dev/prismjs@^1?dts';
10 changes: 8 additions & 2 deletions src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ code {
}

:not(pre)>code {
color: var(--color-text-high-contrast);
font-weight: bold;
color: var(--code-color);
background-color: var(--code-background);
padding: .125rem .25rem;
border-radius: .125em;
font-weight: 500;
font-size: .85em;
}

Expand Down Expand Up @@ -254,6 +257,9 @@ pre {
hyphens: none;
tab-size: 2;
color: var(--code-color);
background-color: var(--code-background);
padding: .125rem .25rem;
border-radius: .25em;
-webkit-font-smoothing: subpixel-antialiased;
-moz-osx-font-smoothing: none;
font-size: var(--f5);
Expand Down
188 changes: 0 additions & 188 deletions src/css/prism-matrix.css

This file was deleted.

4 changes: 4 additions & 0 deletions src/css/prose.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ PROSE
overflow-wrap: break-word;
}

pre {
font-size: var(--f6);
}

& figure.image--full {
margin: calc(var(--lineheight) * 2) -14vw;

Expand Down
9 changes: 5 additions & 4 deletions src/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
--focus-color: var(--link-color);

--pre-background: var(--color-bg-secondary);
--code-background: var(--color-bg-secondary);
--code-color: hsl(112 30% 30%);
--code-background: rgb(0 0 0 / 2%);
--code-color: rgb(120 94 0);

--hr-color: var(--color-text);

Expand All @@ -52,7 +52,8 @@
--link-underline-color: hsl(201.43 57.86% 50.17% / 0.47);
--link-color-visited: #7a8be5;
--border-color: var(--color-text-detail);
--code-color: hsl(112 80% 80%);
--code-color: rgb(236 216 142);
--code-background: rgb(255 255 255 / 2%);

@supports (color: color(display-p3 1 1 1 / 1)) {
--link-color: color(display-p3 0.38 0.742 1);
Expand All @@ -63,7 +64,7 @@
/* Typography */

--sans: system-ui, sans-serif;
--mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
--serif: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif;

--font-size-base: 20;
Expand Down
1 change: 0 additions & 1 deletion src/johan.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ utils;
@import 'css/autogrow.css' layer(utils);
@import 'css/prose.css' layer(components);

@import 'css/prism-matrix.css' layer(base);
@import 'css/typeset.css' layer(utils);

0 comments on commit c3b9461

Please sign in to comment.