31
loading...
This website collects cookies to deliver better user experience
Astro is a Static Site Generator (SSG). Build your pages in .astro
files (very close to HTML/JSX) and sparkle them with React/Vue/Preact/Svelte components. It deals with file-based routing and templates neutrally. Bring your component framework. In my words
Not because it's the new/latest shiny framework 😀
We just wanted a good Static Site Generator with a JavaScript Developper Experience and 100% HTML output by default. And Astro is precisely that.
.astro
files.You don't need to use the cutting-edge hydration capabilities of Astro to already benefit from it.
Astro's CSS Bundling is probably its most underrated feature. It never makes it to the headline but it's by far my favorite!
<style>
tags in your astro components where you need them and add lists of <link ref="stylesheet">
in your <head>
.<link href="/css/reset.css" rel="stylesheet" />
<link href="/css/global.css" rel="stylesheet" />
.css
files are minified and calling them separately doesn't provide the best performance result.astro build
, <style>
tags and <link ref="stylesheet">
are minified and bundled automatically./_astro/[page]-[hash].css
)\_astro/common-[hash].css
)<link href="/_astro/common-[hash].css" rel="stylesheet" />
<link href="/_astro/mypage-[hash].css" rel="stylesheet" />
/_astro/common-[hash].css
is the same on every page. It's cached and not re-downloaded during navigation on the site. It's hard to have a better result.astro build
take care of best performance.I don't know any static site generator capable of doing [pure] CSS Bundling and minification so seamlessly.
<script>
tags transpiled, bundled, chunked, and minified in the best possible way.node_modules
common-chunk.js
/slug/index.html
, but some pages need to be generated as /slug.html
instead. Like /404.html
.Astro is more than a SSG
Stay tuned!