tex: update composability section's listing
This commit is contained in:
parent
0d6ac6125e
commit
2baaffaf27
|
@ -374,13 +374,15 @@ Echo's built-in facilities in a more ergonomic manner using \texttt{return
|
||||||
c.Render(http.StatusOk, "home.tmpl")}.
|
c.Render(http.StatusOk, "home.tmpl")}.
|
||||||
|
|
||||||
\vspace{\parskip}
|
\vspace{\parskip}
|
||||||
\begin{lstlisting}[language=Go, caption={A conditional inside a Go template},
|
\begin{lstlisting}[
|
||||||
|
caption={Conditionaly enabling functionality inside a Go template based on user access level},
|
||||||
label=tmplConditionals, basicstyle=\linespread{0.9}\small\ttfamily,
|
label=tmplConditionals, basicstyle=\linespread{0.9}\small\ttfamily,
|
||||||
backgroundcolor=\color{lstbg},
|
backgroundcolor=\color{lstbg},
|
||||||
|
morekeywords={if,and,end},
|
||||||
]
|
]
|
||||||
{{ if and .User .User.IsLoggedIn .User.IsAdmin }}
|
{{ if and .User .User.IsLoggedIn .User.IsAdmin }}
|
||||||
...
|
...
|
||||||
{{end}}
|
{{ end }}
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
Templates used for rendering of the web pages were created in a composable
|
Templates used for rendering of the web pages were created in a composable
|
||||||
|
|
Reference in New Issue