Skip to content

Commit fa6a6b3

Browse files
committed
Change language button order, fallback for page title
1 parent 2936ff4 commit fa6a6b3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

assets/js/custom.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@ function addLanguageSwitchButtons() {
211211
const buttonContainer = document.createElement("div");
212212
buttonContainer.classList.add("language-switch-container");
213213

214-
const jsButton = createLanguageButton("JS", "js");
215214
const tsButton = createLanguageButton("TS", "ts");
215+
const jsButton = createLanguageButton("JS", "js");
216216

217-
buttonContainer.appendChild(jsButton);
218217
buttonContainer.appendChild(tsButton);
218+
buttonContainer.appendChild(jsButton);
219219
document.body.appendChild(buttonContainer);
220220
}
221221

tools/dev-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ app.use(async (req, res, next) => {
6363
const bodyContent = await convertMarkdown(md);
6464
const templateFn = await getTemplate();
6565
// get title as first line in the md file which starts with hashes, which indicates it is a title of some kind
66-
const title = md.match(/^##* (.+)$/m)?.[1] || "";
66+
const title = md.match(/^##* (.+)$/m)?.[1] || req.url;
6767
const html = templateFn({ title, bodyContent });
6868
res.send(html);
6969
} else if (file) {

0 commit comments

Comments
 (0)