12 Commits

Author SHA1 Message Date
20038e290a Fix width of pre element 2025-09-20 20:55:21 +02:00
52b49e18a2 Fix link regexp 2025-09-20 18:59:36 +02:00
5036b3bca6 Changed font size 2025-09-20 18:53:00 +02:00
5063c088eb Fixed margins 2025-09-20 18:52:22 +02:00
acd6ed63e1 Add leading space to links 2025-09-20 18:51:03 +02:00
8b3c7871ab Add color to links 2025-09-20 18:50:38 +02:00
2658d688ca Fixed reloading of browser when developing 2025-09-20 18:45:49 +02:00
03e2361798 Change header line height 2025-09-19 21:45:40 +02:00
a1f6994c02 Align note with index 2025-09-19 21:42:08 +02:00
07aea5f47a Theme blog post 2025-09-19 21:20:55 +02:00
a2b458627c Fix link on profile 2025-09-19 20:58:29 +02:00
9293108dcf Redesign of index
Squashed commit of the following:

commit 1d157b529f
Author: wholteza <zackarias@montell.se>
Date:   Fri Sep 19 20:53:00 2025 +0200

    Improve on profile

commit 3e3c209ac9
Author: wholteza <zackarias@montell.se>
Date:   Fri Sep 19 20:28:21 2025 +0200

    Finish styling index

commit 4e68f393bd
Author: wholteza <zackarias@montell.se>
Date:   Fri Sep 19 19:45:22 2025 +0200

    Links

commit fcba900a7e
Author: wholteza <zackarias@montell.se>
Date:   Fri Sep 19 15:37:35 2025 +0200

    add fetchpriority

commit 0478cb71b9
Author: wholteza <zackarias@montell.se>
Date:   Thu Sep 18 14:44:35 2025 +0200

    wip redesign
2025-09-19 20:54:49 +02:00
12 changed files with 1546 additions and 743 deletions

10
bs-config.cjs Normal file
View File

@@ -0,0 +1,10 @@
module.exports = {
port: 3000,
server: "./dist",
files: "./dist/**/*",
watchOptions: {
usePolling: true,
interval: 200,
binaryInterval: 200
}
}

1941
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,9 +6,9 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"dev": "concurrently --kill-others -n Build,Serve -c auto \"npm run watch-build\" \"npm run serve\"", "dev": "concurrently --kill-others -n Build,Serve -c auto \"npm run watch-build\" \"npm run serve\"",
"watch-build": "nodemon --ext js,ts,json,md,html --watch notes --watch src --watch packages/@zblog/toolchain/src --watch markdown.ts --exec \"npm run build --workspaces && npm run build && npm run generate-blog\"", "watch-build": "nodemon --ext js,ts,json,md,html --watch notes --watch src --watch templates --watch packages/@zblog/toolchain/src --watch markdown.ts --exec \"npm run build --workspaces && npm run build && npm run generate-blog\"",
"build": "tsc -p tsconfig.json", "build": "tsc -p tsconfig.json",
"serve": "serve dist", "serve": "browser-sync start --config bs-config.cjs",
"generate-blog": "node bin/index.js", "generate-blog": "node bin/index.js",
"initialize-firebase": "npm install -g firebase-tools && firebase login", "initialize-firebase": "npm install -g firebase-tools && firebase login",
"deploy": "npm run generate-blog && firebase deploy" "deploy": "npm run generate-blog && firebase deploy"
@@ -20,9 +20,9 @@
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@types/node": "^20.11.5", "@types/node": "^20.11.5",
"browser-sync": "^3.0.4",
"concurrently": "^8.2.1", "concurrently": "^8.2.1",
"nodemon": "^3.0.1", "nodemon": "^3.0.1",
"serve": "^14.2.1",
"typescript": "^5.3.3" "typescript": "^5.3.3"
} }
} }

View File

