diff options
author | Feuerfuchs <git@feuerfuchs.dev> | 2019-06-05 13:52:59 +0200 |
---|---|---|
committer | Feuerfuchs <git@feuerfuchs.dev> | 2019-06-05 13:52:59 +0200 |
commit | c55e859bd93016f7246ea62984f7eaa02a325736 (patch) | |
tree | e4729c569fb905f069ed8520f7dfce6cf280d10a | |
parent | Fix selection color in Chrome (diff) | |
download | gopherproxy-c55e859bd93016f7246ea62984f7eaa02a325736.tar.gz gopherproxy-c55e859bd93016f7246ea62984f7eaa02a325736.tar.bz2 gopherproxy-c55e859bd93016f7246ea62984f7eaa02a325736.zip |
Updated font handling
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | assets/iosevka-term-ss03-regular.woff | bin | 0 -> 12332 bytes | |||
-rw-r--r-- | assets/iosevka-term-ss03-regular.woff2 | bin | 0 -> 10024 bytes | |||
-rw-r--r-- | css/main.scss | 10 | ||||
-rw-r--r-- | fonts/iosevka-term-ss03-regular.ttf | bin | 0 -> 396468 bytes | |||
-rw-r--r-- | glyphs.txt | 1 | ||||
-rw-r--r-- | go.mod | 1 | ||||
-rw-r--r-- | go.sum | 60 | ||||
-rw-r--r-- | gopherproxy.go | 27 | ||||
-rw-r--r-- | style.go | 2 | ||||
-rw-r--r-- | template.go | 2 |
11 files changed, 101 insertions, 4 deletions
@@ -8,6 +8,8 @@ dev: build | |||
8 | build: clean | 8 | build: clean |
9 | sassc -t compressed css/main.scss style.go | 9 | sassc -t compressed css/main.scss style.go |
10 | sed -i "s/.*/package gopherproxy\n\nvar styletext = \`&\`/" style.go | 10 | sed -i "s/.*/package gopherproxy\n\nvar styletext = \`&\`/" style.go |
11 | pyftsubset fonts/iosevka-term-ss03-regular.ttf --name-IDs+=0,4,6 --text-file=glyphs.txt --flavor='woff' --output-file='assets/iosevka-term-ss03-regular.woff' | ||
12 | pyftsubset fonts/iosevka-term-ss03-regular.ttf --name-IDs+=0,4,6 --text-file=glyphs.txt --flavor='woff2' --output-file='assets/iosevka-term-ss03-regular.woff2' | ||
11 | go build -o ./gopherproxy ./cmd/gopherproxy/main.go | 13 | go build -o ./gopherproxy ./cmd/gopherproxy/main.go |
12 | 14 | ||
13 | profile: | 15 | profile: |
diff --git a/assets/iosevka-term-ss03-regular.woff b/assets/iosevka-term-ss03-regular.woff new file mode 100644 index 0000000..498d93d --- /dev/null +++ b/assets/iosevka-term-ss03-regular.woff | |||
Binary files differ | |||
diff --git a/assets/iosevka-term-ss03-regular.woff2 b/assets/iosevka-term-ss03-regular.woff2 new file mode 100644 index 0000000..233b497 --- /dev/null +++ b/assets/iosevka-term-ss03-regular.woff2 | |||
Binary files differ | |||
diff --git a/css/main.scss b/css/main.scss index 75a6609..b5a872a 100644 --- a/css/main.scss +++ b/css/main.scss | |||
@@ -9,6 +9,14 @@ $link-visited: $text; | |||
9 | $sel-background: rgba($accent, .996); | 9 | $sel-background: rgba($accent, .996); |
10 | $sel-text: #000; | 10 | $sel-text: #000; |
11 | 11 | ||
12 | @font-face { | ||
13 | font-family: 'Iosevka Term SS03'; | ||
14 | font-style: normal; | ||
15 | font-weight: normal; | ||
16 | src: url('/iosevka-term-ss03-regular.woff2') format('woff2'), | ||
17 | url('/iosevka-term-ss03-regular.woff') format('woff'); | ||
18 | } | ||
19 | |||
12 | body { | 20 | body { |
13 | margin: 0; | 21 | margin: 0; |
14 | padding: 0; | 22 | padding: 0; |
@@ -33,7 +41,7 @@ body { | |||
33 | margin: 0; | 41 | margin: 0; |
34 | padding: 2em 1em; | 42 | padding: 2em 1em; |
35 | text-align: left; | 43 | text-align: left; |
36 | font-family: 'IBM Plex Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Droid Sans Mono', Monaco, Consolas, Courier, monospace; | 44 | font-family: 'Iosevka Term SS03', 'IBM Plex Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Droid Sans Mono', Monaco, Consolas, Courier, monospace; |
37 | font-size: 1em; | 45 | font-size: 1em; |
38 | line-height: 1.5; | 46 | line-height: 1.5; |
39 | } | 47 | } |
diff --git a/fonts/iosevka-term-ss03-regular.ttf b/fonts/iosevka-term-ss03-regular.ttf new file mode 100644 index 0000000..b621842 --- /dev/null +++ b/fonts/iosevka-term-ss03-regular.ttf | |||
Binary files differ | |||
diff --git a/glyphs.txt b/glyphs.txt new file mode 100644 index 0000000..1f4af23 --- /dev/null +++ b/glyphs.txt | |||
@@ -0,0 +1 @@ | |||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~äöüÄÖÜßẞ↓↙←↖↑↗→↘ | |||
@@ -1,6 +1,7 @@ | |||
1 | module git.feuerfuchs.dev/Feuerfuchs/gopherproxy | 1 | module git.feuerfuchs.dev/Feuerfuchs/gopherproxy |
2 | 2 | ||
3 | require ( | 3 | require ( |
4 | github.com/gobuffalo/packr v1.25.0 | ||
4 | github.com/prologic/go-gopher v0.0.0-20181230133552-0c68ed5f58b0 | 5 | github.com/prologic/go-gopher v0.0.0-20181230133552-0c68ed5f58b0 |
5 | github.com/temoto/robotstxt v0.0.0-20180810133444-97ee4a9ee6ea | 6 | github.com/temoto/robotstxt v0.0.0-20180810133444-97ee4a9ee6ea |
6 | ) | 7 | ) |
@@ -1,9 +1,69 @@ | |||
1 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
1 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | 2 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= |
3 | github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= | ||
4 | github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= | ||
5 | github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= | ||
6 | github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= | ||
7 | github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= | ||
8 | github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= | ||
9 | github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= | ||
10 | github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= | ||
11 | github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= | ||
12 | github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= | ||
13 | github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= | ||
14 | github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= | ||
15 | github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= | ||
16 | github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= | ||
17 | github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0 h1:P6naWPiHm/7R3eYx/ub3VhaW9G+1xAMJ6vzACePaGPI= | ||
18 | github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= | ||
19 | github.com/gobuffalo/packr v1.25.0 h1:NtPK45yOKFdTKHTvRGKL+UIKAKmJVWIVJOZBDI/qEdY= | ||
20 | github.com/gobuffalo/packr v1.25.0/go.mod h1:NqsGg8CSB2ZD+6RBIRs18G7aZqdYDlYNNvsSqP6T4/U= | ||
21 | github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= | ||
22 | github.com/gobuffalo/packr/v2 v2.1.0/go.mod h1:n90ZuXIc2KN2vFAOQascnPItp9A2g9QYSvYvS3AjQEM= | ||
23 | github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754 h1:tpom+2CJmpzAWj5/VEHync2rJGi+epHNIeRSWjzGA+4= | ||
24 | github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= | ||
25 | github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= | ||
26 | github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= | ||
27 | github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= | ||
28 | github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= | ||
29 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= | ||
30 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= | ||
31 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= | ||
32 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= | ||
33 | github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= | ||
34 | github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= | ||
35 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||
36 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= | ||
37 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||
2 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | 38 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= |
3 | github.com/prologic/go-gopher v0.0.0-20181230133552-0c68ed5f58b0 h1:10LO/S8HVjIuEHsHea//Cena1Ztgy23f/e8HFC0w5ow= | 39 | github.com/prologic/go-gopher v0.0.0-20181230133552-0c68ed5f58b0 h1:10LO/S8HVjIuEHsHea//Cena1Ztgy23f/e8HFC0w5ow= |
4 | github.com/prologic/go-gopher v0.0.0-20181230133552-0c68ed5f58b0/go.mod h1:LiuwIXz4es4YIUOD6yRv8mES9n9dFbe4z0+TcrLkhXg= | 40 | github.com/prologic/go-gopher v0.0.0-20181230133552-0c68ed5f58b0/go.mod h1:LiuwIXz4es4YIUOD6yRv8mES9n9dFbe4z0+TcrLkhXg= |
41 | github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | ||
42 | github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | ||
43 | github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= | ||
44 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | ||
45 | github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= | ||
46 | github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= | ||
47 | github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= | ||
48 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= | ||
49 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
50 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
5 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= | 51 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= |
52 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | ||
6 | github.com/temoto/robotstxt v0.0.0-20180810133444-97ee4a9ee6ea h1:hH8P1IiDpzRU6ZDbDh/RDnVuezi2oOXJpApa06M0zyI= | 53 | github.com/temoto/robotstxt v0.0.0-20180810133444-97ee4a9ee6ea h1:hH8P1IiDpzRU6ZDbDh/RDnVuezi2oOXJpApa06M0zyI= |
7 | github.com/temoto/robotstxt v0.0.0-20180810133444-97ee4a9ee6ea/go.mod h1:aOux3gHPCftJ3KHq6Pz/AlDjYJ7Y+yKfm1gU/3B0u04= | 54 | github.com/temoto/robotstxt v0.0.0-20180810133444-97ee4a9ee6ea/go.mod h1:aOux3gHPCftJ3KHq6Pz/AlDjYJ7Y+yKfm1gU/3B0u04= |
55 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= | ||
56 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | ||
8 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis= | 57 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis= |
9 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | 58 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= |
59 | golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= | ||
60 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||
61 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
62 | golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
63 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
64 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
65 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||
66 | golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= | ||
67 | golang.org/x/tools v0.0.0-20190404132500-923d25813098/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= | ||
68 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
69 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= | ||
diff --git a/gopherproxy.go b/gopherproxy.go index dc849d0..82215c5 100644 --- a/gopherproxy.go +++ b/gopherproxy.go | |||
@@ -14,6 +14,8 @@ import ( | |||
14 | "github.com/temoto/robotstxt" | 14 | "github.com/temoto/robotstxt" |
15 | 15 | ||
16 | "github.com/prologic/go-gopher" | 16 | "github.com/prologic/go-gopher" |
17 | |||
18 | "github.com/gobuffalo/packr" | ||
17 | ) | 19 | ) |
18 | 20 | ||
19 | type Item struct { | 21 | type Item struct { |
@@ -164,6 +166,23 @@ func RobotsTxtHandler(robotstxtdata []byte) http.HandlerFunc { | |||
164 | } | 166 | } |
165 | } | 167 | } |
166 | 168 | ||
169 | func FontHandler(woff2 bool, fontdata []byte) http.HandlerFunc { | ||
170 | return func(w http.ResponseWriter, req *http.Request) { | ||
171 | if fontdata == nil { | ||
172 | http.Error(w, "Not Found", http.StatusNotFound) | ||
173 | return | ||
174 | } | ||
175 | |||
176 | if woff2 { | ||
177 | w.Header().Set("Content-Type", "font/woff2") | ||
178 | } else { | ||
179 | w.Header().Set("Content-Type", "font/woff") | ||
180 | } | ||
181 | |||
182 | w.Write(fontdata) | ||
183 | } | ||
184 | } | ||
185 | |||
167 | // ListenAndServe creates a listening HTTP server bound to | 186 | // ListenAndServe creates a listening HTTP server bound to |
168 | // the interface specified by bind and sets up a Gopher to HTTP | 187 | // the interface specified by bind and sets up a Gopher to HTTP |
169 | // proxy proxying requests as requested and by default will prozy | 188 | // proxy proxying requests as requested and by default will prozy |
@@ -194,6 +213,10 @@ func ListenAndServe(bind, robotsfile, uri string) error { | |||
194 | styletext = string(styledata) | 213 | styletext = string(styledata) |
195 | } | 214 | } |
196 | 215 | ||
216 | box := packr.NewBox("./assets") | ||
217 | fontdataw, err := box.Find("iosevka-term-ss03-regular.woff") | ||
218 | fontdataw2, err := box.Find("iosevka-term-ss03-regular.woff2") | ||
219 | |||
197 | tpldata, err := ioutil.ReadFile(".template") | 220 | tpldata, err := ioutil.ReadFile(".template") |
198 | if err == nil { | 221 | if err == nil { |
199 | tpltext = string(tpldata) | 222 | tpltext = string(tpldata) |
@@ -212,7 +235,9 @@ func ListenAndServe(bind, robotsfile, uri string) error { | |||
212 | 235 | ||
213 | http.HandleFunc("/", GopherHandler(tpl, robotsdata, styletext, uri)) | 236 | http.HandleFunc("/", GopherHandler(tpl, robotsdata, styletext, uri)) |
214 | http.HandleFunc("/robots.txt", RobotsTxtHandler(robotstxtdata)) | 237 | http.HandleFunc("/robots.txt", RobotsTxtHandler(robotstxtdata)) |
215 | // http.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.Dir("assets/")))) | 238 | http.HandleFunc("/iosevka-term-ss03-regular.woff", FontHandler(false, fontdataw)) |
239 | http.HandleFunc("/iosevka-term-ss03-regular.woff2", FontHandler(true, fontdataw2)) | ||
240 | //http.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.Dir("assets/")))) | ||
216 | 241 | ||
217 | return http.ListenAndServe(bind, nil) | 242 | return http.ListenAndServe(bind, nil) |
218 | } | 243 | } |
@@ -1,3 +1,3 @@ | |||
1 | package gopherproxy | 1 | package gopherproxy |
2 | 2 | ||
3 | var styletext = `body{margin:0;padding:0;background-color:#14171a;color:#cad1d8}.wrap{text-align:center}.content{display:inline-block;min-width:50em;min-width:85ch;margin:0;padding:2em 1em;text-align:left;font-family:'IBM Plex Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Droid Sans Mono', Monaco, Consolas, Courier, monospace;font-size:1em;line-height:1.5}::selection{color:#000;background-color:rgba(239,198,138,0.996)}:link{color:#fff}:visited{color:#cad1d8}.link-type{color:#929ba3}` | 3 | var styletext = `@font-face{font-family:'Iosevka Term SS03';font-style:normal;font-weight:normal;src:url("/iosevka-term-ss03-regular.woff2") format("woff2"),url("/iosevka-term-ss03-regular.woff") format("woff")}body{margin:0;padding:0;background-color:#14171a;color:#cad1d8}.wrap{text-align:center}.content{display:inline-block;min-width:50em;min-width:85ch;margin:0;padding:2em 1em;text-align:left;font-family:'Iosevka Term SS03', 'IBM Plex Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Droid Sans Mono', Monaco, Consolas, Courier, monospace;font-size:1em;line-height:1.5}::selection{color:#000;background-color:rgba(239,198,138,0.996)}:link{color:#fff}:visited{color:#cad1d8}.link-type{color:#929ba3}` |
diff --git a/template.go b/template.go index 6e541e2..81730a6 100644 --- a/template.go +++ b/template.go | |||
@@ -14,7 +14,7 @@ var tpltext = `<!doctype html> | |||
14 | <body> | 14 | <body> |
15 | <main class="wrap"> | 15 | <main class="wrap"> |
16 | <pre class="content"> | 16 | <pre class="content"> |
17 | {{if .Lines}}{{range .Lines}} {{if .Link}}<span class="link-type">({{.Type}})</span> <a class="link link-{{ .Type }}" href="{{.Link}}">{{.Text}}</a>{{else}} {{.Text}}{{end}} | 17 | {{if .Lines}}{{range .Lines}} {{if .Link}}<span class="link-type"> {{.Type}} </span> <a class="link link-{{ .Type }}" href="{{.Link}}">{{.Text}}</a>{{else}} {{.Text}}{{end}} |
18 | {{end}}{{else}}{{.RawText}}{{end}}</pre> | 18 | {{end}}{{else}}{{.RawText}}{{end}}</pre> |
19 | </main> | 19 | </main> |
20 | <script type="text/javascript"> | 20 | <script type="text/javascript"> |