mirror of
https://github.com/miniflux/v2.git
synced 2025-08-26 18:21:01 +00:00
feat(template): show GitHub links in about page only when tag and commit are available
This commit is contained in:
parent
6bf3b3c464
commit
a654a5f710
3 changed files with 18 additions and 3 deletions
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
|||
APP := miniflux
|
||||
DOCKER_IMAGE := miniflux/miniflux
|
||||
VERSION := $(shell git describe --tags --abbrev=0 2>/dev/null)
|
||||
VERSION := $(shell git describe --tags --exact-match 2>/dev/null)
|
||||
LD_FLAGS := "-s -w -X 'miniflux.app/v2/internal/version.Version=$(VERSION)'"
|
||||
PKG_LIST := $(shell go list ./... | grep -v /vendor/)
|
||||
DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable
|
||||
|
|
|
@ -32,6 +32,7 @@ type funcMap struct {
|
|||
// Map returns a map of template functions that are compiled during template parsing.
|
||||
func (f *funcMap) Map() template.FuncMap {
|
||||
return template.FuncMap{
|
||||
"startsWith": strings.HasPrefix,
|
||||
"formatFileSize": formatFileSize,
|
||||
"dict": dict,
|
||||
"truncate": truncate,
|
||||
|
|
|
@ -11,9 +11,23 @@
|
|||
<div class="panel">
|
||||
<h3>Miniflux</h3>
|
||||
<ul>
|
||||
<li><strong>{{ t "page.about.version" }}</strong> <a href="https://github.com/miniflux/v2/releases/tag/{{ .version }}">{{ .version }}</a></li>
|
||||
<li>
|
||||
<strong>{{ t "page.about.version" }}</strong>
|
||||
{{ if startsWith .version "2." }}
|
||||
<a href="https://github.com/miniflux/v2/releases/tag/{{ .version }}">{{ .version }}</a>
|
||||
{{ else }}
|
||||
{{ .version }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ if .commit }}
|
||||
<li><strong>{{ t "page.about.git_commit" }}</strong> <a href="https://github.com/miniflux/v2/commit/{{ .commit }}">{{ .commit }}</a></li>
|
||||
<li>
|
||||
<strong>{{ t "page.about.git_commit" }}</strong>
|
||||
{{ if startsWith .commit "Unknown" }}
|
||||
{{ .commit }}
|
||||
{{ else }}
|
||||
<a href="https://github.com/miniflux/v2/commit/{{ .commit }}">{{ .commit }}</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
<li><strong>{{ t "page.about.build_date" }}</strong> {{ .build_date }}</li>
|
||||
<li><strong>{{t "page.about.go_version" }}</strong> {{ .go_version }}</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue