Questions tagged [astrojs]
A website building framework giving high speed performance and a modernized development flow. Astro supports both a SSG (static-site-generation) and SSR (server-side-rendering) mode. Either way, the output is a website with zero JavaScript sent to the browser, which results in maximized speed for loading content. React/Solid/Svelte/Vue islands can be loaded as well for client-side interactivity.
astrojs
674
questions
-1
votes
1
answer
13
views
How can I connect Nest.js backend framework with Astro frontend?
I am creating a project but don't know how to connect the 2 frameworks. I currently have 2 separate folders one called frontend with the astro framework and the other one called backend with Nest.js
I ...
0
votes
0
answers
18
views
Unable to use Astro Image Component with Astro DB that store the Links to them
So, i am trying to use AstroJs's Image Component to Display Optimized images on the Page.
i have put my images in the Project / src / images directory.
the only way to Provide a Link to the image is ...
0
votes
1
answer
23
views
How to evaluate a expression inside a <script> element in JSX using Astro?
I've the following code in an Astro component:
BaseHead.astro
<!-- Schema.org -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
...
0
votes
0
answers
20
views
How to style slotted child elements in Astro Layout?
I'm building out my company's blog post page and am having some trouble styling slotted content that comes from my markdown blog posts.
Specifically, I want add some top padding to all child elements ...
0
votes
1
answer
16
views
Astro.currentLocale in Framework Components for SSR
I've built an app localized by Astro's i18n routing.
To get the current locale, on server-side I use Astro.currentLocale and on client-side I use window.location.pathname with a helper function that ...
0
votes
1
answer
41
views
Import .md files dynamically by slug
i am pretty new to Astro, and i want to find out how to have a file such as [...slug] read md files based on that slug. Best with using collection entries or something similar. It seems there is no ...
0
votes
1
answer
16
views
How to create use and html element prop to determine the element used by and Astro component
I want to create an Astro component that can be any html element the user passes to it in props. I'm not even sure it is possible with Astro components. Something like this, but with the right syntax.
...
0
votes
0
answers
21
views
container query does not work in inline or from external css file in Astro [duplicate]
having below css file and imported in Astro but container query does not seem to work; also tries the :is-inline directive within .Astro file but it doesnt getting applied
panel.css
main {
container-...
0
votes
0
answers
13
views
document is not defined in Astro projext even after adding client:load directive
I had a basic html and css with with vanila javascript which works with keyboard interactions and now transformed to astro but getiing error
document not defined and sugegsted to use client:only
I ...
0
votes
1
answer
24
views
Is there a way to append a custom Astro component to the dom while running?
I'm new to Astro and I'm looking for a way to add new elements to the DOM while execution. I mean, imagine you have a custom Astro Component called "A", a container and a button. So, is ...
0
votes
1
answer
28
views
How to extend styles of a reusable button component in Astro using class props
I'm working on a project using Astro and I'm trying to create a reusable button component that allows for extending styles using class props. My goal is to pass custom styles to the button while ...
0
votes
0
answers
20
views
Difference in Data Fetching Behavior in Astro Project
I have the following code in my Astro project:
//api.js
export const fetchKnowledgeBases = async () => {
const response = await fetch(`${API_BASE_URL}/accounts/${accountId}/knowledge-bases/${...
0
votes
0
answers
19
views
astro.js - using wasm straight in the svelte island
I am using astro framework with svelte as interactive island.
and I want to use wasm inside my svelte island directly to process some [markdown][1]. but it is not so straight forward that I can just ...
0
votes
1
answer
52
views
How to prevent cached responses with Astro on Vercel?
I am trying to fetch data on the client side in Astro, but I keep getting a cached response.
From my endpoint in src/pages/api/spotify.ts I am sending:
export const prerender = false;
...
export const ...
1
vote
0
answers
15
views
AstroJs how can I "sprintf" i18n string and htmlParts?
My i18n.ts
It contains and import strings from {language}.json if you want.
If __() method have ...args I've replace it while matches.
export function setLanguage(language: keyof typeof options....