mirror of
https://github.com/fmhy/edit.git
synced 2025-07-31 00:02:17 +10:00
feat: build env options, formatting, selfhosting guide
This commit is contained in:
parent
88a1a989d9
commit
929bd44275
39 changed files with 268 additions and 764 deletions
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) taskylizard. All rights reserved.
|
||||
* Copyright (c) 2025 taskylizard. Apache License 2.0.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) taskylizard. All rights reserved.
|
||||
* Copyright (c) 2025 taskylizard. Apache License 2.0.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -21,6 +21,7 @@ export function generateMeta(context: TransformContext, hostname: string) {
|
|||
const { pageData } = context
|
||||
|
||||
if (pageData.isNotFound) return head
|
||||
if (Object.keys(pageData.frontmatter).length === 0) return head
|
||||
|
||||
const url = `${hostname}/${pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2')}`
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) taskylizard. All rights reserved.
|
||||
* Copyright (c) 2025 taskylizard. Apache License 2.0.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -88,14 +88,14 @@ async function generateImage({
|
|||
const _page = getPage(url)
|
||||
const title =
|
||||
frontmatter.layout === 'home'
|
||||
? frontmatter.hero.name ?? frontmatter.title
|
||||
? (frontmatter.hero.name ?? frontmatter.title)
|
||||
: frontmatter.title
|
||||
? frontmatter.title
|
||||
: _page?.title
|
||||
|
||||
const description =
|
||||
frontmatter.layout === 'home'
|
||||
? frontmatter.hero.tagline ?? frontmatter.description
|
||||
? (frontmatter.hero.tagline ?? frontmatter.description)
|
||||
: frontmatter.description
|
||||
? frontmatter.description
|
||||
: _page?.description
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) taskylizard. All rights reserved.
|
||||
* Copyright (c) 2025 taskylizard. Apache License 2.0.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -22,7 +22,7 @@ import { Feed } from 'feed'
|
|||
import { createContentLoader } from 'vitepress'
|
||||
import { meta } from '../constants'
|
||||
|
||||
export async function generateFeed(config: SiteConfig): Promise {
|
||||
export async function generateFeed(config: SiteConfig): Promise<void> {
|
||||
const feed: Feed = new Feed({
|
||||
id: meta.hostname,
|
||||
link: meta.hostname,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) taskylizard. All rights reserved.
|
||||
* Copyright (c) 2025 taskylizard. Apache License 2.0.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue