Questions tagged [astro]

Astro is an all-in-one web framework for building fast, content-focused websites. More info can be found here: https://astro.build/

Astro is an all-in-one web framework for building fast, content-focused websites.
More info can be found here: https://astro.build/

252 questions
1
vote
1 answer

Does Astro js fallback to SSR when cache is not available?

In Next js , when the cache is not available , Next js is going to SSR the page and show it (based on the prefered fallback approach true or blocking) . I Wonder what approach does Astro js takes in this scenario .I'm going to create a dynamic blog…
Moein Moeinnia
  • 1,945
  • 3
  • 10
  • 26
1
vote
1 answer

Line highlighting in code blocks doesn't work

I'm migrating from VuePress to Astro. In VuePress, I was able to highlight code lines with syntax like this: ```csharp {1} public override int GetHashCode() { return prop1.GetHashCode() ^ prop2.GetHashCode() } ``` The first line would be…
mnj
  • 2,539
  • 3
  • 29
  • 58
1
vote
2 answers

Simple password protected page in Astro

I am building my own portfolio and I was looking for a way that I could have some of my pages(case studies) locked behind a static password like 1234 and then store that in the browser's cookies. how can I do that with Astro…
Dark star
  • 5,192
  • 9
  • 35
  • 54
1
vote
2 answers

Astro: triggering typescript / javascript in astro from React form in onSubmit

Im experimenting with Astro and trying to create a login form on my Astro page. I want to use MUI components in React for my form. At the same time when the form in submitted I want to trigger Astro.redirect('/some-page'). I know from the docs…
Graunephar
  • 112
  • 1
  • 9
1
vote
1 answer

Astro.js implementing auth through jwt and store

I have a spring boot backend which can send jwt token on login. I need to implement these features in my Astro frontend: Redirect to /login if no token is found in local storage On login retirieve the token from server response and store it in…
salat _
  • 91
  • 1
  • 7
1
vote
1 answer

Astro/Vue is executing appEntrypoint one time per component

I have few Vue components in an Astro page that are sharing the state via Pinia I initialised the Pinia plugin as the Astro documentation mentions, via astro.config.mjs: import {defineConfig} from 'astro/config'; import vue from '@astrojs/vue'; //…
angelcervera
  • 3,699
  • 1
  • 40
  • 68
1
vote
1 answer

Does Astro js need a backend framework like ExpressJS, Django, or Flask?

I know that Astro js is like a server that can use multiple front-end frameworks such as React, but does astro.js need a back-end framework?
1
vote
1 answer

Vercel isn't deploying my github's project latest version

I been using Vercel for quite a while, it's never been a headache for me until now, i'm facing a very weird situation, since yesterday it doesn't matter how many git push i do to my project (it only has one branch, main) Vercel keeps deploying the…
jxtaaa
  • 11
  • 1
1
vote
1 answer

How do I deploy a ssr Astro site with a Node.js adapter on Netlify?

How do I deploy a server-side rendered Astro site with a Node.js adapter on Netlify? When i push this site to production I see: Runtime.ImportModuleError - Error: Cannot find module 'sharp' Require stack: -…
IvonaK
  • 119
  • 10
1
vote
1 answer

How can I redirect pages in Astro?

I have a presentation on redirects How can I do this redirect in Astro? I am using ssr on Astro adapter and node For example, my presentation is as follows [ { "id": 1, "source":…
1
vote
1 answer

Astro transforming async generator functions is not supported yet

I want to support old browsers for my website. I am currently trying to use @vitejs/plugin-legacy. But while building I get this error, [vite:esbuild-transpile] Transform failed with 9 errors: entry.mjs:551:0: ERROR: Transforming async generator…
Axel
  • 4,365
  • 11
  • 63
  • 122
1
vote
1 answer

AstroJS: Can I get a list of all pages withing a folder

I have an astro project with several .astro pages in src/pages/topics/ in my src/pages/index.astro file I would like to have a nav list with a link to each of the topic pages. Is there a way to automatically get a list of all pages within the topic…
jpala
  • 83
  • 8
1
vote
1 answer

Is there is way to preserve the state in astro

I would really like to know if there is a way of preserving states such as user data between routes in astro. I am also using the svelte framework. I tried to use svelte stores but does not seem to work. I also tried to implement nano stores but…
Ranger
  • 15
  • 3
1
vote
2 answers

How to style slot elements in Astro with Tailwind

How can i style the injected elements in an Astro layout using plain css with tailwind. Minimum Reproducible example: /src/layouts/PostLayout.astro
/pages/somepage.mdx --- layout:…
emg184
  • 850
  • 8
  • 19
1
vote
1 answer

Cannot read properties of undefined (reading 'current') I can't get slug from array

current page not displayed I can't get current slug from array stack: backend: Sanity Frontend: Astro.build Sanity import { defineField, defineType } from 'sanity' export default defineType({ name: 'art', title: 'Arts', type:…