Skip to content

Commit 9df9664

Browse files
committed
Update images
1 parent 85ba490 commit 9df9664

6 files changed

Lines changed: 27 additions & 13 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# Pad
22

3-
[![build](https://github.com/dotzero/pad/actions/workflows/ci.yml/badge.svg)](https://github.com/dotzero/pad/actions/workflows/ci.yml)
4-
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/dotzero/pad/blob/master/LICENSE)
3+
A dead-simple shared text pad.
54

6-
Pad is a standalone version of Cloud Notepad that lets you share text through unique links.
5+
Paste text, get a link, share it with anyone.
76

8-
Data is stored in [BoltDB](https://github.com/etcd-io/bbolt) files under `BOLT_PATH`.
7+
> Unlike pastebin-like services, every shared page remains editable, making Pad feel more like a lightweight internet clipboard than a publishing platform. No accounts, no permissions, no formatting controls, and no unnecessary features.
8+
9+
Just write, copy the URL, and send it to whoever needs the information.
10+
11+
## Features
12+
13+
* Instant text sharing via unique URLs
14+
* No registration or login
15+
* Minimalist interface focused entirely on content
16+
* Works as a personal or shared internet clipboard
917

1018
![](./static/images/screenshot.png)
1119

β€Žapp/mux.goβ€Ž

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,31 @@ func (a *App) routes() chi.Router {
3232
router.Use(middleware.Recoverer)
3333
router.Use(middleware.RedirectSlashes)
3434

35-
router.Get("/", handlers.Redirect(a.Storage, a.HashEncoder))
36-
router.Get("/raw/{padname}", handlers.Raw(a.Storage))
37-
router.Get("/{padname}", handlers.Get(a.Storage, a.Templates.Lookup("main.html")))
38-
router.Post("/{padname}", handlers.Set(a.Storage))
39-
4035
router.Get("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
4136
render.PlainText(w, r, "User-agent: *\n")
4237
})
4338

44-
router.Get("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
45-
http.ServeFile(w, r, filepath.Join(a.StaticPath, "/favicon.ico"))
46-
})
39+
favicon := faviconHandler(a.StaticPath)
40+
router.Get("/favicon.ico", favicon)
41+
router.Get("/favicon.png", favicon)
4742

4843
// file server for static content from /assets
4944
fileServer(router, "/assets", http.Dir(a.StaticPath))
5045

46+
router.Get("/", handlers.Redirect(a.Storage, a.HashEncoder))
47+
router.Get("/raw/{padname}", handlers.Raw(a.Storage))
48+
router.Get("/{padname}", handlers.Get(a.Storage, a.Templates.Lookup("main.html")))
49+
router.Post("/{padname}", handlers.Set(a.Storage))
50+
5151
return router
5252
}
5353

54+
func faviconHandler(staticPath string) http.HandlerFunc {
55+
return func(w http.ResponseWriter, r *http.Request) {
56+
http.ServeFile(w, r, filepath.Join(staticPath, "favicon.png"))
57+
}
58+
}
59+
5460
func fileServer(r chi.Router, path string, root http.FileSystem) {
5561
origPath := path
5662
fs := http.StripPrefix(path, http.FileServer(root))

β€Žstatic/favicon.icoβ€Ž

-318 Bytes
Binary file not shown.

β€Žstatic/favicon.pngβ€Ž

22.2 KB
Loading

β€Žstatic/logo.pngβ€Ž

49.3 KB
Loading

β€Žtemplates/main.htmlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>{{ .Padname }} β€” Pad</title>
8-
<link href="/favicon.ico" rel="shortcut icon" type="image/ico" />
8+
<link href="/favicon.png" rel="icon" type="image/png" />
99
<link href="/assets/css/normalize.css" rel="stylesheet" media="screen" />
1010
<link href="/assets/css/application.css" rel="stylesheet" media="screen" />
1111
<link href="/assets/css/print.css" rel="stylesheet" media="print" />

0 commit comments

Comments
Β (0)