Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3a13772
feat: improve blog preview
load1n9 Dec 6, 2024
f10bb3a
misread some feedback lmao
load1n9 Dec 6, 2024
5798822
feat: prism formatting
load1n9 Dec 8, 2024
efc87b3
feat: improve blog preview (#32) (#34)
load1n9 Dec 8, 2024
996157c
feat: clean up icons
load1n9 Dec 8, 2024
034819e
feat: lookup tables
load1n9 Dec 8, 2024
1455071
fix: duplicate
load1n9 Dec 8, 2024
449c820
feat: prism theme contrast
load1n9 Dec 8, 2024
f885c08
one dark and one light
load1n9 Dec 8, 2024
0c368e9
feat: improve blog preview (#32) (#35)
load1n9 Dec 8, 2024
ed74d90
feat: improve blog preview
load1n9 Dec 6, 2024
0dbf5ba
misread some feedback lmao
load1n9 Dec 6, 2024
8993fe2
feat: prism formatting
load1n9 Dec 8, 2024
7a19843
feat: improve blog preview (#32) (#34)
load1n9 Dec 8, 2024
58ba4d0
feat: clean up icons
load1n9 Dec 8, 2024
bef31b6
feat: lookup tables
load1n9 Dec 8, 2024
ab5edf3
fix: duplicate
load1n9 Dec 8, 2024
e5fafff
feat: prism theme contrast
load1n9 Dec 8, 2024
351cec7
one dark and one light
load1n9 Dec 8, 2024
e96512f
feat: improve blog preview (#32) (#35)
load1n9 Dec 8, 2024
360404d
Merge branch 'blog-preview2' of https://github.com/trynova/trynova.gi…
load1n9 Dec 8, 2024
058f52c
chore: move out of function
load1n9 Dec 8, 2024
c3fde76
rename icon
load1n9 Dec 8, 2024
9145db6
Update public/prism.css
load1n9 Dec 8, 2024
eb8e870
fmt
load1n9 Dec 8, 2024
39c7b0b
Merge branch 'blog-preview2' of https://github.com/trynova/trynova.gi…
load1n9 Dec 8, 2024
cff6e07
deno fmt
load1n9 Dec 8, 2024
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 components/BlogPreviewList.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
font-size: 0.9rem;
color: var(--neutral-800);
white-space: pre-wrap;
}
}
40 changes: 36 additions & 4 deletions components/Markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,45 @@
}

p > code {
background-color: var(--neutral-100);
outline: 0.15em solid var(--neutral-100);
background-color: light-dark(hsl(230, 1%, 98%), hsl(220, 13%, 18%));
outline: 0.15em solid light-dark(hsl(230, 1%, 98%), hsl(220, 13%, 18%));
}

pre:has(code) {
outline: 1rem solid var(--neutral-100);
background-color: var(--neutral-100);
outline: 1rem solid light-dark(hsl(230, 1%, 98%), hsl(220, 13%, 18%));
background-color: light-dark(hsl(230, 1%, 98%), hsl(220, 13%, 18%));
overflow: auto;
}

::-webkit-scrollbar {
width: 6px;
height: 6px;
}

::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
display: block;
height: 10px;
}

::-webkit-scrollbar-button:vertical:increment {
background-color: var(--neutral-400);
}

::-webkit-scrollbar-track-piece {
background-color: var(--neutral-400);
-webkit-border-radius: 3px;
}

::-webkit-scrollbar-thumb:vertical {
height: 50px;
background-color: var(--neutral-400);
-webkit-border-radius: 3px;
}

::-webkit-scrollbar-thumb:horizontal {
width: 50px;
background-color: var(--neutral-400);
-webkit-border-radius: 3px;
}
}
28 changes: 26 additions & 2 deletions components/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
import * as marked from "marked";

import { Marked } from "marked";
import { markedHighlight } from "marked-highlight";
import Prism from "prismjs";
import "prismjs/components/prism-bash.min.js";
import "prismjs/components/prism-javascript.min.js";
import "prismjs/components/prism-typescript.min.js";
import "prismjs/components/prism-css.min.js";
import "prismjs/components/prism-json.min.js";
import "prismjs/components/prism-jsx.min.js";
import "prismjs/components/prism-tsx.min.js";
import "prismjs/components/prism-rust.min.js";
import { css } from "utils/css.ts";
import clsx from "clsx";

const languageAliases: Record<string, string> = {
rs: "rust",
console: "sh",
};

const marked = new Marked(markedHighlight({
emptyLangClass: "language-none",
langPrefix: "language-",
highlight(code, lang, _info) {
lang = languageAliases[lang] ?? lang;
const language = Prism.languages[lang] ?? Prism.languages.autoit;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Isn't autoit the hotkey language? You should default to no highlighting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt our default language the autohotkey language?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah wait wrong language its this one https://www.autoitscript.com/site/autoit/

return Prism.highlight(code, language, lang);
},
}));

const classes = await css(import.meta.resolve("./Markdown.css"));

