Skip to content

Commit

Permalink
fix(about): make external links open in new tab and lazy load images
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoMcA committed Nov 22, 2024
1 parent 480933c commit cbff4ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build/spas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ import {
} from "../libs/env/index.js";
import { isValidLocale } from "../libs/locale-utils/index.js";
import { DocFrontmatter, DocParent, NewsItem } from "../libs/types/document.js";
import { getSlugByBlogPostUrl, makeTOC } from "./utils.js";
import {
getSlugByBlogPostUrl,
injectLoadingLazyAttributes,
makeTOC,
postProcessExternalLinks,
} from "./utils.js";
import { findByURL } from "../content/document.js";
import { buildDocument } from "./index.js";
import { findPostBySlug } from "./blog.js";
Expand Down Expand Up @@ -310,6 +315,8 @@ export async function buildSPAs(options: {
};
const [$] = await kumascript.render(url, {}, d);
wrapTables($);
postProcessExternalLinks($);
injectLoadingLazyAttributes($);
const [sections] = await extractSections($);
const toc = makeTOC({ body: sections });

Expand Down

0 comments on commit cbff4ec

Please sign in to comment.