chore: formatting and housekeeping

This commit is contained in:
taskylizard 2024-08-28 11:37:06 +00:00
parent 9d6f121ba9
commit 934ebcf65a
No known key found for this signature in database
GPG key ID: 1820131ED1A24120
36 changed files with 272 additions and 499 deletions

View file

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { HeadConfig, TransformContext } from 'vitepress'
export function generateMeta(context: TransformContext, hostname: string) {

View file

@ -13,14 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { ContentData, SiteConfig } from 'vitepress'
import type { SatoriOptions } from 'x-satori/vue'
import { mkdir, readFile, writeFile } from 'node:fs/promises'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { createContentLoader } from 'vitepress'
import type { ContentData, SiteConfig } from 'vitepress'
import { type SatoriOptions, satoriVue } from 'x-satori/vue'
import { renderAsync } from '@resvg/resvg-js'
import consola from 'consola'
import { createContentLoader } from 'vitepress'
import { satoriVue } from 'x-satori/vue'
import { headers } from '../transformer/constants'
const __dirname = dirname(fileURLToPath(import.meta.url))
@ -86,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

View file

@ -13,15 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import path from 'node:path'
import type { ContentData, SiteConfig } from 'vitepress'
import { writeFileSync } from 'node:fs'
import { Feed } from 'feed'
import {
createContentLoader,
type ContentData,
type SiteConfig
} from 'vitepress'
import path from 'node:path'
import consola from 'consola'
import { Feed } from 'feed'
import { createContentLoader } from 'vitepress'
import { meta } from '../constants'
export async function generateFeed(config: SiteConfig): Promise {

View file

@ -13,10 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { SatoriOptions } from 'x-satori/vue'
import { readFile } from 'node:fs/promises'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import type { SatoriOptions } from 'x-satori/vue'
import { defineSatoriConfig } from 'x-satori/vue'
const __dirname = dirname(fileURLToPath(import.meta.url))