Compare commits

...

2 Commits

7 changed files with 11 additions and 14 deletions

View File

@ -13,8 +13,7 @@ export default function (manifestName: string) {
const mappings: { [path: string]: string } = {};
return new Transform({
readableObjectMode: true,
writableObjectMode: true,
objectMode: true,
transform(chunk: File, _, callback) {
const hash = PRODUCTION ? fileHash(chunk.contents as Buffer) : "00000000";
const newName = `${chunk.basename.substring(0, chunk.basename.length - chunk.extname.length)}.${hash.substring(0, 8)}${chunk.extname}`;

View File

@ -13,11 +13,11 @@ import { PRODUCTION, DEFAULT_DATE } from "../environment.js";
import rehypeExternalLinks from "rehype-external-links";
import visit from "unist-util-visit";
import { src, dest } from "gulp";
import renderLayout from "../../src/layout.js";
import renderArticleLayout from "../../src/article.js";
import renderIndex from "../../src/index.js";
import renderLayout from "../views/layout.js";
import renderArticleLayout from "../views/article.js";
import renderIndex from "../views/index.js";
import { renderToStaticMarkup } from "preact-render-to-string";
import { SITE_TITLE, SITE_DESCRIPTION } from "../../src/constants.js";
import { SITE_TITLE, SITE_DESCRIPTION } from "../constants.js";
import { JSX } from "preact/jsx-runtime";
import { reloadAssets } from "../assets.js";
@ -62,8 +62,7 @@ function renderArticle() {
reloadAssets();
return new Transform({
readableObjectMode: true,
writableObjectMode: true,
objectMode: true,
async transform(file: File, _, callback) {
try {
const slug = basename(file.path, ".asciidoc");

View File

@ -13,8 +13,7 @@ const FONT_PRESETS = {
function compileFont() {
return new Transform({
readableObjectMode: true,
writableObjectMode: true,
objectMode: true,
async transform(chunk: File, _, callback) {
const [, variant, weight] = /([A-Z][a-z]+)-(\w+)\.ttf$/.exec(chunk.basename);
const tmpOutput = tmp.fileSync({ discardDescriptor: true });

View File

@ -1,6 +1,6 @@
import { Document } from "asciidoctor";
import { DateTime } from "luxon";
import { asset } from "../lib/assets.js";
import { asset } from "../assets.js";
type Props = {
article: Document;

View File

@ -1,6 +1,6 @@
import { Document } from "asciidoctor";
import { DateTime } from "luxon";
import { asset } from "../lib/assets.js";
import { asset } from "../assets.js";
const Header = () => (
<header class="index-header">

View File

@ -1,6 +1,6 @@
import { SITE_DEFAULT_META, SITE_TITLE } from "./constants.js";
import { SITE_DEFAULT_META, SITE_TITLE } from "../constants.js";
import { JSX } from "preact/jsx-runtime";
import { asset } from "../lib/assets.js";
import { asset } from "../assets.js";
type Props = {
title?: string;