diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/base.qtpl | 11 | ||||
| -rw-r--r-- | templates/base.qtpl.go | 135 | ||||
| -rw-r--r-- | templates/helloworld.qtpl | 4 | ||||
| -rw-r--r-- | templates/helloworld.qtpl.go | 4 | 
4 files changed, 78 insertions, 76 deletions
| diff --git a/templates/base.qtpl b/templates/base.qtpl index 6654f42..444afc6 100644 --- a/templates/base.qtpl +++ b/templates/base.qtpl @@ -32,11 +32,12 @@ Page prints a page implementing Page interface.      </head>      <body>          <nav class="container navbar navbar-expand-sm"> -          <ul class="navbar-nav"> -            <li class="nav-link" href="/git">git</li> -            <li class="nav-link" href="/list">list</li> -            <li class="nav-link" href="/about">about</li> -          </ul> +          <div class="navbar-nav"> +            <a class="nav-link" href="/git">git</a> +            <a class="nav-link" href="/list">list</a> +            <a class="nav-link" href="/about">about</a> +            <a class="nav-link" href="/config">config</a> +          </div>          </nav>          <div class="container">              {%= p.Content() %} diff --git a/templates/base.qtpl.go b/templates/base.qtpl.go index 2573b99..1d30cd8 100644 --- a/templates/base.qtpl.go +++ b/templates/base.qtpl.go @@ -74,116 +74,84 @@ func StreamPageTemplate(qw422016 *qt422016.Writer, p Page) {      </head>      <body>          <nav class="container navbar navbar-expand-sm"> -          <ul class="navbar-nav"> -            <li class="nav-link" href="/git">git</li> -            <li class="nav-link" href="/list">list</li> -            <li class="nav-link" href="/about">about</li> -          </ul> +          <div class="navbar-nav"> +            <a class="nav-link" href="/git">git</a> +            <a class="nav-link" href="/list">list</a> +            <a class="nav-link" href="/about">about</a> +            <a class="nav-link" href="/config">config</a> +          </div>          </nav>          <div class="container">              `) -//line base.qtpl:42 +//line base.qtpl:43  	p.StreamContent(qw422016) -//line base.qtpl:42 +//line base.qtpl:43  	qw422016.N().S(`          </div>      </body>      `) -//line base.qtpl:45 +//line base.qtpl:46  	p.StreamScript(qw422016) -//line base.qtpl:45 +//line base.qtpl:46  	qw422016.N().S(`  </html>  `) -//line base.qtpl:47 +//line base.qtpl:48  } -//line base.qtpl:47 +//line base.qtpl:48  func WritePageTemplate(qq422016 qtio422016.Writer, p Page) { -//line base.qtpl:47 +//line base.qtpl:48  	qw422016 := qt422016.AcquireWriter(qq422016) -//line base.qtpl:47 +//line base.qtpl:48  	StreamPageTemplate(qw422016, p) -//line base.qtpl:47 +//line base.qtpl:48  	qt422016.ReleaseWriter(qw422016) -//line base.qtpl:47 +//line base.qtpl:48  } -//line base.qtpl:47 +//line base.qtpl:48  func PageTemplate(p Page) string { -//line base.qtpl:47 +//line base.qtpl:48  	qb422016 := qt422016.AcquireByteBuffer() -//line base.qtpl:47 +//line base.qtpl:48  	WritePageTemplate(qb422016, p) -//line base.qtpl:47 +//line base.qtpl:48  	qs422016 := string(qb422016.B) -//line base.qtpl:47 +//line base.qtpl:48  	qt422016.ReleaseByteBuffer(qb422016) -//line base.qtpl:47 +//line base.qtpl:48  	return qs422016 -//line base.qtpl:47 +//line base.qtpl:48  } -//line base.qtpl:49 -type BasePage struct{} - -//line base.qtpl:50 -func (p *BasePage) StreamTitle(qw422016 *qt422016.Writer) { -//line base.qtpl:50 -	qw422016.N().S(`Empty`) -//line base.qtpl:50 -} - -//line base.qtpl:50 -func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer) { -//line base.qtpl:50 -	qw422016 := qt422016.AcquireWriter(qq422016) -//line base.qtpl:50 -	p.StreamTitle(qw422016) -//line base.qtpl:50 -	qt422016.ReleaseWriter(qw422016) -//line base.qtpl:50 -} - -//line base.qtpl:50 -func (p *BasePage) Title() string { -//line base.qtpl:50 -	qb422016 := qt422016.AcquireByteBuffer()  //line base.qtpl:50 -	p.WriteTitle(qb422016) -//line base.qtpl:50 -	qs422016 := string(qb422016.B) -//line base.qtpl:50 -	qt422016.ReleaseByteBuffer(qb422016) -//line base.qtpl:50 -	return qs422016 -//line base.qtpl:50 -} +type BasePage struct{}  //line base.qtpl:51 -func (p *BasePage) StreamBody(qw422016 *qt422016.Writer) { +func (p *BasePage) StreamTitle(qw422016 *qt422016.Writer) {  //line base.qtpl:51 -	qw422016.N().S(`HelloWorld`) +	qw422016.N().S(`Empty`)  //line base.qtpl:51  }  //line base.qtpl:51 -func (p *BasePage) WriteBody(qq422016 qtio422016.Writer) { +func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer) {  //line base.qtpl:51  	qw422016 := qt422016.AcquireWriter(qq422016)  //line base.qtpl:51 -	p.StreamBody(qw422016) +	p.StreamTitle(qw422016)  //line base.qtpl:51  	qt422016.ReleaseWriter(qw422016)  //line base.qtpl:51  }  //line base.qtpl:51 -func (p *BasePage) Body() string { +func (p *BasePage) Title() string {  //line base.qtpl:51  	qb422016 := qt422016.AcquireByteBuffer()  //line base.qtpl:51 -	p.WriteBody(qb422016) +	p.WriteTitle(qb422016)  //line base.qtpl:51  	qs422016 := string(qb422016.B)  //line base.qtpl:51 @@ -194,27 +162,29 @@ func (p *BasePage) Body() string {  }  //line base.qtpl:52 -func (p *BasePage) StreamScript(qw422016 *qt422016.Writer) { +func (p *BasePage) StreamBody(qw422016 *qt422016.Writer) { +//line base.qtpl:52 +	qw422016.N().S(`HelloWorld`)  //line base.qtpl:52  }  //line base.qtpl:52 -func (p *BasePage) WriteScript(qq422016 qtio422016.Writer) { +func (p *BasePage) WriteBody(qq422016 qtio422016.Writer) {  //line base.qtpl:52  	qw422016 := qt422016.AcquireWriter(qq422016)  //line base.qtpl:52 -	p.StreamScript(qw422016) +	p.StreamBody(qw422016)  //line base.qtpl:52  	qt422016.ReleaseWriter(qw422016)  //line base.qtpl:52  }  //line base.qtpl:52 -func (p *BasePage) Script() string { +func (p *BasePage) Body() string {  //line base.qtpl:52  	qb422016 := qt422016.AcquireByteBuffer()  //line base.qtpl:52 -	p.WriteScript(qb422016) +	p.WriteBody(qb422016)  //line base.qtpl:52  	qs422016 := string(qb422016.B)  //line base.qtpl:52 @@ -223,3 +193,34 @@ func (p *BasePage) Script() string {  	return qs422016  //line base.qtpl:52  } + +//line base.qtpl:53 +func (p *BasePage) StreamScript(qw422016 *qt422016.Writer) { +//line base.qtpl:53 +} + +//line base.qtpl:53 +func (p *BasePage) WriteScript(qq422016 qtio422016.Writer) { +//line base.qtpl:53 +	qw422016 := qt422016.AcquireWriter(qq422016) +//line base.qtpl:53 +	p.StreamScript(qw422016) +//line base.qtpl:53 +	qt422016.ReleaseWriter(qw422016) +//line base.qtpl:53 +} + +//line base.qtpl:53 +func (p *BasePage) Script() string { +//line base.qtpl:53 +	qb422016 := qt422016.AcquireByteBuffer() +//line base.qtpl:53 +	p.WriteScript(qb422016) +//line base.qtpl:53 +	qs422016 := string(qb422016.B) +//line base.qtpl:53 +	qt422016.ReleaseByteBuffer(qb422016) +//line base.qtpl:53 +	return qs422016 +//line base.qtpl:53 +} diff --git a/templates/helloworld.qtpl b/templates/helloworld.qtpl index 45c5595..1785bb5 100644 --- a/templates/helloworld.qtpl +++ b/templates/helloworld.qtpl @@ -1,13 +1,13 @@  {% code  type HelloPage struct { -    Body string +    Body []byte  }  %}  {% func (p *HelloPage) Title() %}Hello{% endfunc %}  {% func (p *HelloPage) Content() %} -{%s= p.Body %} +{%z= p.Body %}  {% endfunc %}  {% func (p *HelloPage) Script() %} diff --git a/templates/helloworld.qtpl.go b/templates/helloworld.qtpl.go index 61c8f75..7e37f3b 100644 --- a/templates/helloworld.qtpl.go +++ b/templates/helloworld.qtpl.go @@ -19,7 +19,7 @@ var (  //line helloworld.qtpl:2  type HelloPage struct { -	Body string +	Body []byte  }  //line helloworld.qtpl:7 @@ -61,7 +61,7 @@ func (p *HelloPage) StreamContent(qw422016 *qt422016.Writer) {  	qw422016.N().S(`  `)  //line helloworld.qtpl:10 -	qw422016.N().S(p.Body) +	qw422016.N().Z(p.Body)  //line helloworld.qtpl:10  	qw422016.N().S(`  `) | 
