Skip to content

Commit f83ba84

Browse files
docs/post launch docs feedback and clarifications (#129)
1 parent 6044580 commit f83ba84

10 files changed

Lines changed: 61 additions & 24 deletions

File tree

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"scripts": {
1818
"clean": "rimraf public .greenwood storybook-static",
19-
"build": "node --loader ./node_modules/@greenwood/cli/src/loader.js ./node_modules/.bin/greenwood build",
19+
"build": "node --loader ./node_modules/@greenwood/cli/src/loader.js ./node_modules/@greenwood/cli/src/index.js build",
2020
"dev": "greenwood develop",
2121
"serve": "npm run clean && npm run build && greenwood serve",
2222
"story:dev": "storybook dev -p 6006",
@@ -47,9 +47,9 @@
4747
"@eslint/json": "^0.5.0",
4848
"@eslint/markdown": "^6.2.0",
4949
"@esm-bundle/chai": "^4.3.4-fix.0",
50-
"@greenwood/cli": "^0.30.0",
51-
"@greenwood/plugin-css-modules": "^0.30.0",
52-
"@greenwood/plugin-import-raw": "^0.30.0",
50+
"@greenwood/cli": "^0.30.1",
51+
"@greenwood/plugin-css-modules": "^0.30.1",
52+
"@greenwood/plugin-import-raw": "^0.30.1",
5353
"@ls-lint/ls-lint": "^1.10.0",
5454
"@mapbox/rehype-prism": "^0.9.0",
5555
"@storybook/addon-essentials": "^8.0.6",

src/pages/docs/content-as-data/active-frontmatter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Or HTML:
5656

5757
## Data Client
5858

59-
You can also access this content using our data client:
59+
You can also access this content using our [data client](/docs/content-as-data/data-client/):
6060

6161
```js
6262
import { getContentByCollection } from "@greenwood/cli/src/data/client.js";

src/pages/docs/content-as-data/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ If you are developing a blog site, like in our [Getting Started](/guides/getting
1818

1919
But what happens over time, when that list grows to 10, 50, 100+ posts? Imagine maintaining that list each time, over and over again? Or just remembering to update that list each time you publish a new post? Not only that, but wouldn't it also be great to sort, search, filter, and organize those posts to make them easier for users to navigate and find?
2020

21-
To assist with this, Greenwood provides a set of "content as data" capabilities on the left sidebar you can take advantage of.
21+
To assist with this, Greenwood provides a set of "content as data" capabilities:
22+
23+
- [Pages Data](/docs/content-as-data/pages-data/) - Learn about the data schema available for your content
24+
- [Data Client](/docs/content-as-data/data-client/) - Utilities for getting your content as data
25+
- [Collections](/docs/content-as-data/collections/) - Frontmatter based configuration for grouping related content
26+
- [Active Frontmatter](/docs/content-as-data/active-frontmatter/) - Interpolate your page's frontmatter in your HTML
2227

2328
> First thing though, make sure you've set the [`activeContent`](/docs/reference/configuration/#active-content) flag to `true` in your _greenwood.config.js_.
2429
>

src/pages/docs/introduction/setup.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ $ npm i -D @greenwood/cli@latest
3535

3636
# yarn
3737
$ yarn add @greenwood/cli@latest --save-dev
38+
39+
# pnpm
40+
$ pnpm add -D @greenwood/cli@latest
3841
```
3942

43+
> For pnpm, it is currently required to create a _.npmrc_ file at the root of your project with the [**shamefully-hoist**](https://pnpm.io/blog/2020/10/17/node-modules-configuration-options-with-pnpm#the-worst-case---hoisting-to-the-root) flag set to `true`.
44+
4045
## Commands
4146

4247
The CLI supports three commands, that can be easily mapped to npm scripts in your _package.json_. You'll also want to make sure you've set the `type` field to **module**:

src/pages/docs/pages/server-rendering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export default class PostPage extends HTMLElement {
244244
To use custom imports on the server side for prerendering or SSR use cases (ex. CSS, JSON), you will need to invoke Greenwood using **NodeJS** from the CLI and pass it the `--loaders` flag along with the path to Greenwood's provided loader function.
245245

246246
```shell
247-
$ node --loader ./node_modules/@greenwood/cli/src/loader.js ./node_modules/.bin/greenwood <command>
247+
$ node --loader ./node_modules/@greenwood/cli/src/loader.js ./node_modules/@greenwood/cli/src/index.js <command>
248248
```
249249

250250
Then you will be able to run this, or for any custom format you want using a plugin.

src/pages/docs/plugins/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: docs
33
order: 4
4+
tocHeading: 2
45
---
56

67
<app-heading-box heading="Plugins">
@@ -9,6 +10,16 @@ order: 4
910

1011
> When installing plugins with **npm**, make sure to add the `--legacy-peer-deps` flag, or add an _.npmrc_ file in the root of your project with `legacy-peer-deps=true` set.
1112
13+
## Featured
14+
15+
- [Lit SSR](/docs/plugins/lit-ssr/) - For Lit users, a custom renderer plugin to support Lit+SSR
16+
- [TypeScript](/docs/plugins/typescript/) - A plugin for transforming files written in TypeScript
17+
- [PostCSS](/docs/plugins/postcss/) - Leverage PostCSS plugins, like [Tailwind](/guides/ecosystem/tailwind/)
18+
- [CSS Modules](/docs/plugins/css-modules/) - Support for [CSS Modules](https://github.com/css-modules/css-modules) ™️ syntax
19+
- [Raw Loader](/docs/plugins/raw/) - Import arbitrary text files as ESM
20+
21+
## All Plugins
22+
1223
Below is the official list of supported first-party plugins available by the Greenwood team with links to the plugin specific README for full installation and usage documentation.
1324

1425
<br>

src/pages/docs/reference/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tocHeading: 2
88

99
This section details all the supported configuration options available with **Greenwood**, which you can define in a _greenwood.config.js_ file at root of your project.
1010

11-
The below is a _greenwood.config.js_ file reflecting default values:
11+
Below is a _greenwood.config.js_ file reflecting default values:
1212

1313
```js
1414
export default {

src/pages/docs/resources/scripts.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Below are some examples:
7575
// after having installed Lit
7676
import { html, LitElement } from "lit";
7777

78-
export class SimpleGreeting extends LitElement {
78+
class SimpleGreeting extends LitElement {
7979
static properties = {
8080
name: { type: String },
8181
};
@@ -110,3 +110,19 @@ The rule of thumb is:
110110
111111
- If it's a package from npm installed in **dependencies**, you can use bare specifiers and no extension
112112
- Otherwise, you will need to use a relative path and the extension
113+
114+
## Prerendering
115+
116+
If you have enabled [prerendering](/docs/reference/configuration/#prerender) and using Greenwood's default [renderer (WCC)](/docs/reference/appendix/#dom-emulation), make sure that any custom elements you want prerendered have a `default` export for their `class` definition.
117+
118+
```js
119+
export default class Card extends HTMLElement {
120+
connectedCallback() {
121+
if (!this.shadowRoot) {
122+
// ...
123+
}
124+
}
125+
}
126+
127+
customElements.define("x-card", Card);
128+
```

src/pages/guides/hosting/aws.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In this section, we'll share the steps for up S3 and Cloudfront together for sta
2222

2323
> Keep an eye out for prompts from AWS to enable IAM rules for your function and make sure to invalidate the Cloudfront distribution between tests, since error pages / responses will get cached.
2424
25-
You should now be able to access your site at _http://<your-dist>.cloudfront.net/_! 🏆
25+
You should now be able to access your site at _http://{your-dist}.cloudfront.net/_! 🏆
2626

2727
Now at this point, if you have any routes like `/search/`, you'll notice they are not working unless _index.html_ is appended to the path. To enable routing (URL rewriting) for cleaner URLs, follow the _Configure Trigger_ section of [this guide](https://aws.amazon.com/blogs/compute/implementing-default-directory-indexes-in-amazon-s3-backed-amazon-cloudfront-origins-using-lambdaedge/) to attach the Lambda as a [**Lambda@Edge**](https://aws.amazon.com/lambda/edge/) function that will run on every incoming request.
2828

0 commit comments

Comments
 (0)