Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webc:is="template" to webc:type="js"(and render) docs #91

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ Run any arbitrary server JavaScript in WebC. Outputs the result of the very last
`components/img.webc`:

```html
<script webc:type="js">
<script webc:type="js" webc:is="template">
if(!alt) {
throw new Error("oh no you didn’t");
}
Expand All @@ -519,7 +519,7 @@ if(!alt) {
<summary>Expand to see this example with <code>webc:type="render"</code></summary>

```html
<script webc:type="render">
<script webc:type="render" webc:is="template">
function() {
if(!this.alt) {
throw new Error("oh no you didn’t");
Expand Down Expand Up @@ -568,7 +568,7 @@ function() {
Here’s another example of a more complex conditional (you can also use `webc:if`!):

```html
<script webc:type="js">
<script webc:type="js" webc:is="template">
if(alt) {
`<img src="${src}" alt="${alt}">`
} else {
Expand Down Expand Up @@ -678,4 +678,4 @@ There are a few wrinkles when using an HTML parser with custom elements. Notably
There are two different rendering modes in Eleventy: `page` and `component`. We attempt to guess the rendering mode that you’d like based on the markup you supply. The `page` rendering mode is for rendering full HTML pages. The `component` rendering mode is for fragments of HTML. Most of the time you won’t need to worry about this distinction but it is included in the documentation for completeness.

* `page` is used when the markup starts with `<!doctype` (or `<!DOCTYPE`) or `<html` (WebC forces no-quirks parsing).
* `component` is used otherwise.
* `component` is used otherwise.