Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Code7 template used by the Caddy browse directive
<!DOCTYPE html>
<meta charset='utf-8'>
<link rel="stylesheet" href="">
body { font-family: 'Helvetica Neue', Sans-serif; }
#list {
width: 100%;
th,td {
border-color: #eee;
padding: 0.2em 0.5em;
.path {
margin-top: 0.6em;
margin-bottom: 0.6em;
font-weight: bold;
font-size: 1.3em;
color: #333;
<div class="container">
<a href="/"><img src="" alt="code7 interactive" /></a>
<h1 class="path">{{.Path}}</h1>
<table id="list" cellpadding="0.1em" cellspacing="0">
<th>File Name</th>
<th>File Size</th>
{{if .CanGoUp}}
<a href="..">Parent directory/</a>
Parent directory/
{{range .Items}}
{{if .IsDir}}
<td><a href="{{.URL}}">{{.Name}}/</a></td>
<td>{{.HumanModTime "2006-01-02 15:04"}}</td>
{{range .Items}}
{{if not .IsDir}}
{{if ne .Name "Caddyfile" }}
<td><a href="{{.URL}}">{{.Name}}</a></td>
<td>{{.HumanModTime "2006-01-02 15:04"}}</td>

This comment has been minimized.

Copy link
Owner Author

peterhellberg commented Jul 25, 2015

Code7 template for Caddy browse directive

Note: Directories are listed before files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.