adding correct domain

This commit is contained in:
Timothy Rogers 2024-07-06 23:58:36 -04:00
parent 4e1e514545
commit 6b38e6edc9

View file

@ -1,38 +1,38 @@
import tailwind from "@astrojs/tailwind" import sitemap from '@astrojs/sitemap'
import Compress from "astro-compress" import svelte from '@astrojs/svelte'
import icon from "astro-icon" import tailwind from '@astrojs/tailwind'
import { defineConfig } from "astro/config" import swup from '@swup/astro'
import Color from "colorjs.io" import Compress from 'astro-compress'
import rehypeAutolinkHeadings from "rehype-autolink-headings" import icon from 'astro-icon'
import rehypeKatex from "rehype-katex" import { defineConfig } from 'astro/config'
import rehypeSlug from "rehype-slug" import Color from 'colorjs.io'
import remarkMath from "remark-math" import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import { remarkReadingTime } from "./src/plugins/remark-reading-time.mjs" import rehypeComponents from 'rehype-components' /* Render the custom directive content */
import { GithubCardComponent } from "./src/plugins/rehype-component-github-card.mjs" import rehypeKatex from 'rehype-katex'
import { AdmonitionComponent } from "./src/plugins/rehype-component-admonition.mjs" import rehypeSlug from 'rehype-slug'
import remarkDirective from "remark-directive" /* Handle directives */ import remarkDirective from 'remark-directive' /* Handle directives */
import remarkGithubAdmonitionsToDirectives from "remark-github-admonitions-to-directives"; import remarkGithubAdmonitionsToDirectives from 'remark-github-admonitions-to-directives'
import rehypeComponents from "rehype-components"; /* Render the custom directive content */ import remarkMath from 'remark-math'
import svelte from "@astrojs/svelte" import { AdmonitionComponent } from './src/plugins/rehype-component-admonition.mjs'
import swup from '@swup/astro'; import { GithubCardComponent } from './src/plugins/rehype-component-github-card.mjs'
import sitemap from '@astrojs/sitemap'; import { parseDirectiveNode } from './src/plugins/remark-directive-rehype.js'
import {parseDirectiveNode} from "./src/plugins/remark-directive-rehype.js"; import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs'
const oklchToHex = (str) => { const oklchToHex = str => {
const DEFAULT_HUE = 250 const DEFAULT_HUE = 250
const regex = /-?\d+(\.\d+)?/g const regex = /-?\d+(\.\d+)?/g
const matches = str.string.match(regex) const matches = str.string.match(regex)
const lch = [matches[0], matches[1], DEFAULT_HUE] const lch = [matches[0], matches[1], DEFAULT_HUE]
return new Color("oklch", lch).to("srgb").toString({ return new Color('oklch', lch).to('srgb').toString({
format: "hex", format: 'hex',
}) })
} }
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: "https://fuwari.vercel.app/", site: 'https://hack13.blog/',
base: "/", base: '/',
trailingSlash: "always", trailingSlash: 'always',
integrations: [ integrations: [
tailwind(), tailwind(),
swup({ swup({
@ -47,10 +47,10 @@ export default defineConfig({
}), }),
icon({ icon({
include: { include: {
"material-symbols": ["*"], 'material-symbols': ['*'],
"fa6-brands": ["*"], 'fa6-brands': ['*'],
"fa6-regular": ["*"], 'fa6-regular': ['*'],
"fa6-solid": ["*"], 'fa6-solid': ['*'],
}, },
}), }),
Compress({ Compress({
@ -60,38 +60,47 @@ export default defineConfig({
sitemap(), sitemap(),
], ],
markdown: { markdown: {
remarkPlugins: [remarkMath, remarkReadingTime, remarkGithubAdmonitionsToDirectives, remarkDirective, parseDirectiveNode], remarkPlugins: [
remarkMath,
remarkReadingTime,
remarkGithubAdmonitionsToDirectives,
remarkDirective,
parseDirectiveNode,
],
rehypePlugins: [ rehypePlugins: [
rehypeKatex, rehypeKatex,
rehypeSlug, rehypeSlug,
[rehypeComponents, { [
components: { rehypeComponents,
github: GithubCardComponent, {
note: (x, y) => AdmonitionComponent(x, y, "note"), components: {
tip: (x, y) => AdmonitionComponent(x, y, "tip"), github: GithubCardComponent,
important: (x, y) => AdmonitionComponent(x, y, "important"), note: (x, y) => AdmonitionComponent(x, y, 'note'),
caution: (x, y) => AdmonitionComponent(x, y, "caution"), tip: (x, y) => AdmonitionComponent(x, y, 'tip'),
warning: (x, y) => AdmonitionComponent(x, y, "warning"), important: (x, y) => AdmonitionComponent(x, y, 'important'),
caution: (x, y) => AdmonitionComponent(x, y, 'caution'),
warning: (x, y) => AdmonitionComponent(x, y, 'warning'),
},
}, },
}], ],
[ [
rehypeAutolinkHeadings, rehypeAutolinkHeadings,
{ {
behavior: "append", behavior: 'append',
properties: { properties: {
className: ["anchor"], className: ['anchor'],
}, },
content: { content: {
type: "element", type: 'element',
tagName: "span", tagName: 'span',
properties: { properties: {
className: ["anchor-icon"], className: ['anchor-icon'],
'data-pagefind-ignore': true, 'data-pagefind-ignore': true,
}, },
children: [ children: [
{ {
type: "text", type: 'text',
value: "#", value: '#',
}, },
], ],
}, },
@ -104,12 +113,15 @@ export default defineConfig({
rollupOptions: { rollupOptions: {
onwarn(warning, warn) { onwarn(warning, warn) {
// temporarily suppress this warning // temporarily suppress this warning
if (warning.message.includes("is dynamically imported by") && warning.message.includes("but also statically imported by")) { if (
return; warning.message.includes('is dynamically imported by') &&
warning.message.includes('but also statically imported by')
) {
return
} }
warn(warning); warn(warning)
} },
} },
}, },
css: { css: {
preprocessorOptions: { preprocessorOptions: {