diff options
Diffstat (limited to 'internal/port/tpl')
-rw-r--r-- | internal/port/tpl/gemini.html | 11 | ||||
-rw-r--r-- | internal/port/tpl/gopher.html | 2 | ||||
-rw-r--r-- | internal/port/tpl/startpage.html | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/internal/port/tpl/gemini.html b/internal/port/tpl/gemini.html index df50d50..8d20da1 100644 --- a/internal/port/tpl/gemini.html +++ b/internal/port/tpl/gemini.html | |||
@@ -35,11 +35,16 @@ | |||
35 | {{- else if eq .Type "REFLOW_TEXT" -}} | 35 | {{- else if eq .Type "REFLOW_TEXT" -}} |
36 | <div class="section"><p class="section__content">{{- .Text -}}</p></div> | 36 | <div class="section"><p class="section__content">{{- .Text -}}</p></div> |
37 | {{- else if eq .Type "LINK" -}} | 37 | {{- else if eq .Type "LINK" -}} |
38 | <div class="section"><span class="section__type">=></span><a class="section__content" href="{{ .URL }}">{{- .Text -}}</a></div> | 38 | {{- $linkCls := "link" -}} |
39 | {{- $url := string .URL -}} | ||
40 | {{- if or (hasSuffix $url ".jpg") (hasSuffix $url ".jpeg") (hasSuffix $url ".png") (hasSuffix $url ".gif") -}} | ||
41 | {{- $linkCls = "link--IMG" -}} | ||
42 | {{- end -}} | ||
43 | <div class="section"><span class="section__type"> =></span><a class="section__content {{ $linkCls }}" href="{{ .URL }}">{{- .Text -}}</a></div> | ||
39 | {{- else if eq .Type "HEADING_1" -}} | 44 | {{- else if eq .Type "HEADING_1" -}} |
40 | <div class="section"><span class="section__type">#</span><h1 class="section__content">{{- .Text -}}</h1></div> | 45 | <div class="section"><span class="section__type"> #</span><h1 class="section__content">{{- .Text -}}</h1></div> |
41 | {{- else if eq .Type "HEADING_2" -}} | 46 | {{- else if eq .Type "HEADING_2" -}} |
42 | <div class="section"><span class="section__type">##</span><h2 class="section__content">{{- .Text -}}</h2></div> | 47 | <div class="section"><span class="section__type"> ##</span><h2 class="section__content">{{- .Text -}}</h2></div> |
43 | {{- else if eq .Type "HEADING_3" -}} | 48 | {{- else if eq .Type "HEADING_3" -}} |
44 | <div class="section"><span class="section__type">###</span><h3 class="section__content">{{- .Text -}}</h3></div> | 49 | <div class="section"><span class="section__type">###</span><h3 class="section__content">{{- .Text -}}</h3></div> |
45 | {{- else if eq .Type "LIST" -}} | 50 | {{- else if eq .Type "LIST" -}} |
diff --git a/internal/port/tpl/gopher.html b/internal/port/tpl/gopher.html index 5436123..6eb607c 100644 --- a/internal/port/tpl/gopher.html +++ b/internal/port/tpl/gopher.html | |||
@@ -35,7 +35,7 @@ | |||
35 | {{- $page := . -}} | 35 | {{- $page := . -}} |
36 | {{- range .Lines -}} | 36 | {{- range .Lines -}} |
37 | {{- if .Link -}} | 37 | {{- if .Link -}} |
38 | <div class="section"><span class="section__type">{{- .Type -}}</span><a class="section__content" href="{{ .Link }}">{{- .Text -}}</a></div> | 38 | <div class="section"><span class="section__type">{{- .Type -}}</span><a class="section__content link link--{{ .Type }}" href="{{ .Link }}">{{- .Text -}}</a></div> |
39 | {{- else -}} | 39 | {{- else -}} |
40 | <div class="section"><span class="section__type"></span><pre class="section__content">{{- .Text -}}</pre></div> | 40 | <div class="section"><span class="section__type"></span><pre class="section__content">{{- .Text -}}</pre></div> |
41 | {{- end -}} | 41 | {{- end -}} |
diff --git a/internal/port/tpl/startpage.html b/internal/port/tpl/startpage.html index cfe519d..772ac90 100644 --- a/internal/port/tpl/startpage.html +++ b/internal/port/tpl/startpage.html | |||
@@ -18,7 +18,7 @@ | |||
18 | </header> | 18 | </header> |
19 | 19 | ||
20 | <main class="wrap"> | 20 | <main class="wrap"> |
21 | <pre class="content content--has-monospace-font"> | 21 | <pre class="content content--monospace"> |
22 | {{- .Content -}} | 22 | {{- .Content -}} |
23 | </pre> | 23 | </pre> |
24 | </main> | 24 | </main> |