mirror of https://github.com/golang/go.git
doc: link to block example in go1.6 doc
Fixes #14143 Change-Id: I2d77e55bc0b6bb42e11de291e0ddb5ad5d620646 Reviewed-on: https://go-review.googlesource.com/19110 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
f5e309012b
commit
1ab900e5f1
|
|
@ -464,20 +464,8 @@ Second, the new <a href="/pkg/text/template/#hdr-Actions"><code>{{"{{"}}block}}<
|
||||||
combined with allowing redefinition of named templates,
|
combined with allowing redefinition of named templates,
|
||||||
provides a simple way to define pieces of a template that
|
provides a simple way to define pieces of a template that
|
||||||
can be replaced in different instantiations.
|
can be replaced in different instantiations.
|
||||||
For example, the template
|
There is <a href="/pkg/text/template/#example_Template_block">an example</a>
|
||||||
</p>
|
in the <code>text/template</code> package that demonstrates this new feature.
|
||||||
|
|
||||||
<pre>
|
|
||||||
<title>{{"{{"}}block "title"}}Page Title{{"{{"}}end}}</title>
|
|
||||||
<body>
|
|
||||||
<h1>{{"{{"}}template "title"}}</h1>
|
|
||||||
{{"{{"}}block "page"}}Main text{{"{{"}}end}}
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
defines the basic formatting of a web page. A program can then
|
|
||||||
overlay that template with new definitions for the <code>"title"</code>
|
|
||||||
and <code>"page"</code> blocks to reuse the formatting for another page.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue