Compare commits
No commits in common. "30af32532c8683cc78ad3560ef7fc0b21bd3c232" and "455acb3b74c1619151c4334a5be9ccb42f6532e6" have entirely different histories.
30af32532c
...
455acb3b74
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
.DS_Store
|
||||
.gitignore
|
||||
node_modules
|
||||
public
|
||||
prof
|
||||
tsconfig.tsbuildinfo
|
||||
.obsidian
|
||||
.quartz-cache
|
||||
private/
|
||||
.replit
|
||||
replit.nix
|
||||
7
blog-bot.json
Normal file
7
blog-bot.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"syncToken": "s16_124_12_8_23_1_33_29_0_1_1",
|
||||
"filter": null,
|
||||
"appserviceUsers": {},
|
||||
"appserviceTransactions": {},
|
||||
"kvStore": {}
|
||||
}
|
||||
4957
pnpm-lock.yaml
generated
Normal file
4957
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,10 @@
|
||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||
import { classNames } from "../util/lang"
|
||||
import { deslugify } from "../util/path"
|
||||
|
||||
const ArticleTitle: QuartzComponent = ({ fileData, displayClass }: QuartzComponentProps) => {
|
||||
const title = fileData.frontmatter?.title
|
||||
if (title) {
|
||||
return <h1 class={classNames(displayClass, "article-title")}>{title == 'index' ? deslugify(fileData.slug!, 2) : title}</h1>
|
||||
return <h1 class={classNames(displayClass, "article-title")}>{title}</h1>
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { deslugify, FullSlug, isFolderPath, resolveRelative } from "../util/path"
|
||||
import { FullSlug, isFolderPath, resolveRelative } from "../util/path"
|
||||
import { QuartzPluginData } from "../plugins/vfile"
|
||||
import { Date, getDate } from "./Date"
|
||||
import { QuartzComponent, QuartzComponentProps } from "./types"
|
||||
@ -79,7 +79,7 @@ export const PageList: QuartzComponent = ({ cfg, fileData, allFiles, limit, sort
|
||||
<div class="desc">
|
||||
<h3>
|
||||
<a href={resolveRelative(fileData.slug!, page.slug!)} class="internal">
|
||||
{title == "index" ? deslugify(page.slug!) : title}
|
||||
{title}
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@ -4,7 +4,7 @@ import { classNames } from "../util/lang"
|
||||
import { i18n } from "../i18n"
|
||||
|
||||
const PageTitle: QuartzComponent = ({ fileData, cfg, displayClass }: QuartzComponentProps) => {
|
||||
const title = cfg?.pageTitle ?? fileData.slug
|
||||
const title = cfg?.pageTitle ?? i18n(cfg.locale).propertyDefaults.title
|
||||
const baseDir = pathToRoot(fileData.slug!)
|
||||
return (
|
||||
<h2 class={classNames(displayClass, "page-title")}>
|
||||
|
||||
@ -54,7 +54,7 @@ export function getFullSlug(window: Window): FullSlug {
|
||||
return res
|
||||
}
|
||||
|
||||
function sluggify(s: FullSlug): string {
|
||||
function sluggify(s: string): string {
|
||||
return s
|
||||
.split("/")
|
||||
.map((segment) =>
|
||||
@ -69,17 +69,6 @@ function sluggify(s: FullSlug): string {
|
||||
.replace(/\/$/, "")
|
||||
}
|
||||
|
||||
export function deslugify(slug: string, dirs?: number): string {
|
||||
const sliceStart = dirs === undefined ? -2 : -1 - dirs
|
||||
|
||||
return slug
|
||||
.split("/")
|
||||
.slice(sliceStart,-1)
|
||||
.join(": ")
|
||||
.replace(/-and-/g, "&")
|
||||
.replace(/-/g, " ")
|
||||
}
|
||||
|
||||
export function slugifyFilePath(fp: FilePath, excludeExt?: boolean): FullSlug {
|
||||
fp = stripSlashes(fp) as FilePath
|
||||
let ext = getFileExtension(fp)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user