mirror of
https://github.com/thebaer/tildes.git
synced 2018-07-20 07:15:21 +00:00
Graphical host names, e.g. tilde -> ~
This commit is contained in:
parent
9817f4053d
commit
93b265c2e1
7
code.go
7
code.go
@ -60,6 +60,11 @@ type Page struct {
|
||||
UpdatedForHumans string
|
||||
}
|
||||
|
||||
func graphicalName(n string) string {
|
||||
r := strings.NewReplacer("tilde", "~", "ctrl-c", "^C", "nuclear", "☢")
|
||||
return r.Replace(n)
|
||||
}
|
||||
|
||||
func generate(users map[string]User) {
|
||||
fmt.Println("Generating page.")
|
||||
|
||||
@ -83,7 +88,7 @@ func generate(users map[string]User) {
|
||||
updated := curTime.Format(time.RFC3339)
|
||||
|
||||
// Generate the page
|
||||
page := &Page{Host: host, UpdatedForHumans: updatedReadable, Updated: updated, Users: users}
|
||||
page := &Page{Host: graphicalName(host), UpdatedForHumans: updatedReadable, Updated: updated, Users: users}
|
||||
template.ExecuteTemplate(w, "code", page)
|
||||
w.Flush()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user