Skip to content

Commit

Permalink
Update CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreben committed Nov 21, 2018
1 parent 79e5c07 commit c1473ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 1.3.1
VERSION = 1.3.2

APP := http-file-server
PACKAGES := $(shell go list -f {{.Dir}} ./...)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ Or [download a binary](https://github.com/sgreben/http-file-server/releases/late

```sh
# Linux
curl -L https://github.com/sgreben/http-file-server/releases/download/1.3.1/http-file-server_1.3.1_linux_x86_64.tar.gz | tar xz
curl -L https://github.com/sgreben/http-file-server/releases/download/1.3.2/http-file-server_1.3.2_linux_x86_64.tar.gz | tar xz

# OS X
curl -L https://github.com/sgreben/http-file-server/releases/download/1.3.1/http-file-server_1.3.1_osx_x86_64.tar.gz | tar xz
curl -L https://github.com/sgreben/http-file-server/releases/download/1.3.2/http-file-server_1.3.2_osx_x86_64.tar.gz | tar xz

# Windows
curl -LO https://github.com/sgreben/http-file-server/releases/download/1.3.1/http-file-server_1.3.1_windows_x86_64.zip
unzip versions_1.3.1_windows_x86_64.zip
curl -LO https://github.com/sgreben/http-file-server/releases/download/1.3.2/http-file-server_1.3.2_windows_x86_64.zip
unzip versions_1.3.2_windows_x86_64.zip
```

## Use it
Expand Down
13 changes: 7 additions & 6 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,27 @@ const directoryListingTemplateText = `
<head>
<title>{{ .Title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>a{display:block;padding:.5em;}.highlight,tbody tr:nth-child(odd){background:#eee;}.number{text-align:right;}.text{text-align:left;}canvas,table,a{width:100%;max-width:100%;word-break:break-all;}</style>
<style>body{font-family: sans-serif;}td{padding:.5em;}a{display:block;}tbody tr:nth-child(odd){background:#eee;}.number{text-align:right}.text{text-align:left;word-break:break-all;}canvas,table{width:100%;max-width:100%;}</style>
</head>
<body>
<h1>{{ .Title }}</h1>
{{ if .Files }}
<table>
<thead>
<th></th>
<th class=number>Size (bytes)</th>
<th colspan=2 class=number>Size (bytes)</th>
</thead>
<tbody>
<tr><td colspan=2><a href="{{ .TarGzURL }}">.tar.gz of all files</a></td></tr>
<tr><td colspan=2><a href="{{ .ZipURL }}">.zip of all files</a></td></tr>
<tr><td colspan=3><a href="{{ .TarGzURL }}">.tar.gz of all files</a></td></tr>
<tr><td colspan=3><a href="{{ .ZipURL }}">.zip of all files</a></td></tr>
{{- range .Files }}
<tr>
{{ if (not .IsDir) }}
<td class=text><a href="{{ .URL.String }}">{{ .Name }}</td>
<td class=number>{{.Size.String }} ({{ .Size | printf "%d" }})</td>
<td class=number>{{.Size.String }}</td>
<td class=number>({{ .Size | printf "%d" }})</td>
{{ else }}
<td colspan=2 class=text><a href="{{ .URL.String }}">{{ .Name }}</td>
<td colspan=3 class=text><a href="{{ .URL.String }}">{{ .Name }}</td>
{{ end }}
</tr>
{{end -}}
Expand Down

0 comments on commit c1473ac

Please sign in to comment.