_shortcode_.astro.mjs 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. globalThis.process ??= {}; globalThis.process.env ??= {};
  2. import { e as createComponent, f as createAstro, l as renderHead, r as renderTemplate } from '../chunks/astro/server_WO3f6Mge.mjs';
  3. import { r as resolveShortLink } from '../chunks/shortlink_FrzJzDij.mjs';
  4. export { r as renderers } from '../chunks/_@astro-renderers_DpxbEuk7.mjs';
  5. const $$Astro = createAstro();
  6. const $$shortcode = createComponent(async ($$result, $$props, $$slots) => {
  7. const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  8. Astro2.self = $$shortcode;
  9. const { shortcode } = Astro2.params;
  10. if (!shortcode) {
  11. return Astro2.redirect("/app");
  12. }
  13. const fullUrl = await resolveShortLink(shortcode);
  14. if (fullUrl) {
  15. return Astro2.redirect(fullUrl);
  16. }
  17. return renderTemplate`<html> <head><title>Link Not Found</title>${renderHead()}</head> <body> <h1>Link not found</h1> <p>This shortcode does not exist.</p> <a href="/app">Go to Dashboard Builder</a> </body></html>`;
  18. }, "/home/fc/Projects/glance/src/pages/[shortcode].astro", void 0);
  19. const $$file = "/home/fc/Projects/glance/src/pages/[shortcode].astro";
  20. const $$url = "/[shortcode]";
  21. const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
  22. __proto__: null,
  23. default: $$shortcode,
  24. file: $$file,
  25. url: $$url
  26. }, Symbol.toStringTag, { value: 'Module' }));
  27. const page = () => _page;
  28. export { page };