From bcde2abcb20ad02a0c3f1430b9d620ee60e6cb63 Mon Sep 17 00:00:00 2001
From: dralagen <dralagen@dralagen.fr>
Date: Wed, 19 Mar 2025 04:47:35 +0000
Subject: [PATCH] fix(transformer): find last modified date form commit on submodule (#1831)
---
quartz/util/path.ts | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/quartz/util/path.ts b/quartz/util/path.ts
index 8f85029..0681fae 100644
--- a/quartz/util/path.ts
+++ b/quartz/util/path.ts
@@ -36,7 +36,7 @@
export function isRelativeURL(s: string): s is RelativeURL {
const validStart = /^\.{1,2}/.test(s)
const validEnding = !endsWith(s, "index")
- return validStart && validEnding && ![".md", ".html"].includes(_getFileExtension(s) ?? "")
+ return validStart && validEnding && ![".md", ".html"].includes(getFileExtension(s) ?? "")
}
export function getFullSlug(window: Window): FullSlug {
@@ -61,7 +61,7 @@
export function slugifyFilePath(fp: FilePath, excludeExt?: boolean): FullSlug {
fp = stripSlashes(fp) as FilePath
- let ext = _getFileExtension(fp)
+ let ext = getFileExtension(fp)
const withoutFileExt = fp.replace(new RegExp(ext + "$"), "")
if (excludeExt || [".md", ".html", undefined].includes(ext)) {
ext = ""
@@ -247,7 +247,7 @@
}
// path helpers
-function isFolderPath(fplike: string): boolean {
+export function isFolderPath(fplike: string): boolean {
return (
fplike.endsWith("/") ||
endsWith(fplike, "index") ||
@@ -260,7 +260,7 @@
return s === suffix || s.endsWith("/" + suffix)
}
-function trimSuffix(s: string, suffix: string): string {
+export function trimSuffix(s: string, suffix: string): string {
if (endsWith(s, suffix)) {
s = s.slice(0, -suffix.length)
}
@@ -272,10 +272,10 @@
}
function _hasFileExtension(s: string): boolean {
- return _getFileExtension(s) !== undefined
+ return getFileExtension(s) !== undefined
}
-function _getFileExtension(s: string): string | undefined {
+export function getFileExtension(s: string): string | undefined {
return s.match(/\.[A-Za-z0-9]+$/)?.[0]
}
--
Gitblit v1.10.0