Live data from Hacker News

Astro 1.0 – a web framework for building fast, content-focused websites

astro.build

101–110 of 256 posts

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#101

Earlier quoted context omitted.

wait do you have a repo example of this or some sort of link? My theme is so simple I think redoing it as themeless may be better

Replace the themes directory with the "layouts" directory which contains all the templates. I do my blog this way. https://github.com/PowerSnail/PowerSnail.github.io

OK I see, but even though it's themeless you still have to follow the Hugo theming structure (_default, partials, index.html, etc). Mine is the same as that, it's just nested into the themes directory.

It's that theming structure that was a pain to figure out the first time for me

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#102

Earlier quoted context omitted.

To add onto this, we recently added plugin support for templates, so you can write your own template functions if you'd like! https://github.com/caddyserver/caddy/pull/4757

Have you considered adding WASM / WAGI support?

Not really; it's already really easy to write plugins for Caddy in Go, so we haven't really seen the need. See here: https://caddyserver.com/docs/extending-caddy

You could write your own plugin that calls out to your WASM layer if you want, but I'm not sure we need that built into Caddy. It would be extremely niche, I think.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#103
post #43

I used a static site generator for all of these benefits in the past, but the rebuilding process is a total nightmare. The site has about 20 categories, and each category has about 100 images. Every time the team adds a new image or category, the deployment/building task clones the repo and then the build process generates all the optimally sized images again and then re-uploads multiple gigabytes to the host. Is the…

You might need ISR (incremental static regeneration). IIRC there are a couple standard SSG frameworks that support something like it. Usually only worth investing in if you are operating at a large enough content scale though.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#104

Earlier quoted context omitted.

Replace the themes directory with the "layouts" directory which contains all the templates. I do my blog this way. https://github.com/PowerSnail/PowerSnail.github.io

OK I see, but even though it's themeless you still have to follow the Hugo theming structure (_default, partials, index.html, etc). Mine is the same as that, it's just nested into the themes directory. It's that theming structure that was a pain to figure out the first time for me

Yeah, that template look-up hierarchy is unavoidable. The benefit of being themeless is mostly organizational: one config file, one asset directory, etc.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#105

Not to be "that guy", but could you please put the language in the title when posting stuff like this? We all have our language preferences, and I'd rather not have to go digging just to figure out if a project is relevant to me.

It says it's a "web framework" in the title. That generally means it's going to have some kind of templating system, plus html, css, JavaScript, and probably support for other things like markdown and json. Which of these did you want in the title?

Or if you mean what was astro itself written in, I think this post is aimed at users of the system, not potential contributors. Personally I dislike it when when a post says something like "Hugo, a static site generator (Golang)" because it incorrectly implies you need to write Go in order to develop with it.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#106
Excited to see where this goes. For me it fills the niche of simple md -> html with lots of room to expand.

I like working with TS, JSX is fab, and I never enjoyed Hugo or Jekyl. Next.js is nice but too much for this case. Gatsby is not nice and doesn’t do much. Astro sounds just about right.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#107
post #80

Earlier quoted context omitted.

As long as you have npm installed it'll work. Npm create is an alias for the npm init command [1], which will look for a package with the prefix 'create-', install it, and run its bin file. It looks like this is the file that ends up being run: https://github.com/withastro/astro/blob/main/packages/create... . [1] https://docs.npmjs.com/cli/v8/commands/npm-init

> As long as you have npm installed it'll work. Exactly proving my original point.

Well obviously you'll need npm to use a command that begins with npm. If someone gave you a terminal command to run that begins with curl, you'd be expected to have curl installed. This seems like pure pedantry.

Take a look for example at the rust installation steps [1]. They tell you to run the following command in your terminal: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh". They don't tell you to first make sure you have curl installed (or sh for that matter).

[1] https://www.rust-lang.org/learn/get-started

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#108
Here's the link to their "Astro vs. X" page. https://docs.astro.build/en/comparing-astro-vs-other-tools/

They compare Astro to Docusaurus, Elder.js, Eleventy, Gatsby, Hugo, Jekyll, SvelteKit, Next.js, Nuxt, Remix, VuePress, and Zola.

(For some reason, this page doesn't appear linked anywhere from their documentation's table of contents, and isn't even linked from the "Why Astro?" page. It's almost like they're trying to hide it or something!)

https://docs.astro.build/en/concepts/why-astro/

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#109
After having tried and given up on so, so many SSG frameworks, I'm loving Astro. In particular:

- Templates are plain HTML/Javascript, instead of some other templating language (e.g. Jekyll/Liquid)

- Typescript out of the box

- SCSS out of the box

- Easy remote builds on Netlify

- Scoped stylesheets

- No overcomplicated build process/customization (e.g. Webpack)

- Supports Markdown, YAML, JSON, all the things

- It builds really quickly

And all of that is with virtually no additional configuration. It's great.

Also a big bonus: the team is super friendly and very responsive!

Post reply on HN