Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei authored Mar 9, 2024
1 parent 6c68ca7 commit 26217a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,22 @@ Execute `gop run .` and visit http://localhost:8080/p/123, you will get:

#### YAP Template

In most cases, we will not use the `html` directive to return a html page, but use the yap template. See [get_p_#id.yap](demo/classfile2_blog/get_p_%23id.yap):
In most cases, we will not use the `html` directive to return a html page, but use the `yap` template engine. See [get_p_#id.yap](demo/classfile2_blog/get_p_%23id.yap):

```coffee
yap "article", {
"id": param("id"),
}
```

It means we need to find a template called `article` to render. See [yap/article_yap.html](demo/classfile2_blog/yap/article_yap.html):

```html
<html>
<head><meta charset="utf-8"/></head>
<body>Article {{.id}}</body>
</html>
```

#### Run at specified address

Expand Down

0 comments on commit 26217a0

Please sign in to comment.