diff options
-rw-r--r-- | config.json | 7 | ||||
-rw-r--r-- | config.toml | 6 | ||||
-rw-r--r-- | config.yaml | 4 | ||||
-rw-r--r-- | themes/default/layouts/_default/single.plain.txt | 1 | ||||
-rw-r--r-- | themes/default/layouts/partials/meta-context-menu.html | 23 | ||||
-rw-r--r-- | themes/default/layouts/partials/meta-view.html | 13 |
6 files changed, 41 insertions, 13 deletions
diff --git a/config.json b/config.json index 938286d..e7948bf 100644 --- a/config.json +++ b/config.json @@ -181,6 +181,10 @@ "baseName": "index", "mediaType": "text/html" }, + "plain": { + "baseName": "index", + "mediaType": "text/plain" + }, "json": { "baseName": "index", "mediaType": "application/json" @@ -248,7 +252,8 @@ "rss" ], "page": [ - "html" + "html", + "plain" ] }, "caches": { diff --git a/config.toml b/config.toml index 5171bd0..99fde46 100644 --- a/config.toml +++ b/config.toml @@ -128,6 +128,10 @@ enableRobotsTXT = true baseName = "index" mediaType = "text/html" + [outputFormats.plain] + baseName = "index" + mediaType = "text/plain" + [outputFormats.json] baseName = "index" mediaType = "application/json" @@ -173,7 +177,7 @@ enableRobotsTXT = true section = ["html", "rss"] taxonomy = ["html", "rss"] term = ["html", "rss"] - page = ["html"] + page = ["html", "plain"] [caches] diff --git a/config.yaml b/config.yaml index 5cdc657..b14283e 100644 --- a/config.yaml +++ b/config.yaml @@ -116,6 +116,9 @@ outputFormats: html: baseName: index mediaType: text/html + plain: + baseName: index + mediaType: text/plain json: baseName: index mediaType: application/json @@ -171,6 +174,7 @@ outputs: - rss page: - html + - plain caches: assets: diff --git a/themes/default/layouts/_default/single.plain.txt b/themes/default/layouts/_default/single.plain.txt new file mode 100644 index 0000000..d110b5e --- /dev/null +++ b/themes/default/layouts/_default/single.plain.txt @@ -0,0 +1 @@ +{{- .Content | plainify | htmlUnescape -}} diff --git a/themes/default/layouts/partials/meta-context-menu.html b/themes/default/layouts/partials/meta-context-menu.html index 7269262..1edf80e 100644 --- a/themes/default/layouts/partials/meta-context-menu.html +++ b/themes/default/layouts/partials/meta-context-menu.html @@ -1,18 +1,33 @@ -{{- $id := delimit (shuffle (seq 1 7)) "" -}} +{{- $id := delimit (shuffle (seq 1 7)) "" -}} +{{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}} +{{- $href := print .Site.BaseURL "/" $author.user "/messages/" (path.Base .Permalink) "/" -}} +{{- $plain := print .Site.BaseURL "/" $author.user "/messages/" (path.Base .Permalink) "/index.txt" -}} + +{{- with .Params.feed.self -}} + {{- $href = print $.Site.BaseURL "/" $.Params.feed.self -}} + {{- $plain = print $.Site.BaseURL "/" $.Params.feed.self "/index.txt" -}} +{{- end -}} + <micro-metadata-menu> <context-control> <label for="context-metadata-{{ $id }}"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-down-circle.svg")) }} + {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-down-circle.svg")) -}} <span>menu</span> </label> <input hidden type="checkbox" id="context-metadata-{{ $id }}" /> <context-menu right> {{- partial "meta-markdown.html" . -}} {{- partial "meta-permalink.html" . -}} + <micro-metadata-plain> + <a href="{{ $plain }}"> + {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/file-text.svg")) -}} + <span>plaintext</span> + </a> + </micro-metadata-plain> <micro-metadata-datetime> - <a title="{{ .Date.Local | time.Format "3:04 PM Jan 2 2006" -}}"> + <a title="{{ .Date.Local | time.Format "3:04 PM Jan 2 2006" -}}" href="{{ $href }}"> {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/calendar.svg")) -}} - {{ .Date.Local | time.Format "Jan 2 2006" | lower -}} + <span>{{ .Date.Local | time.Format "Jan 2 2006" | lower -}}</span> </a> </micro-metadata-datetime> </context-menu> diff --git a/themes/default/layouts/partials/meta-view.html b/themes/default/layouts/partials/meta-view.html index d76798d..a327f78 100644 --- a/themes/default/layouts/partials/meta-view.html +++ b/themes/default/layouts/partials/meta-view.html @@ -1,14 +1,13 @@ {{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}} +{{- $href := print .Site.BaseURL "/" $author.user "/messages/" (path.Base .Permalink) "/" -}} + +{{- with .Params.feed.self -}} + {{- $href = print $.Site.BaseURL "/" $.Params.feed.self -}} +{{- end -}} <micro-metadata-view> {{- /* This comment removes trailing newlines and white spaces. */ -}} - <a - {{ with .Params.feed.self -}} - href="{{ $.Site.BaseURL }}/{{ . }}" - {{ else }} - href="{{ .Site.BaseURL }}/{{ $author.user }}/messages/{{ path.Base .Permalink }}/#{{ partial "card-id.html" . }}" - {{ end }} - > + <a href="{{ $href }}"> {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/external-link.svg")) -}} <span>view</span> {{- /* This comment removes trailing newlines and white spaces. */ -}} |