A static site building framework giving high speed performance and a modernized development flow. Astro converts your website source code to static HTML during the building process, resulting in an almost fully static website with minimal JavaScript leftover. This results in maximized speed for loading content from the web browser.
Questions tagged [astrojs]
196 questions
0
votes
3 answers
astro-i18next Tfunction showing keys instead of translation
I use t() function to translate text.
The function is acting like there are no locales in astros /public folder.
My file structure
My translation.json file for en:
{
"index": {
"testHeader": "Test Header"
}
}
Here is my index page…

Mihal
- 3
- 4
0
votes
0 answers
No syntax highlight / autocompletion when I am on nesting in astro
I am using a plugin in postcss which works perfectly called "postcss-preset-env"
My problem is that I don't get syntax highlight when I am nesting in an *.astro file
.link-card {
display: flex;
margin-top: 2rem;
padding: 0.15rem;
…

fedoraname1
- 531
- 1
- 3
- 8
0
votes
1 answer
How can I filter frontmatter in a remark plugin?
In an AstroJS site, I've set up a remark plugin to apply a default layout to .md(x) documents if one is not explicitly set. The code comes from the RFC in issue #397 and works well. I'd now like to use the component to break large…

Jack Carey
- 1
- 2
0
votes
0 answers
How can I make a component in AstroJS that renders paypal buttons?
I've adapated the client-side example from Paypal's docs and my code works fine if I add it directly to a page, but I want to create a reusable component, and when I try to do that and import the component, it just doesn't render. When I try to…

Tara
- 389
- 3
- 14
0
votes
1 answer
How to dynamically render vuejs components in an astro page using a global variable?
I'm developing a form in several steps on Astro. For that I use Vuejs components (one for each step).
Each step can be validated by a button that allows to go to the next one. I tried to create a global variable that increments at each step via the…

Adrien
- 3
- 1
0
votes
2 answers
Can i pass props from a child component to parent in Astro?
Please tell me is it possible to pass props from a child Astro component to the parent? Something like callback in React:
{
//do something with arg
}} />
Are there some analogues in Astro? Thanks for attention!

Kiten
- 985
- 2
- 17
- 35
0
votes
1 answer
Getting error "'aspectRatio' must be provided for remote images" when using a local image
Getting an error of 'aspectRatio' must be provided for remote images when using a local image even when importing in frontmatter when using the @astrojs/image integration. The imported image is in /src/images
As far as I can see this is exactly the…

Lushawn
- 522
- 1
- 3
- 17
0
votes
1 answer
For Astro.js, how to access frontmatter variables in ld+json schema.org SEO JSON?
I have an Astro.js component called 'PageSEO' to use for SEO info for my webpages.
Pages will have title, description, an image URL, a canonical URL, and some addition info.
Here is the code of my PageSeo.astro file:
---
var { title, image,…

Costa Michailidis
- 7,691
- 15
- 72
- 124
0
votes
1 answer
How can I use Remark with Astro to make my posts written in markdown preserve the styling?
I have a blog written in Astro and I write my posts in markdown.
I'm having troubles using remark and remark-html to pass my md tags (such as ##) when I render the post.
async function remarkContent(content) {
const file = await remark()
…

Raffaele Grieco
- 1
- 2
0
votes
1 answer
Import and use NPM package (Sluggo) in Astro
I want to use this NPM package, Sluggo (https://www.npmjs.com/package/sluggo), in Astro, in the frontmatter of an Astro component.
After installation, I import it following Astro docs:
import { sluggo } from 'sluggo';
When I try to use it following…

Nacho B
- 1,573
- 1
- 12
- 16
0
votes
0 answers
I keep getting this error when I try to use React slick within Astro
I'm trying to add react slick to my Astro project and I keep getting this error message -( Error - Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. )-
It works as…
0
votes
2 answers
Can't display fetched posts in AstroJS
I am trying to build my website in AstroJS and I am not able to display the content I fetch inside the "Masonry" component, which is being rendered as an empty "div" in my browser.
---
import BaseLayout from "../layouts/BaseLayout.astro";
import…

udiskie
- 15
- 6
0
votes
1 answer
TypeError: ctx[3] is undefined in Svelte Astro app
Completely lost as why this is breaking. I'm working on an autocomplete kinda component that was working perfectly with an array of strings. But I'm converting it to use a array of objects with keys slug and name and now I'm getting a type error…

michecode
- 85
- 5
0
votes
1 answer
Conditionally tell of `.astro` component is being used as a route or component
Within the AstroJS framework (https://astro.build/) you can have .astro files that are route, you can also import these files into other astro files and use them as components. I've seen an issue that depending on what Astro.request properties are…

ThomasReggi
- 55,053
- 85
- 237
- 424
0
votes
1 answer
how to use lottie-react in astro build framework
I was trying astro build and want to use lottie json files for animations, but there is no documented resource that describe how can we use lottie-react in astro build framework.
I try lottie-react npm package everything works fine in dev, but when…

Mohammad Farhan
- 131
- 1
- 8