@@ -304,9 +304,10 @@ class Link extends Symbol {
/** /**
* @type {RegExp} * @type {RegExp}
*/ */
static textAndLinkRegExp: RegExp = new RegExp( static textAndLinkRegExp: RegExp = new RegExp
/\[(?<text>.*)\]\((?<link>.*)\)/ (
); /\[(?<text>[^\]]+)\]\((?<link>[^)]+)\)/
);
/** /**
* @type {string} * @type {string}
*/ */
@@ -350,7 +351,8 @@ class Link extends Symbol {
} }
render() { render() {
return `<a href="${this.link}">${this.text}</a>`; // TODO: This leading space should probably be somewhere else.
return ` <a href="${this.link}">${this.text}</a>`;
} }
} }
@@ -899,7 +901,7 @@ export const toHtml = (markdown: string, assetDirectory: string): string => {
// .filter((s) => !(s instanceof JustALineBreak)) // .filter((s) => !(s instanceof JustALineBreak))
.map((s) => s.render()) .map((s) => s.render())
.join(""); .join("");
return `<div>${html}</div>`; return `<div class="content">${html}</div>`;
}; };
/** /**

View File

@@ -14,15 +14,16 @@ export class StartPagePlugin implements IPluginBuilder {
return (builderContext) => { return (builderContext) => {
let htmlTemplate = readFileAsText(this.options.indexTemplatePath); let htmlTemplate = readFileAsText(this.options.indexTemplatePath);
const links = builderContext.menuManifest const links = builderContext.menuManifest
.map((m) => `<a href='${m.link}'>${m.name}</a>`) .map((m) => {
const name = m.name.slice(m.name.indexOf("-") + 1).replaceAll("-", " ");
return `<div class="entry"><h2>${name}</h2><a href='${m.link}'>Read here!</a></div>`
})
.reverse(); .reverse();
const unorderedListItems = links.map((l) => `<li>${l}</li>`).join("\r\n");
const html = ` const html = `
<ul> ${links.join("")}
${unorderedListItems}
<ul>
`; `;
htmlTemplate = htmlTemplate.replace("{{content}}", html); htmlTemplate = htmlTemplate.replace("{{content}}", html);
console.log("Generating index", this.options.indexTemplatePath);
writeTextAsFile( writeTextAsFile(
`${builderContext.outputDirectory}/index.html`, `${builderContext.outputDirectory}/index.html`,
htmlTemplate htmlTemplate

BIN
src/assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/profile.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@@ -25,8 +25,14 @@ new ToolchainBuilder(paths)
{ {
path: "src/templates/404.html", path: "src/templates/404.html",
nameOverride: "Not Found Page", nameOverride: "Not Found Page",
menuEntry: true, menuEntry: false,
}, },
{
path: "src/assets/profile.jpg",
},
{
path: "src/assets/favicon.ico",
}
], ],
}), }),
new StartPagePlugin({ new StartPagePlugin({

View File

@@ -1,4 +1,4 @@
# Measuring mash temperatures 🍺 🌡️ # Measuring mash temperatures
_2025-02-03 - 5 minute read_ _2025-02-03 - 5 minute read_

View File

@@ -0,0 +1,13 @@
# You would not download a theme
_2025-09-19 - 1 minute read_
I read this [blog](https://www.jmaguire.tech/) by a guy called John Maguire. It popped up when i was searching for how to configure [code folding in neovim](https://www.jmaguire.tech/posts/treesitter_folding/) and i thought the style was pretty neat!
I thought the least i could do was to provide some credits and a link to the place.
Both the header and the blog post list double dot underlining was done with ::after elements, which i thought was quite nifty. The header uses a repeating linear gradient of the accent color and transparent, never used that before.
You learn every day!
Also, I just noticed that my blog engine cannot manage file names with single quotes in them, whoopsie.

View File

@@ -1,54 +1,166 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <title>Document</title>
<style> <style>
html { html {
font-family: Arial, sans-serif; font-size: 18px;
font-size: 1.3em; line-height: 26px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
font-family: monospace;
} }
a {
color: #FFF;
}
body { body {
max-width: 800px; max-width: 800px;
color: #fbfbfe; color: #fbfbfe;
background-color: #1c1b22; background-color: #1c1b28;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
ul {
list-style-type: none;
padding: 0;
.content {
display: flex;
width: 100%;
flex: 1;
flex-direction: column;
} }
li:nth-child(1){
display: none; .content .entry {
margin-top: 1rem;
h2 {
color: #00FFFF;
text-transform: capitalize;
}
h2::after {
margin-top: 1rem;
top: 8px;
border-bottom: 3px dotted #00FFFF;
border-top: 3px dotted #00FFFF;
content: "";
width: 100%;
display: block;
position: relative;
box-sizing: border-box;
height: 8px;
}
h2 a {
color: white;
}
} }
li {
margin: 1em 0; .profile {
padding: 8px; border-color: #00FFFF;
border-radius: 8px;
border-style: solid;
border-width: 1px; border-width: 1px;
border-color: #aaa; border-style: solid;
width: 100%;
padding: 20px;
box-sizing: border-box;
font-family: monospace;
display: flex;
flex-direction: column;
flex: 1;
} }
li::before {
content: "📝"; .profile .picture {
margin-right: 8px; border-radius: 50%;
} }
a {
color: #fbfbfe; .profile ul {
text-decoration: none; margin: 0;
}
.profile li {}
.banner {
margin-top: 1rem;
width: 100%;
height: 40px;
display: flex;
flex-direction: row;
margin-bottom: 1rem;
align-items: center;
flex: 1;
font-family: monospace;
}
.banner {
.title {
display: flex;
flex-direction: row;
flex: 1;
.name {
color: #1c1b28;
background-color: #00FFFF;
white-space: nowrap;
padding: 5px;
a {
color: unset;
text-decoration: none;
}
}
}
.title::after {
background: repeating-linear-gradient(90deg, #00FFFF, #00FFFF 2px, transparent 0, transparent 10px);
content: "";
display: block;
width: 100%;
margin-left: 10px;
}
} }
</style> </style>
</head> </head>
<body> <body>
{{content}} <div class="banner">
<div class="title">
<div class="name"><a href="/">Zackarias Montell</a></div>
</div>
</div>
<div class="profile">
<img class="picture" src="profile.jpg" width="150" height="150" fetchpriority="high" />
<p>Software developer from Sweden. This is my place. Sometimes I publish thoughts or projects.</p>
<p>Things I do:</p>
<ul>
<li>Program things for fun. This site is built using <a href="https://git.zacke.dev/wholteza/blog">my own blog
framework</a> that generates a static website from markdown + a little bit of html templating.</li>
<li>I build physical things as well. Lately it has been <a
href="https://git.zacke.dev/wholteza/5x6-split-kb/src/branch/main/rev2">keyboards</a> in multiple <a
href="https://git.zacke.dev/wholteza/5x6-split-kb/src/branch/main/rev1">revisions</a>.</li>
<li>Brew beer in my garage. <a href="/5-measuring-mash-temperatures.html">I find the process interesting..</a> and
i
enjoy drinking beer.</li>
<li>Running and biking. You can find me on <a href="https://www.strava.com/athletes/41297534">strava</a>.
</li>
</ul>
<p><a href="https://git.zacke.dev/explore/repos">Gitea</a></p>
<p><a href="https://github.com/Wholteza">Github</a></p>
<p><a href="mailto:contact@montell.se">contact@montell.se</a> (not actually created yet but try changing out contact
for
my first name.)</p>
</div>
<div class="content">
{{content}}
</div>
</body> </body>
</html>
</html>

View File

@@ -1,56 +1,146 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <title>Document</title>
<style> <style>
html { html {
font-family: Arial, sans-serif; font-family: monospace;
font-size: 1.3em; font-size: 18px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
line-height: 26px;
flex-direction: column; flex-direction: column;
} }
@media screen and (max-width: 800px) {
html {
font-size: 0.9em;
}
}
body { body {
max-width: 800px; max-width: 800px;
color: #fbfbfe; color: #fbfbfe;
background-color: #1c1b22; background-color: #1c1b28;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
flex: 1;
} }
pre {
box-sizing: border-box;
border: 1px solid #00FFFF;
padding: 1rem;
width: fit-content;
max-width: 100%;
white-space: normal;
}
img { img {
max-width: 100%; max-width: 100%;
border-radius: 8px; border-radius: 4px;
} }
p{
margin: 20px; p {
margin-top: 20px; margin-top: 20px;
margin-bottom: 0px; margin-bottom: 0px;
} }
h1, h2, h3, h4, h5, h6 {
margin: 20px; h1 {
color: #00FFFF;
}
h1::after {
margin-top: 1rem;
content: "";
width: 100%;
display: block;
border-top: 3px dotted #00FFFF;
border-bottom: 3px dotted #00FFFF;
height: 8px;
box-sizing: border-box;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 20px;
margin-bottom: 0px; margin-bottom: 0px;
text-transform: capitalize; text-transform: capitalize;
line-height: 32px;
} }
h1 + p:has(> i) {
font-size: smaller; h1+p:has(> i) {
margin-top: 10px; margin-top: 1rem;
color: #00FFFF;
} }
p:has(> img) + p:has(> i) {
p:has(> img)+p:has(> i) {
font-size: smaller; font-size: smaller;
margin-top: 0px; margin-top: 0px;
} }
.banner {
margin-top: 1rem;
width: 100%;
height: 40px;
display: flex;
flex-direction: row;
margin-bottom: 1rem;
align-items: center;
flex: 1;
font-family: monospace;
}
.banner {
.title {
display: flex;
flex-direction: row;
flex: 1;
.name {
color: #1c1b28;
background-color: #00FFFF;
white-space: nowrap;
padding: 5px;
a {
color: unset;
text-decoration: none;
}
}
}
.title::after {
background: repeating-linear-gradient(90deg, #00FFFF, #00FFFF 2px, transparent 0, transparent 10px);
content: "";
display: block;
width: 100%;
margin-left: 10px;
}
}
a {
color: #00FFFF;
}
.content {
display: flex;
flex-direction: column;
flex: 1;
}
</style> </style>
</head> </head>
<body> <body>
<div class="banner">
<div class="title">
<div class="name"><a href="/">Zackarias Montell</a></div>
</div>
</div>
{{markdown}} {{markdown}}
</body> </body>
</html>
</html>