From a46eebfb87b5f7a4900b5e0205f3139e59307afc Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 29 Jul 2022 18:06:56 +0800 Subject: [PATCH] feat: add thymeleaf assets processor Signed-off-by: Ryan Wang --- .idea/.gitignore | 8 ++ .idea/checkstyle-idea.xml | 15 +++ .idea/default.iml | 9 ++ .idea/jsLibraryMappings.xml | 6 + .idea/misc.xml | 6 + .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 + astro.config.mjs | 63 +++++++++- package.json | 5 +- pnpm-lock.yaml | 117 ++++++++++++++++++ src/layouts/Layout.astro | 1 - src/pages/post.astro | 4 + ...7f6.dbc606a6.css => 4669d51c.dbc606a6.css} | 0 .../PostCard.42ac9187.js} | 2 +- ...e77.eb1eaf30.css => c3308dde.eb1eaf30.css} | 0 .../runtime-core.esm-bundler.e59bb94c.js} | 0 .../client.e67fc49c.js} | 2 +- templates/index.html | 22 ++-- templates/post.html | 14 +-- tsconfig.json | 7 +- 20 files changed, 265 insertions(+), 30 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/checkstyle-idea.xml create mode 100644 .idea/default.iml create mode 100644 .idea/jsLibraryMappings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml rename templates/assets/{81b427f6.dbc606a6.css => 4669d51c.dbc606a6.css} (100%) rename templates/{PostCard.66b292e1.js => assets/PostCard.42ac9187.js} (99%) rename templates/assets/{04b34e77.eb1eaf30.css => c3308dde.eb1eaf30.css} (100%) rename templates/{chunks/runtime-core.esm-bundler.2d90c110.js => assets/chunks/runtime-core.esm-bundler.e59bb94c.js} (100%) rename templates/{client.6e2af5c0.js => assets/client.e67fc49c.js} (98%) diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..23198ed --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,15 @@ + + + + 10.3.1 + JavaOnly + + + \ No newline at end of file diff --git a/.idea/default.iml b/.idea/default.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/default.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..cc3da93 --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..967c154 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/astro.config.mjs b/astro.config.mjs index ccc438e..6ee1eb7 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,17 +1,74 @@ import { defineConfig } from "astro/config"; import vue from "@astrojs/vue"; - import tailwind from "@astrojs/tailwind"; +import fs from "fs"; +import { load } from "cheerio"; + +function thymeleafAssetsProcessor() { + return { + name: "thymeleaf-assets-processor", + hooks: { + "astro:build:done": async ({ dir, routes, pages }) => { + const pageRoutes = routes.filter((route) => route.type === "page"); + + for (let i = 0; i < pageRoutes.length; i++) { + const route = pageRoutes[i]; + + const pathname = route.distURL?.pathname; + + const inputHTML = await fs.promises.readFile(pathname, { + encoding: "utf-8", + }); + + const $ = load(inputHTML); + + $("link").each((_, el) => { + const href = $(el).attr("href"); + + if (href.startsWith("/assets")) { + $(el).attr("th:href", `@{${href}}`); + } + }); + + $("astro-island").each((_, el) => { + const componentUrl = $(el).attr("component-url"); + const rendererUrl = $(el).attr("renderer-url"); + + if (componentUrl && componentUrl.startsWith("/assets")) { + $(el).attr("th:component-url", `@{${componentUrl}}`); + } + + if (rendererUrl && rendererUrl.startsWith("/assets")) { + $(el).attr("th:renderer-url", `@{${rendererUrl}}`); + } + }); + + await fs.promises.writeFile(pathname, $.html()); + } + }, + }, + }; +} // https://astro.build/config export default defineConfig({ - integrations: [vue(), tailwind()], + integrations: [vue(), tailwind(), thymeleafAssetsProcessor()], outDir: "./templates", - output: "static", build: { format: "file", }, server: { port: 4000, }, + vite: { + build: { + rollupOptions: { + output: { + entryFileNames: "assets/[name].[hash].js", + chunkFileNames: "assets/chunks/[name].[hash].js", + assetFileNames: "assets/[name].[hash][extname]", + }, + }, + }, + }, }); diff --git a/package.json b/package.json index 5044877..615f8cc 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,13 @@ "devDependencies": { "@astrojs/tailwind": "^0.2.5", "@astrojs/vue": "^0.5.0", + "@types/node": "16", "astro": "^1.0.0-rc.2", + "cheerio": "1.0.0-rc.12", "vue": "^3.2.37" }, "dependencies": { - "@headlessui/vue": "^1.6.7" + "@headlessui/vue": "^1.6.7", + "dayjs": "^1.11.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0815cee..3e6d013 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,16 +4,22 @@ specifiers: '@astrojs/tailwind': ^0.2.5 '@astrojs/vue': ^0.5.0 '@headlessui/vue': ^1.6.7 + '@types/node': '16' astro: ^1.0.0-rc.2 + cheerio: 1.0.0-rc.12 + dayjs: ^1.11.4 vue: ^3.2.37 dependencies: '@headlessui/vue': 1.6.7_vue@3.2.37 + dayjs: 1.11.4 devDependencies: '@astrojs/tailwind': 0.2.5 '@astrojs/vue': 0.5.0_vue@3.2.37 + '@types/node': 16.11.46 astro: 1.0.0-rc.2 + cheerio: 1.0.0-rc.12 vue: 3.2.37 packages: @@ -531,6 +537,10 @@ packages: '@types/unist': 2.0.6 dev: true + /@types/node/16.11.46: + resolution: {integrity: sha512-x+sfpb2dMrhCQPL4NAGs64Z9hh0t72aP0dg+PuZidmPr/0Gj5ELQTjD/t46dq3DF/8ZvSHOaIyDIbAsdPshyVQ==} + dev: true + /@types/parse5/6.0.3: resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} dev: true @@ -860,6 +870,10 @@ packages: readable-stream: 3.6.0 dev: true + /boolbase/1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + dev: true + /boxen/6.2.1: resolution: {integrity: sha512-H4PEsJXfFI/Pt8sjDWbHlQPx4zL/bvSQjcilJmaulGt5mLDorHOHpmdXAJcBcmru7PhYSp/cDMWRko4ZUMFkSw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -962,6 +976,30 @@ packages: resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} dev: true + /cheerio-select/2.1.0: + resolution: {integrity: sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==} + dependencies: + boolbase: 1.0.0 + css-select: 5.1.0 + css-what: 6.1.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.0.1 + dev: true + + /cheerio/1.0.0-rc.12: + resolution: {integrity: sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==} + engines: {node: '>= 6'} + dependencies: + cheerio-select: 2.1.0 + dom-serializer: 2.0.0 + domhandler: 5.0.3 + domutils: 3.0.1 + htmlparser2: 8.0.1 + parse5: 7.0.0 + parse5-htmlparser2-tree-adapter: 7.0.0 + dev: true + /chokidar/3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} @@ -1047,6 +1085,21 @@ packages: which: 2.0.2 dev: true + /css-select/5.1.0: + resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} + dependencies: + boolbase: 1.0.0 + css-what: 6.1.0 + domhandler: 5.0.3 + domutils: 3.0.1 + nth-check: 2.1.1 + dev: true + + /css-what/6.1.0: + resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} + engines: {node: '>= 6'} + dev: true + /cssesc/3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} @@ -1061,6 +1114,10 @@ packages: engines: {node: '>= 12'} dev: true + /dayjs/1.11.4: + resolution: {integrity: sha512-Zj/lPM5hOvQ1Bf7uAvewDaUcsJoI6JmNqmHhHl3nyumwe0XHwt8sWdOVAPACJzCebL8gQCi+K49w7iKWnGwX9g==} + dev: false + /debug/4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -1130,6 +1187,33 @@ packages: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} dev: true + /dom-serializer/2.0.0: + resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + entities: 4.3.1 + dev: true + + /domelementtype/2.3.0: + resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} + dev: true + + /domhandler/5.0.3: + resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} + engines: {node: '>= 4'} + dependencies: + domelementtype: 2.3.0 + dev: true + + /domutils/3.0.1: + resolution: {integrity: sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==} + dependencies: + dom-serializer: 2.0.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + dev: true + /dset/3.1.2: resolution: {integrity: sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==} engines: {node: '>=4'} @@ -1158,6 +1242,11 @@ packages: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} dev: true + /entities/4.3.1: + resolution: {integrity: sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==} + engines: {node: '>=0.12'} + dev: true + /eol/0.9.1: resolution: {integrity: sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==} dev: true @@ -1793,6 +1882,15 @@ packages: resolution: {integrity: sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==} dev: true + /htmlparser2/8.0.1: + resolution: {integrity: sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==} + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.0.1 + entities: 4.3.1 + dev: true + /human-signals/3.0.1: resolution: {integrity: sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==} engines: {node: '>=12.20.0'} @@ -2684,6 +2782,12 @@ packages: path-key: 4.0.0 dev: true + /nth-check/2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + dependencies: + boolbase: 1.0.0 + dev: true + /object-hash/3.0.0: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} @@ -2799,10 +2903,23 @@ packages: unist-util-visit-children: 1.1.4 dev: true + /parse5-htmlparser2-tree-adapter/7.0.0: + resolution: {integrity: sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==} + dependencies: + domhandler: 5.0.3 + parse5: 7.0.0 + dev: true + /parse5/6.0.1: resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} dev: true + /parse5/7.0.0: + resolution: {integrity: sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==} + dependencies: + entities: 4.3.1 + dev: true + /path-browserify/1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} dev: true diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 09faf53..807cdfa 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -12,7 +12,6 @@ const { title } = Astro.props as Props; - {title} diff --git a/src/pages/post.astro b/src/pages/post.astro index 66a8dff..b598e54 100644 --- a/src/pages/post.astro +++ b/src/pages/post.astro @@ -1,9 +1,13 @@ --- import Layout from "../layouts/Layout.astro"; import PostCard from "../components/PostCard.vue" +import dayjs from 'dayjs' + +const now = dayjs() --- +
diff --git a/templates/assets/81b427f6.dbc606a6.css b/templates/assets/4669d51c.dbc606a6.css similarity index 100% rename from templates/assets/81b427f6.dbc606a6.css rename to templates/assets/4669d51c.dbc606a6.css diff --git a/templates/PostCard.66b292e1.js b/templates/assets/PostCard.42ac9187.js similarity index 99% rename from templates/PostCard.66b292e1.js rename to templates/assets/PostCard.42ac9187.js index 0a2498d..ad1d32c 100644 --- a/templates/PostCard.66b292e1.js +++ b/templates/assets/PostCard.42ac9187.js @@ -1,4 +1,4 @@ -import{c as se,h as P,F as ue,i as x,p as O,d as R,r as b,a as F,o as _,b as V,w as j,e as de,f as fe,g as m,j as ce,k as pe,l as ve}from"./chunks/runtime-core.esm-bundler.2d90c110.js";function w(e,t,...r){if(e in t){let a=t[e];return typeof a=="function"?a(...r):a}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,w),n}var I=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(I||{}),h=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(h||{});function Q({visible:e=!0,features:t=0,ourProps:r,theirProps:n,...a}){var l;let o=he(n,r),s=Object.assign(a,{props:o});if(e||t&2&&o.static)return A(s);if(t&1){let i=(l=o.unmount)==null||l?0:1;return w(i,{[0](){return null},[1](){return A({...a,props:{...o,hidden:!0,style:{display:"none"}}})}})}return A(s)}function A({props:e,attrs:t,slots:r,slot:n,name:a}){var l;let{as:o,...s}=z(e,["unmount","static"]),i=(l=r.default)==null?void 0:l.call(r,n),u={};if(o==="template"){if(i=W(i),Object.keys(s).length>0||Object.keys(t).length>0){let[d,...f]=i??[];if(!me(d)||f.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${a} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(s).concat(Object.keys(t)).sort((c,p)=>c.localeCompare(p)).map(c=>` - ${c}`).join(` +import{c as se,h as P,F as ue,i as x,p as O,d as R,r as b,a as F,o as _,b as V,w as j,e as de,f as fe,g as m,j as ce,k as pe,l as ve}from"./chunks/runtime-core.esm-bundler.e59bb94c.js";function w(e,t,...r){if(e in t){let a=t[e];return typeof a=="function"?a(...r):a}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,w),n}var I=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(I||{}),h=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(h||{});function Q({visible:e=!0,features:t=0,ourProps:r,theirProps:n,...a}){var l;let o=he(n,r),s=Object.assign(a,{props:o});if(e||t&2&&o.static)return A(s);if(t&1){let i=(l=o.unmount)==null||l?0:1;return w(i,{[0](){return null},[1](){return A({...a,props:{...o,hidden:!0,style:{display:"none"}}})}})}return A(s)}function A({props:e,attrs:t,slots:r,slot:n,name:a}){var l;let{as:o,...s}=z(e,["unmount","static"]),i=(l=r.default)==null?void 0:l.call(r,n),u={};if(o==="template"){if(i=W(i),Object.keys(s).length>0||Object.keys(t).length>0){let[d,...f]=i??[];if(!me(d)||f.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${a} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(s).concat(Object.keys(t)).sort((c,p)=>c.localeCompare(p)).map(c=>` - ${c}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(c=>` - ${c}`).join(` `)].join(` `));return se(d,Object.assign({},s,u))}return Array.isArray(i)&&i.length===1?i[0]:i}return P(o,Object.assign({},s,u),i)}function W(e){return e.flatMap(t=>t.type===ue?W(t.children):[t])}function he(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let a in n)a.startsWith("on")&&typeof n[a]=="function"?(r[a]!=null||(r[a]=[]),r[a].push(n[a])):t[a]=n[a];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](a,...l){let o=r[n];for(let s of o){if(a!=null&&a.defaultPrevented)return;s(a,...l)}}});return t}function z(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function me(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}let ge=0;function ye(){return++ge}function be(){return ye()}function U(e){var t;return e==null||e.value==null?null:(t=e.value.$el)!=null?t:e.value}let G=Symbol("Context");var S=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(S||{});function we(){return J()!==null}function J(){return x(G,null)}function _e(e){O(G,e)}function Se(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function K(){let e=[],t=[],r={enqueue(n){t.push(n)},requestAnimationFrame(...n){let a=requestAnimationFrame(...n);r.add(()=>cancelAnimationFrame(a))},nextFrame(...n){r.requestAnimationFrame(()=>{r.requestAnimationFrame(...n)})},setTimeout(...n){let a=setTimeout(...n);r.add(()=>clearTimeout(a))},add(n){e.push(n)},dispose(){for(let n of e.splice(0))n()},async workQueue(){for(let n of t.splice(0))await n()}};return r}function B(e,...t){e&&t.length>0&&e.classList.add(...t)}function C(e,...t){e&&t.length>0&&e.classList.remove(...t)}var H=(e=>(e.Finished="finished",e.Cancelled="cancelled",e))(H||{});function Te(e,t){let r=K();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:a}=getComputedStyle(e),[l,o]=[n,a].map(s=>{let[i=0]=s.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,d)=>d-u);return i});return l!==0?r.setTimeout(()=>t("finished"),l+o):t("finished"),r.add(()=>t("cancelled")),r.dispose}function D(e,t,r,n,a,l){let o=K(),s=l!==void 0?Se(l):()=>{};return C(e,...a),B(e,...t,...r),o.nextFrame(()=>{C(e,...r),B(e,...n),o.add(Te(e,i=>(C(e,...n,...t),B(e,...a),s(i))))}),o.add(()=>C(e,...t,...r,...n,...a)),o.add(()=>s("cancelled")),o.dispose}function y(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let $=Symbol("TransitionContext");var Ee=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ee||{});function Ce(){return x($,null)!==null}function Oe(){let e=x($,null);if(e===null)throw new Error("A is used but it is missing a parent .");return e}function Fe(){let e=x(N,null);if(e===null)throw new Error("A is used but it is missing a parent .");return e}let N=Symbol("NestingContext");function L(e){return"children"in e?L(e.children):e.value.filter(({state:t})=>t==="visible").length>0}function Y(e){let t=b([]),r=b(!1);_(()=>r.value=!0),V(()=>r.value=!1);function n(l,o=h.Hidden){let s=t.value.findIndex(({id:i})=>i===l);s!==-1&&(w(o,{[h.Unmount](){t.value.splice(s,1)},[h.Hidden](){t.value[s].state="hidden"}}),!L(t)&&r.value&&e?.())}function a(l){let o=t.value.find(({id:s})=>s===l);return o?o.state!=="visible"&&(o.state="visible"):t.value.push({id:l,state:"visible"}),()=>n(l,h.Unmount)}return{children:t,register:a,unregister:n}}let X=I.RenderStrategy,je=R({props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(e,{emit:t,attrs:r,slots:n,expose:a}){if(!Ce()&&we())return()=>P(Z,{...e,onBeforeEnter:()=>t("beforeEnter"),onAfterEnter:()=>t("afterEnter"),onBeforeLeave:()=>t("beforeLeave"),onAfterLeave:()=>t("afterLeave")},n);let l=b(null),o=b("visible"),s=F(()=>e.unmount?h.Unmount:h.Hidden);a({el:l,$el:l});let{show:i,appear:u}=Oe(),{register:d,unregister:f}=Fe(),c={value:!0},p=be(),T={value:!1},M=Y(()=>{T.value||(o.value="hidden",f(p),t("afterLeave"))});_(()=>{let v=d(p);V(v)}),j(()=>{if(s.value===h.Hidden&&!!p){if(i&&o.value!=="visible"){o.value="visible";return}w(o.value,{hidden:()=>f(p),visible:()=>d(p)})}});let ee=y(e.enter),te=y(e.enterFrom),ne=y(e.enterTo),q=y(e.entered),re=y(e.leave),ae=y(e.leaveFrom),oe=y(e.leaveTo);_(()=>{j(()=>{if(o.value==="visible"){let v=U(l);if(v instanceof Comment&&v.data==="")throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}})});function le(v){let k=c.value&&!u.value,g=U(l);!g||!(g instanceof HTMLElement)||k||(T.value=!0,i.value&&t("beforeEnter"),i.value||t("beforeLeave"),v(i.value?D(g,ee,te,ne,q,E=>{T.value=!1,E===H.Finished&&t("afterEnter")}):D(g,re,ae,oe,q,E=>{T.value=!1,E===H.Finished&&(L(M)||(o.value="hidden",f(p),t("afterLeave")))})))}return _(()=>{de([i],(v,k,g)=>{le(g),c.value=!1},{immediate:!0})}),O(N,M),_e(F(()=>w(o.value,{visible:S.Open,hidden:S.Closed}))),()=>{let{appear:v,show:k,enter:g,enterFrom:E,enterTo:Ue,entered:De,leave:Ve,leaveFrom:Ie,leaveTo:Qe,...ie}=e;return Q({theirProps:ie,ourProps:{ref:l},slot:{},slots:n,attrs:r,features:X,visible:o.value==="visible",name:"TransitionChild"})}}}),xe=je,Z=R({inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(e,{emit:t,attrs:r,slots:n}){let a=J(),l=F(()=>e.show===null&&a!==null?w(a.value,{[S.Open]:!0,[S.Closed]:!1}):e.show);j(()=>{if(![!0,!1].includes(l.value))throw new Error('A is used but it is missing a `:show="true | false"` prop.')});let o=b(l.value?"visible":"hidden"),s=Y(()=>{o.value="hidden"}),i=b(!0),u={show:l,appear:F(()=>e.appear||!i.value)};return _(()=>{j(()=>{i.value=!1,l.value?o.value="visible":L(s)||(o.value="hidden")})}),O(N,s),O($,u),()=>{let d=z(e,["show","appear","unmount","onBeforeEnter","onBeforeLeave","onAfterEnter","onAfterLeave"]),f={unmount:e.unmount};return Q({ourProps:{...f,as:"template"},theirProps:{},slot:{},slots:{...n,default:()=>[P(xe,{onBeforeEnter:()=>t("beforeEnter"),onAfterEnter:()=>t("afterEnter"),onBeforeLeave:()=>t("beforeLeave"),onAfterLeave:()=>t("afterLeave"),...r,...f,...d},n.default)]},attrs:{},features:X,visible:o.value==="visible",name:"Transition"})}}});const Le=(e,t)=>{const r=e.__vccOpts||e;for(const[n,a]of t)r[n]=a;return r},ke=R({__name:"PostCard",setup(e,{expose:t}){t();const r=b(!0);function n(){r.value=!1,setTimeout(()=>{r.value=!0},500)}const a={isShowing:r,resetIsShowing:n,TransitionRoot:Z};return Object.defineProperty(a,"__isScriptSetup",{enumerable:!1,value:!0}),a}}),Ae={class:"p-4"},Be=m("span",{class:"font-bold text-xl","th:text":"@{post.title}"},"Hello Halo",-1),He={class:"flex flex-col items-center py-16"},Pe={class:"h-32 w-32"},Re=m("div",{class:"h-full w-full rounded-md bg-white shadow-lg"},null,-1),$e=m("svg",{viewBox:"0 0 20 20",fill:"none",class:"h-5 w-5 opacity-70"},[m("path",{d:"M14.9497 14.9498C12.2161 17.6835 7.78392 17.6835 5.05025 14.9498C2.31658 12.2162 2.31658 7.784 5.05025 5.05033C7.78392 2.31666 12.2161 2.31666 14.9497 5.05033C15.5333 5.63385 15.9922 6.29475 16.3266 7M16.9497 2L17 7H16.3266M12 7L16.3266 7",stroke:"currentColor","stroke-width":"1.5"})],-1),Ne=m("span",{class:"ml-3"},"Click to transition",-1),Me=[$e,Ne];function qe(e,t,r,n,a,l){return ve(),fe("div",Ae,[Be,m("div",He,[m("div",Pe,[ce(n.TransitionRoot,{appear:"",show:n.isShowing,as:"template",enter:"transform transition duration-[400ms]","enter-from":"opacity-0 rotate-[-120deg] scale-50","enter-to":"opacity-100 rotate-0 scale-100",leave:"transform duration-200 transition ease-in-out","leave-from":"opacity-100 rotate-0 scale-100 ","leave-to":"opacity-0 scale-95 "},{default:pe(()=>[Re]),_:1},8,["show"])]),m("button",{onClick:n.resetIsShowing,class:"mt-8 flex transform items-center rounded-full bg-black bg-opacity-20 px-3 py-2 text-sm font-medium text-white transition hover:scale-105 hover:bg-opacity-30 focus:outline-none active:bg-opacity-40"},Me)])])}const ze=Le(ke,[["render",qe]]);export{ze as default}; diff --git a/templates/assets/04b34e77.eb1eaf30.css b/templates/assets/c3308dde.eb1eaf30.css similarity index 100% rename from templates/assets/04b34e77.eb1eaf30.css rename to templates/assets/c3308dde.eb1eaf30.css diff --git a/templates/chunks/runtime-core.esm-bundler.2d90c110.js b/templates/assets/chunks/runtime-core.esm-bundler.e59bb94c.js similarity index 100% rename from templates/chunks/runtime-core.esm-bundler.2d90c110.js rename to templates/assets/chunks/runtime-core.esm-bundler.e59bb94c.js diff --git a/templates/client.6e2af5c0.js b/templates/assets/client.e67fc49c.js similarity index 98% rename from templates/client.6e2af5c0.js rename to templates/assets/client.e67fc49c.js index 038a043..50227b8 100644 --- a/templates/client.6e2af5c0.js +++ b/templates/assets/client.e67fc49c.js @@ -1 +1 @@ -import{m as v,n as p,q as x,s as M,t as O,u as I,v as B,x as T,y as w,z,A as D,B as q,C as _,D as W,d as $,h as u}from"./chunks/runtime-core.esm-bundler.2d90c110.js";const j="http://www.w3.org/2000/svg",a=typeof document<"u"?document:null,g=a&&a.createElement("template"),F={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r=t?a.createElementNS(j,e):a.createElement(e,n?{is:n}:void 0);return e==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:e=>a.createTextNode(e),createComment:e=>a.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>a.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,i,r,s){const c=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{g.innerHTML=i?`${e}`:e;const o=g.content;if(i){const f=o.firstChild;for(;f.firstChild;)o.appendChild(f.firstChild);o.removeChild(f)}t.insertBefore(o,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function U(e,t,n){const i=e._vtc;i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function X(e,t,n){const i=e.style,r=p(n);if(n&&!r){for(const s in n)m(i,s,n[s]);if(t&&!p(t))for(const s in t)n[s]==null&&m(i,s,"")}else{const s=i.display;r?t!==n&&(i.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(i.display=s)}}const S=/\s*!important$/;function m(e,t,n){if(T(n))n.forEach(i=>m(e,t,i));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=G(e,t);S.test(n)?e.setProperty(w(i),n.replace(S,""),"important"):e[i]=n}}const b=["Webkit","Moz","ms"],d={};function G(e,t){const n=d[t];if(n)return n;let i=z(t);if(i!=="filter"&&i in e)return d[t]=i;i=D(i);for(let r=0;r{let e=Date.now,t=!1;if(typeof window<"u"){Date.now()>document.createEvent("Event").timeStamp&&(e=performance.now.bind(performance));const n=navigator.userAgent.match(/firefox\/(\d+)/i);t=!!(n&&Number(n[1])<=53)}return[e,t]})();let h=0;const Y=Promise.resolve(),Z=()=>{h=0},V=()=>h||(Y.then(Z),h=P());function y(e,t,n,i){e.addEventListener(t,n,i)}function k(e,t,n,i){e.removeEventListener(t,n,i)}function tt(e,t,n,i,r=null){const s=e._vei||(e._vei={}),c=s[t];if(i&&c)c.value=i;else{const[o,f]=et(t);if(i){const R=s[t]=nt(i,r);y(e,o,R,f)}else c&&(k(e,o,c,f),s[t]=void 0)}}const E=/(?:Once|Passive|Capture)$/;function et(e){let t;if(E.test(e)){t={};let n;for(;n=e.match(E);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[w(e.slice(2)),t]}function nt(e,t){const n=i=>{const r=i.timeStamp||P();(Q||r>=n.attached-1)&&W(it(i,n.value),t,5,[i])};return n.value=e,n.attached=V(),n}function it(e,t){if(T(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(i=>r=>!r._stopped&&i&&i(r))}else return t}const C=/^on[a-z]/,rt=(e,t,n,i,r=!1,s,c,o,f)=>{t==="class"?U(e,i,r):t==="style"?X(e,n,i):I(t)?B(t)||tt(e,t,n,i,c):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):st(e,t,i,r))?K(e,t,i,s,c,o,f):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),J(e,t,i,r))};function st(e,t,n,i){return i?!!(t==="innerHTML"||t==="textContent"||t in e&&C.test(t)&&v(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||C.test(t)&&p(n)?!1:t in e}const H=O({patchProp:rt},F);let l,N=!1;function ot(){return l||(l=x(H))}function ct(){return l=N?l:M(H),N=!0,l}const ft=(...e)=>{const t=ot().createApp(...e),{mount:n}=t;return t.mount=i=>{const r=L(i);if(!r)return;const s=t._component;!v(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.innerHTML="";const c=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),c},t},at=(...e)=>{const t=ct().createApp(...e),{mount:n}=t;return t.mount=i=>{const r=L(i);if(r)return n(r,!0,r instanceof SVGElement)},t};function L(e){return p(e)?document.querySelector(e):e}const lt=$({props:{value:String,name:String},setup({name:e,value:t}){return t?()=>u("astro-slot",{name:e,innerHTML:t}):()=>null}}),pt=e=>(t,n,i,{client:r})=>{if(delete n.class,!e.hasAttribute("ssr"))return;const s=t.name?`${t.name} Host`:void 0,c={};for(const[o,f]of Object.entries(i))c[o]=()=>u(lt,{value:f,name:o==="default"?void 0:o});r==="only"?ft({name:s,render:()=>u(t,n,c)}).mount(e,!1):at({name:s,render:()=>u(t,n,c)}).mount(e,!0)};export{pt as default}; +import{m as v,n as p,q as x,s as M,t as O,u as I,v as B,x as T,y as w,z,A as D,B as q,C as _,D as W,d as $,h as u}from"./chunks/runtime-core.esm-bundler.e59bb94c.js";const j="http://www.w3.org/2000/svg",a=typeof document<"u"?document:null,g=a&&a.createElement("template"),F={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r=t?a.createElementNS(j,e):a.createElement(e,n?{is:n}:void 0);return e==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:e=>a.createTextNode(e),createComment:e=>a.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>a.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,i,r,s){const c=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{g.innerHTML=i?`${e}`:e;const o=g.content;if(i){const f=o.firstChild;for(;f.firstChild;)o.appendChild(f.firstChild);o.removeChild(f)}t.insertBefore(o,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function U(e,t,n){const i=e._vtc;i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function X(e,t,n){const i=e.style,r=p(n);if(n&&!r){for(const s in n)m(i,s,n[s]);if(t&&!p(t))for(const s in t)n[s]==null&&m(i,s,"")}else{const s=i.display;r?t!==n&&(i.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(i.display=s)}}const S=/\s*!important$/;function m(e,t,n){if(T(n))n.forEach(i=>m(e,t,i));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=G(e,t);S.test(n)?e.setProperty(w(i),n.replace(S,""),"important"):e[i]=n}}const b=["Webkit","Moz","ms"],d={};function G(e,t){const n=d[t];if(n)return n;let i=z(t);if(i!=="filter"&&i in e)return d[t]=i;i=D(i);for(let r=0;r{let e=Date.now,t=!1;if(typeof window<"u"){Date.now()>document.createEvent("Event").timeStamp&&(e=performance.now.bind(performance));const n=navigator.userAgent.match(/firefox\/(\d+)/i);t=!!(n&&Number(n[1])<=53)}return[e,t]})();let h=0;const Y=Promise.resolve(),Z=()=>{h=0},V=()=>h||(Y.then(Z),h=P());function y(e,t,n,i){e.addEventListener(t,n,i)}function k(e,t,n,i){e.removeEventListener(t,n,i)}function tt(e,t,n,i,r=null){const s=e._vei||(e._vei={}),c=s[t];if(i&&c)c.value=i;else{const[o,f]=et(t);if(i){const R=s[t]=nt(i,r);y(e,o,R,f)}else c&&(k(e,o,c,f),s[t]=void 0)}}const E=/(?:Once|Passive|Capture)$/;function et(e){let t;if(E.test(e)){t={};let n;for(;n=e.match(E);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[w(e.slice(2)),t]}function nt(e,t){const n=i=>{const r=i.timeStamp||P();(Q||r>=n.attached-1)&&W(it(i,n.value),t,5,[i])};return n.value=e,n.attached=V(),n}function it(e,t){if(T(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(i=>r=>!r._stopped&&i&&i(r))}else return t}const C=/^on[a-z]/,rt=(e,t,n,i,r=!1,s,c,o,f)=>{t==="class"?U(e,i,r):t==="style"?X(e,n,i):I(t)?B(t)||tt(e,t,n,i,c):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):st(e,t,i,r))?K(e,t,i,s,c,o,f):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),J(e,t,i,r))};function st(e,t,n,i){return i?!!(t==="innerHTML"||t==="textContent"||t in e&&C.test(t)&&v(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||C.test(t)&&p(n)?!1:t in e}const H=O({patchProp:rt},F);let l,N=!1;function ot(){return l||(l=x(H))}function ct(){return l=N?l:M(H),N=!0,l}const ft=(...e)=>{const t=ot().createApp(...e),{mount:n}=t;return t.mount=i=>{const r=L(i);if(!r)return;const s=t._component;!v(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.innerHTML="";const c=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),c},t},at=(...e)=>{const t=ct().createApp(...e),{mount:n}=t;return t.mount=i=>{const r=L(i);if(r)return n(r,!0,r instanceof SVGElement)},t};function L(e){return p(e)?document.querySelector(e):e}const lt=$({props:{value:String,name:String},setup({name:e,value:t}){return t?()=>u("astro-slot",{name:e,innerHTML:t}):()=>null}}),pt=e=>(t,n,i,{client:r})=>{if(delete n.class,!e.hasAttribute("ssr"))return;const s=t.name?`${t.name} Host`:void 0,c={};for(const[o,f]of Object.entries(i))c[o]=()=>u(lt,{value:f,name:o==="default"?void 0:o});r==="only"?ft({name:s,render:()=>u(t,n,c)}).mount(e,!1):at({name:s,render:()=>u(t,n,c)}).mount(e,!0)};export{pt as default}; diff --git a/templates/index.html b/templates/index.html index 9029e8f..9ef99c1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,15 +1,11 @@ - - - - + - Welcome to Astro. - - + + - +

Welcome to Astro

@@ -21,7 +17,7 @@

Documentation - +

Learn how Astro works and explore the official API docs. @@ -32,7 +28,7 @@

Integrations - +

Supercharge your project with new frameworks and libraries. @@ -43,7 +39,7 @@

Themes - +

Explore a galaxy of community-built starter themes. @@ -54,7 +50,7 @@

Chat - +

Come say hi to our amazing Discord community. ❤️ @@ -62,6 +58,6 @@ -

Hello Halo
+
Hello Halo
\ No newline at end of file diff --git a/templates/post.html b/templates/post.html index 8dd8cce..b267706 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,15 +1,11 @@ - - - - + - Welcome to Post Page. - + - -
-
Hello Halo
+ +
+
Hello Halo
\ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 4db6ee7..c489cd2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,9 @@ { "compilerOptions": { // Enable top-level await, and other modern ESM features. + "lib": [ + "dom" + ], "target": "ESNext", "module": "ESNext", // Enable node-style module resolution, for things like npm package imports. @@ -10,6 +13,8 @@ // Enable stricter transpilation for better output. "isolatedModules": true, // Add type definitions for our Astro runtime. - "types": ["astro/client"] + "types": [ + "astro/client" + ] } }