{{/*###
Handler=/doc/:id
TitleBar=View document
KyutGrill=documentation.jpg
HugeHeadingRight=true
*/}}
{{ define "tpl" }}
<div class="ui container">
	<div class="ui segments">
		{{ $url := i  (eq (.Gin.Param "id") "rules") "doc/rules"  (printf "doc/content?id=%s" (urlquery (.Gin.Param "id"))) }}
		{{ with .Get $url }}
			{{ if not .title }}
				<div class="ui segment">
					{{ .T "Documentation file not found!" }}
				</div>
			{{ else }}		
				<div class="ui segment">
					<h1 class="ui header">{{ .title }}</h1>
				</div>
				<div class="ui segment">
					{{ blackfriday .content }}
				</div>
			{{ end }}
		{{ end }}
		<div class="ui right aligned segment">
			<a class="ui labeled icon button" href="/doc">
				<i class="left arrow icon"></i>
				{{ .T "View all docs" }}
			</a>
		</div>
	</div>
</div>
{{ end }}
{{/*###
Handler=/doc/:id
TitleBar=View document
KyutGrill=documentation.jpg
HugeHeadingRight=true
*/}}
{{ define "tpl" }}
<div class="ui container">
	<div class="ui segments">
		{{ $ := . }}
		{{ $url := i  (eq (.Gin.Param "id") "rules") "doc/rules"  (printf "doc/content?id=%s" (urlquery (.Gin.Param "id"))) }}
		{{ with .Get $url }}
			{{ if not .title }}
				<div class="ui segment">
					{{ $.T "Documentation file not found!" }}
				</div>
			{{ else }}		
				<div class="ui segment">
					<h1 class="ui header">{{ .title }}</h1>
				</div>
				<div class="ui segment">
					{{ blackfriday .content }}
				</div>
			{{ end }}
		{{ end }}
		<div class="ui right aligned segment">
			<a class="ui labeled icon button" href="/doc">
				<i class="left arrow icon"></i>
				{{ .T "View all docs" }}
			</a>
		</div>
	</div>
</div>
{{ end }}
Fix 500 appearing when viewing non-existing doc file
Fix 500 appearing when viewing non-existing doc file
