diff --git a/www/assets/blog-images/ssr.webp b/www/assets/blog-images/ssr.webp new file mode 100644 index 000000000..6c207f59c Binary files /dev/null and b/www/assets/blog-images/ssr.webp differ diff --git a/www/pages/blog/index.md b/www/pages/blog/index.md index 323af2fb8..4b3622e36 100644 --- a/www/pages/blog/index.md +++ b/www/pages/blog/index.md @@ -19,6 +19,7 @@ template: blog # News and Announcements +- [Release: v0.23.0](/blog/release/v0-23-0/) 📝 - [Release: v0.21.0](/blog/release/v0-21-0/) 📝 - [Release: v0.20.0](/blog/release/v0-20-0/) 📝 - [Release: v0.19.0](/blog/release/v0-19-0/) 📝 diff --git a/www/pages/blog/release/v0-15-0.md b/www/pages/blog/release/v0-15-0.md index 9445249de..dd002c479 100644 --- a/www/pages/blog/release/v0-15-0.md +++ b/www/pages/blog/release/v0-15-0.md @@ -17,7 +17,7 @@ Being a developer is a lot of work. Being a designer is also lot of work. Bein With Greenwood [_**Theme Packs**_](https://www.greenwoodjs.io/guides/theme-packs/), now developers and designers can create and share reusable HTML / CSS / JS as npm packages that other Greenwood users can pull into their Greenwood projects as a plugin. Now anyone can get up and running with a fully designed and themed site and all they have to do is just add the content! 🥳 ## In Practice -For those unfamiliar with [**CSS Zen Garden**](http://www.csszengarden.com/), it is a site aimed at showcasing the power of CSS through static HTML. +For those unfamiliar with [**CSS Zen Garden**](http://www.csszengarden.com/), it is a site aimed at showcasing the power of CSS through static HTML. > _The HTML remains the same, the only thing that has changed is the external CSS file. Yes, really._ diff --git a/www/pages/blog/release/v0-23-0.md b/www/pages/blog/release/v0-23-0.md new file mode 100644 index 000000000..cd7151bc0 --- /dev/null +++ b/www/pages/blog/release/v0-23-0.md @@ -0,0 +1,121 @@ +--- +label: 'blog' +title: v0.23.0 Release +template: blog +--- + +# Greenwood v0.23.0 + +**Published: Feb 11, 2022** + +## What's New + +With this new release, the Greenwood team is excited to (soft) launch the ability to add Server Side Rendering (SSR) to your Greenwood project as well as support for using a custom renderer like [**Lit** SSR](https://www.npmjs.com/package/@lit-labs/ssr). Additionally, to enhance the ability of purely static sites to benefit from some build time templating, a new feature called "interpolate frontmatter" was introduced to easily reuse frontmatter similar to how you would use JavaScript interpolation, but in your HTML and markdown. Let's highlight them both below! 👇 + +## Server Side Rendering (SSR) + +As mentioned above, we are soft launching the ability to incorporate server rendering into your Greenwood projects. By simply adding a JavaScript file to your project, you will be able to have server rendered content available when running `greenwood serve`. You can also combine static and server rendered content all in the same project for a hybrid application! Let's take a look at a quick example. + +### How It Works +You can add a file to your project in the _pages/_ directory and implement either of the three supported APIs, and you will have a server rendered route available! +```shell +. +└── src + └── pages + ├── artists.js + ├── about.md + └── index.html +``` + +```js +// artists.js +import fetch from 'node-fetch'; // this needs to be installed from npm + +async function getBody(compilation) { + const artists = await fetch('http://www.example.com/api/artists').then(resp => resp.json()); + + return ` +
+Name | +Image | +
---|---|
${name} | ++ |