aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-02-16 21:40:46 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-02-16 21:40:46 +0100
commit94a7c57e5cb7be5bc1e8f2369c36a78c2abfb4e9 (patch)
tree1c00852459bf6d4ed85bcf78a360c730f36862a7
parent237b69932fa8afbe1ff59b0710537dad21fac2fc (diff)
Tweak colors
-rw-r--r--parse.go14
-rw-r--r--tmpl/root5
2 files changed, 14 insertions, 5 deletions
diff --git a/parse.go b/parse.go
index a6f2f3b..d828c78 100644
--- a/parse.go
+++ b/parse.go
@@ -14,17 +14,21 @@ var (
imglink = regexp.MustCompile(`\.(jpe?g|png|gif)$`)
)
-func lines(in string) []string {
- li := strings.Split(in, "\r\n")
- for i, l := range li {
- li[i] = l[1:]
+func lines(in string) (ret []string) {
+ for _, l := range strings.Split(in, "\r\n") {
+ if len(l) > 1 {
+ ret = append(ret, l[1:])
+ }
}
- return li
+ return
}
func (p Page) HTML() string {
buf := new(bytes.Buffer)
for _, v := range strings.Split(string(p.Body), "\r\n\r\n") {
+ if len(v) < 1 {
+ continue
+ }
v = intlink.ReplaceAllStringFunc(v, func(s string) string {
tmp := new(bytes.Buffer)
doc.ExecuteTemplate(tmp, "link", s[1:len(s)-1])
diff --git a/tmpl/root b/tmpl/root
index eab7b55..f8dc030 100644
--- a/tmpl/root
+++ b/tmpl/root
@@ -13,10 +13,15 @@
}
h1 {
font-family: 'Raleway', sans-serif;
+ color: #F50;
}
pre {
font-family: 'Anonymous Pro', monospace;
}
+ a {
+ color: #05A;
+ text-decoration: none;
+ }
</style>
</head>
<body>