diff --git a/packages/astro/src/frontend/500.astro b/packages/astro/src/frontend/500.astro index 4ffd7ac88..6e44c4440 100644 --- a/packages/astro/src/frontend/500.astro +++ b/packages/astro/src/frontend/500.astro @@ -10,7 +10,7 @@ const error = Astro.request.url.searchParams.get('error'); Error 500 - + + + diff --git a/www/public/global.scss b/www/public/global.scss index 7ff409fb4..c0d03a8fd 100644 --- a/www/public/global.scss +++ b/www/public/global.scss @@ -15,7 +15,7 @@ html { display: grid; width: 100%; max-width: 100vw; - overflow-x: hidden; + overflow: hidden; height: 100%; background-color: #000014; } diff --git a/www/src/components/ArticleFooter.astro b/www/src/components/ArticleFooter.astro new file mode 100644 index 000000000..8078e2cc3 --- /dev/null +++ b/www/src/components/ArticleFooter.astro @@ -0,0 +1,15 @@ +--- +import AvatarList from './AvatarList.astro'; +--- + +
+ +
+ + diff --git a/www/src/components/Author.astro b/www/src/components/Author.astro new file mode 100644 index 000000000..351b1bfc4 --- /dev/null +++ b/www/src/components/Author.astro @@ -0,0 +1,10 @@ +--- +import authorData from '../data/authors.json'; + +export let authorId: string; +const author = authorData[authorId]; +--- + +
+

by {author.name}{' '}@{author.twitter}

+
diff --git a/www/src/components/AvatarList.astro b/www/src/components/AvatarList.astro new file mode 100644 index 000000000..aafcb371b --- /dev/null +++ b/www/src/components/AvatarList.astro @@ -0,0 +1,74 @@ + + + + + diff --git a/www/src/components/BaseHead.astro b/www/src/components/BaseHead.astro index 155d12ae2..b7ae09c95 100644 --- a/www/src/components/BaseHead.astro +++ b/www/src/components/BaseHead.astro @@ -30,7 +30,4 @@ export let permalink: string; - - - - + diff --git a/www/src/components/BlockQuote.astro b/www/src/components/BlockQuote.astro new file mode 100644 index 000000000..00d380ef1 --- /dev/null +++ b/www/src/components/BlockQuote.astro @@ -0,0 +1,39 @@ +--- +export let author: string; +export let source: string; +export let sourceHref: string; +--- + +
+ +
+

{author}

+ {source} +
+
+ + diff --git a/www/src/components/BlogHeader.astro b/www/src/components/BlogHeader.astro new file mode 100644 index 000000000..75130722f --- /dev/null +++ b/www/src/components/BlogHeader.astro @@ -0,0 +1,93 @@ +
+ +
+ + diff --git a/www/src/components/BlogPost.astro b/www/src/components/BlogPost.astro new file mode 100644 index 000000000..56b1f5ebc --- /dev/null +++ b/www/src/components/BlogPost.astro @@ -0,0 +1,75 @@ +--- +import Author from './Author.astro'; + +export let title: string; +export let author: string; +export let publishDate: string; +export let heroImage: string; +--- + +
+
+
+
+ {heroImage && } +

{publishDate}

+

{title}

+ +
+
+ +
+
+
+ + diff --git a/www/src/components/BlogPostPreview.astro b/www/src/components/BlogPostPreview.astro new file mode 100644 index 000000000..c38a56361 --- /dev/null +++ b/www/src/components/BlogPostPreview.astro @@ -0,0 +1,58 @@ +--- +import Author from './Author.astro'; + +export let title: string; +export let publishDate: string; +export let href: string; +--- + + + diff --git a/www/src/components/Note.astro b/www/src/components/Note.astro new file mode 100644 index 000000000..3618e3020 --- /dev/null +++ b/www/src/components/Note.astro @@ -0,0 +1,45 @@ +--- +export let type = "tip"; +export let title; +--- + + + + diff --git a/www/src/components/Shell.astro b/www/src/components/Shell.astro new file mode 100644 index 000000000..77753de4b --- /dev/null +++ b/www/src/components/Shell.astro @@ -0,0 +1,22 @@ +--- +export let code: string; +--- + +
{code.trim().split('\n').map(ln => 
+{ln.startsWith('#') ? {ln} : ln}
+)}
+ + diff --git a/www/src/config.ts b/www/src/config.ts new file mode 100644 index 000000000..6b6ce3fdc --- /dev/null +++ b/www/src/config.ts @@ -0,0 +1,9 @@ +export const sidebar = [ + { + text: 'Introduction', + children: [ + { text: 'Welcome', link: '/' }, + { text: 'Example', link: '/example' }, + ], + }, +]; diff --git a/www/src/data/authors.json b/www/src/data/authors.json new file mode 100644 index 000000000..958d9effd --- /dev/null +++ b/www/src/data/authors.json @@ -0,0 +1,6 @@ +{ + "fred": { + "name": "Fred K. Schott", + "twitter": "FredKSchott" + } +} diff --git a/www/src/layouts/Blog.astro b/www/src/layouts/Blog.astro new file mode 100644 index 000000000..2bca03b7e --- /dev/null +++ b/www/src/layouts/Blog.astro @@ -0,0 +1,211 @@ +--- +import ArticleFooter from '../components/ArticleFooter.astro'; +import SiteSidebar from '../components/SiteSidebar.astro'; +import ThemeToggle from '../components/ThemeToggle.tsx'; +import DocSidebar from '../components/DocSidebar.tsx'; + +export let content; +const headers = content?.astro?.headers; +--- + + + + {content?.title} + + + + + + +
+ +
+ +
+
+
+
+ +
+
+
+
+ + diff --git a/www/src/pages/blog/index.astro b/www/src/pages/blog/index.astro new file mode 100644 index 000000000..c46b1ade9 --- /dev/null +++ b/www/src/pages/blog/index.astro @@ -0,0 +1,76 @@ +--- +import BaseHead from '../../components/BaseHead.astro'; +import BlogHeader from '../../components/BlogHeader.astro'; +import BlogPostPreview from '../../components/BlogPostPreview.astro'; + +let title = 'Astro Blog'; +let description = 'Everything you need to know about Astro, direct from mission control.'; +let permalink = 'https://astro.build/blog'; +--- + + + + + + + + + + + +
+
+
+

The Astro Blog

+

{description}

+
+
+ +

We're excited to announce Astro as a new way to build static websites and deliver lightning-fast performance without sacrificing a modern developer experience.

+
+
+
+
+ + diff --git a/www/src/pages/blog/introducing-astro.astro b/www/src/pages/blog/introducing-astro.astro new file mode 100644 index 000000000..cf3e4444a --- /dev/null +++ b/www/src/pages/blog/introducing-astro.astro @@ -0,0 +1,120 @@ +--- +import { Markdown } from 'astro/components'; +import BaseHead from '../../components/BaseHead.astro'; +import BlogHeader from '../../components/BlogHeader.astro'; +import BlogPost from '../../components/BlogPost.astro'; +import Shell from '../../components/Shell.astro'; +import Note from '../../components/Note.astro'; +import BlockQuote from '../../components/BlockQuote.astro'; + +let title = 'Introducing Astro: Ship Less JavaScript'; +let description = `We're excited to announce Astro as a new way to build static websites and deliver lightning-fast performance without sacrificing a modern developer experience.`; +let publishDate = 'Tuesday, June 8 2021'; +let author = 'fred'; +let heroImage = '/assets/blog/introducing-astro.jpg'; +let permalink = 'https://astro.build/blog/introducing-astro'; +--- + + + + + + + + + + + + + There's a simple secret to building a faster website — *just ship less*. + + Unfortunately, modern web development has been trending in the opposite direction—towards *more.* More JavaScript, more features, more moving parts, and ultimately more complexity needed to keep it all running smoothly. + + We're excited to announce Astro as a new way to build static websites and deliver lightning-fast performance without sacrificing your modern developer experience. To build Astro we borrowed the best parts of our favorite web frameworks and then added a few innovations of our own, including: + + - **Bring Your Own Framework (BYOF):** Astro supports popular UI frameworks like React, Svelte, Vue, Preact, web components, or plain HTML + JavaScript. + - **100% Static HTML, No JS:** Astro strips out JavaScript from your final build and renders every page to HTML by default. + - **Hydrating Components:** Astro loads components that need interactivity when they enter the browser viewport. If the user never sees it, they never load it. + - **Fully-Featured:** Astro supports TypeScript, Scoped CSS, CSS Modules, Sass, Tailwind, Markdown, MDX, and any of your favorite npm packages. + - **SEO Enabled:** Automatic sitemaps, RSS feeds, pagination and collections take the pain out of SEO and syndication. + + This post marks the first public beta release of Astro. **Missing features and bugs are still to be expected at this early stage.** There is still some months to go before an official 1.0 release, but there are already several fast sites built with Astro in production today. + + + To learn more about Astro and start building your first site, check out [the project README.](https://github.com/snowpackjs/astro#-guides) + + + ## Getting Started + + Starting a new project in Astro is easy: + + + + + To learn more about Astro and start building your first site, check out [the project README.](https://github.com/snowpackjs/astro#-guides) + + + + ## How Astro Works + + Astro works a lot like a static site generator. If you have ever used Eleventy, Hugo, or Jekyll (or even a server-side web framework like Rails, Laravel, or Django) then you should feel right at home with Astro. + + In Astro, you compose your website using UI components from your favorite JavaScript web framework (React, Svelte, Vue, etc). Astro renders your entire site to static HTML during the build. The result is a fully static website with all JavaScript removed from the final page. No monolithic JavaScript application required, just static HTML that loads as fast as possible in the browser regardless of how many UI components you used to generate it. + + Of course, sometimes client-side JavaScript is inevitable. Image carousels, shopping carts, and auto-complete search bars are just a few examples of things that require some JavaScript to run in the browser. This is where Astro really shines: When a component requires JavaScript, Astro only adds that one component (and any dependencies) to the final browser payload. The rest of your site continues to exist as static, lightweight HTML. + + In other full-stack web frameworks this level of per-component optimization would be impossible without loading the entire page in JavaScript, deplaying interactivity. In Astro, this kind of [partial hydration](https://addyosmani.com/blog/rehydration/) is built into the tool itself. + + You can even [automatically defer components](https://codepen.io/jonneal/full/ZELvMvw) to only load once they become visible on the page with the `:visible` modifier. + + This new approach to web architecture is called [islands architecture](https://jasonformat.com/islands-architecture/). We didn't coin the term, but Astro may have perfected the technique. We are confident that an HTML-first, JavaScript-only-as-needed approach is the best solution for the majority of content-based websites. + + + To learn more about Astro and start building your first site, check out [the project README.](https://github.com/snowpackjs/astro#-guides) + + + ## Embracing the Pit of Success + +
+ A well-designed system makes it easy to do the right things and annoying (but not impossible) to do the wrong things +
+ + Poor performance is often framed as a failure of the developer, but we respectfully disagree. In many cases, poor performance is a failure of tooling. It should be difficult to build a slow website. + + Astro's main design principle is to lead developers into what [Rico Mariani](https://twitter.com/ricomariani) dubbed "the pit of success". It is our goal to build every site "fast by default" while also delivering a familiar, modern developer experience. + + By building your site to static HTML by default, Astro makes it difficult (but never impossible 😉) to build a slow site. + + ## Long-Term Sustainability + + Astro is built by the team of open source developers behind [Snowpack](https://snowpack.dev) and [Skypack](https://skypack.dev), with additional contributions from the community. + + **Astro is and always will be free.** It is an open source project released under the [MIT license](https://github.com/snowpackjs/astro/blob/main/LICENSE). + + We care deeply about building a more sustainable future for open source software. At the same time, we need to support Astro's development long-term. This requires money (donations alone aren't enough.) + + We're inspired by the early success of projects like [Tailwind](https://tailwindcss.com/), [Rome](https://rome.tools/), [Remix](https://remix.run/), [Ionic](https://ionicframework.com/), and others who are experimenting with long-term financial sustainability on top of the Open Source space. Over the next year we'll be exploring how we can create a sustainable business to support a 100% free, open source Astro for years to come. + + If your company is as excited about Astro as we are, we'd love to hear from you. + + Finally, I'd like to give a **HUGE** thanks to everyone who joined us on day 1 for the private beta. Your feedback has been essential in shaping Astro into the tool it is today. If you're interested in getting involved (or just following along with development) [join us on Discord](https://astro.build/chat). + + + To learn more about Astro and start building your first site, check out [the project README.](https://github.com/snowpackjs/astro#-guides) + +
+
+ + + diff --git a/www/src/pages/index.astro b/www/src/pages/index.astro index df1df75d0..7824dd2de 100644 --- a/www/src/pages/index.astro +++ b/www/src/pages/index.astro @@ -14,6 +14,7 @@ let permalink = 'https://astro.build/'; + diff --git a/www/vercel.json b/www/vercel.json new file mode 100644 index 000000000..cdcb57320 --- /dev/null +++ b/www/vercel.json @@ -0,0 +1,7 @@ +{ + "cleanUrls": true, + "trailingSlash": false, + "redirects": [ + { "source": "/chat", "destination": "https://discord.gg/grF4GTXXYm" } + ] +}