Skip to content

Commit

Permalink
ensure image path separators are correct for urls
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonstyle committed Apr 28, 2022
1 parent 11f38ae commit 1fc676d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/project/types/website/listing/website-listing-read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { cloneDeep, orderBy } from "../../../../core/lodash.ts";
import { existsSync } from "fs/mod.ts";

import { Format, Metadata } from "../../../../config/types.ts";
import { filterPaths, resolvePathGlobs } from "../../../../core/path.ts";
import {
filterPaths,
pathWithForwardSlashes,
resolvePathGlobs,
} from "../../../../core/path.ts";
import { inputTargetIndex } from "../../../project-index.ts";
import { ProjectContext } from "../../../types.ts";

Expand Down Expand Up @@ -569,7 +573,9 @@ async function listItemFromFile(input: string, project: ProjectContext) {
const imageRaw = documentMeta?.image as string ||
findPreviewImgMd(target?.markdown.markdown);
const image = imageRaw !== undefined
? listingItemHref(imageRaw, dirname(projectRelativePath))
? pathWithForwardSlashes(
listingItemHref(imageRaw, dirname(projectRelativePath)),
)
: undefined;

const imageAlt = documentMeta?.[kImageAlt] as string | undefined;
Expand Down

0 comments on commit 1fc676d

Please sign in to comment.