export interface MarkdownProps {
Expand Down
2 changes: 2 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
"fresh_charts": "https://deno.land/x/fresh_charts@0.3.1/mod.ts",
"lightningcss": "npm:lightningcss@^1.27.0",
"marked": "npm:marked@^14.1.2",
"marked-highlight": "npm:marked-highlight@2.2.1",
"octokit": "npm:octokit@4.0.2",
"preact": "npm:preact@^10.24.0",
"prismjs": "npm:prismjs@^1.29.0",
"preact-render-to-string": "npm:preact-render-to-string@^6.5.11",
"utils/": "./utils/"
},
Expand Down
19 changes: 17 additions & 2 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pages/blog/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if (import.meta.main) {
description: post.meta.description,
author: post.meta.authors.map((author) => author.name).join(", "),
canonical: href(post.file),
highlight: true,
}),
);
}
Expand Down
Binary file removed public/icons/android/android-launchericon-144-144.png
Binary file not shown.
Binary file removed public/icons/android/android-launchericon-192-192.png
Binary file not shown.
Binary file removed public/icons/android/android-launchericon-48-48.png
Binary file not shown.
Binary file not shown.
Binary file removed public/icons/android/android-launchericon-72-72.png
Binary file not shown.
Binary file removed public/icons/android/android-launchericon-96-96.png
Binary file not shown.
File renamed without changes
Binary file removed public/icons/ios/100.png
Binary file not shown.
Binary file removed public/icons/ios/1024.png
Binary file not shown.
Binary file removed public/icons/ios/114.png
Binary file not shown.
Binary file removed public/icons/ios/120.png
Binary file not shown.
Binary file removed public/icons/ios/128.png
Binary file not shown.
Binary file removed public/icons/ios/144.png
Binary file not shown.
Binary file removed public/icons/ios/152.png
Binary file not shown.
Binary file removed public/icons/ios/16.png
Binary file not shown.
Binary file removed public/icons/ios/167.png
Binary file not shown.
Binary file removed public/icons/ios/180.png
Binary file not shown.
Binary file removed public/icons/ios/192.png
Binary file not shown.
Binary file removed public/icons/ios/20.png
Binary file not shown.
Binary file removed public/icons/ios/256.png
Binary file not shown.
Binary file removed public/icons/ios/29.png
Binary file not shown.
Binary file removed public/icons/ios/32.png
Binary file not shown.
Binary file removed public/icons/ios/40.png
Binary file not shown.
Binary file removed public/icons/ios/50.png
Binary file not shown.
Binary file removed public/icons/ios/512.png
Binary file not shown.
Binary file removed public/icons/ios/57.png
Diff not rendered.
Binary file removed public/icons/ios/60.png
Diff not rendered.
Binary file removed public/icons/ios/64.png
Diff not rendered.
Binary file removed public/icons/ios/72.png
Diff not rendered.
Binary file removed public/icons/ios/76.png
Diff not rendered.
Binary file removed public/icons/ios/80.png
Diff not rendered.
Binary file removed public/icons/ios/87.png
Diff not rendered.
Binary file removed public/icons/windows11/LargeTile.scale-100.png
Diff not rendered.
Binary file removed public/icons/windows11/LargeTile.scale-125.png
Diff not rendered.
Binary file removed public/icons/windows11/LargeTile.scale-150.png
Diff not rendered.
Binary file removed public/icons/windows11/LargeTile.scale-200.png
Diff not rendered.
Binary file removed public/icons/windows11/LargeTile.scale-400.png
Diff not rendered.
Binary file removed public/icons/windows11/SmallTile.scale-100.png
Diff not rendered.
Binary file removed public/icons/windows11/SmallTile.scale-125.png
Diff not rendered.
Binary file removed public/icons/windows11/SmallTile.scale-150.png
Diff not rendered.
Binary file removed public/icons/windows11/SmallTile.scale-200.png
Diff not rendered.
Binary file removed public/icons/windows11/SmallTile.scale-400.png
Diff not rendered.
Binary file removed public/icons/windows11/SplashScreen.scale-100.png
Diff not rendered.
Binary file removed public/icons/windows11/SplashScreen.scale-125.png
Diff not rendered.
Binary file removed public/icons/windows11/SplashScreen.scale-150.png
Diff not rendered.
Binary file removed public/icons/windows11/SplashScreen.scale-200.png
Diff not rendered.
Binary file removed public/icons/windows11/SplashScreen.scale-400.png
Diff not rendered.
Binary file removed public/icons/windows11/Square150x150Logo.scale-100.png
Diff not rendered.
Binary file removed public/icons/windows11/Square150x150Logo.scale-125.png
Diff not rendered.
Binary file removed public/icons/windows11/Square150x150Logo.scale-150.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed public/icons/windows11/Square44x44Logo.scale-100.png
Diff not rendered.
Binary file removed public/icons/windows11/Square44x44Logo.scale-125.png
Diff not rendered.
Binary file removed public/icons/windows11/Square44x44Logo.scale-150.png
Diff not rendered.
Binary file removed public/icons/windows11/Square44x44Logo.scale-200.png
Diff not rendered.
Binary file removed public/icons/windows11/Square44x44Logo.scale-400.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed public/icons/windows11/StoreLogo.scale-100.png
Diff not rendered.
Binary file removed public/icons/windows11/StoreLogo.scale-125.png
Diff not rendered.
Binary file removed public/icons/windows11/StoreLogo.scale-150.png
Diff not rendered.
Binary file removed public/icons/windows11/StoreLogo.scale-200.png
Diff not rendered.
Binary file removed public/icons/windows11/StoreLogo.scale-400.png
Diff not rendered.
Binary file removed public/icons/windows11/Wide310x150Logo.scale-100.png
Diff not rendered.
Binary file removed public/icons/windows11/Wide310x150Logo.scale-125.png
Diff not rendered.
Binary file removed public/icons/windows11/Wide310x150Logo.scale-150.png
Diff not rendered.
Binary file removed public/icons/windows11/Wide310x150Logo.scale-200.png
Diff not rendered.
Diff not rendered.
Loading