From c772716e98e11181d301deadeca52856ac18f085 Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Mon, 18 May 2020 18:51:19 +0200 Subject: Improved Gemini support --- internal/port/tpl/gemini.html | 11 ++++++++--- internal/port/tpl/gopher.html | 2 +- internal/port/tpl/startpage.html | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'internal/port/tpl') 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 @@ {{- else if eq .Type "REFLOW_TEXT" -}}

{{- .Text -}}

{{- else if eq .Type "LINK" -}} -
=>{{- .Text -}}
+ {{- $linkCls := "link" -}} + {{- $url := string .URL -}} + {{- if or (hasSuffix $url ".jpg") (hasSuffix $url ".jpeg") (hasSuffix $url ".png") (hasSuffix $url ".gif") -}} + {{- $linkCls = "link--IMG" -}} + {{- end -}} +
=>{{- .Text -}}
{{- else if eq .Type "HEADING_1" -}} -
#

{{- .Text -}}

+
#

{{- .Text -}}

{{- else if eq .Type "HEADING_2" -}} -
##

{{- .Text -}}

+
##

{{- .Text -}}

{{- else if eq .Type "HEADING_3" -}}
###

{{- .Text -}}

{{- 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 @@ {{- $page := . -}} {{- range .Lines -}} {{- if .Link -}} -
{{- .Type -}}{{- .Text -}}
+
{{- .Type -}}{{- .Text -}}
{{- else -}}
{{- .Text -}}
{{- 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 @@
-
+			
         {{- .Content -}}
 			
-- cgit v1.2.3-70-g09d2