]> Sergey Matveev's repositories - sgblog.git/commitdiff
Less duplicate links and entities
authorSergey Matveev <stargrave@stargrave.org>
Wed, 4 Feb 2026 13:00:32 +0000 (16:00 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 4 Feb 2026 15:36:20 +0000 (18:36 +0300)
cmd/sgblog/http-entry.tmpl
cmd/sgblog/http-index.tmpl
internal/version.go

index 3693057f9499cda79a569743b2e89b451ffbf277..83bfc242cd29fd396da0bed6fb51d4b1b6abf164 100644 (file)
@@ -1,30 +1,25 @@
 <!DOCTYPE html>
 <html>
 <head>
-       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-       <meta name="generator" content="SGBlog {{.Version}}">
-       <title>{{.Title}} ({{.When}})</title>
-       {{with .Cfg.CSS}}<link rel="stylesheet" type="text/css" href="{{.}}">{{end}}
-       {{with .Cfg.Webmaster}}<link rev="made" href="mailto:{{.}}">{{end -}}
+       <meta http-equiv=Content-Type content="text/html; charset=utf-8">
+       <meta name=created content="{{.When}}">
+       <meta name=revision content={{.Commit.Hash.String}}>
+       <meta name=generator content="SGBlog {{.Version}}">
+       <title>{{.Title}}</title>
+       {{with .Cfg.CSS}}<link rel=stylesheet type="text/css" href="{{.}}">{{end}}
+       {{with .Cfg.Webmaster}}<link rev=made href="mailto:{{.}}">{{end -}}
        {{- range .Cfg.GitURLs}}
-       <link rel="vcs-git" href="{{.}}" title="{{$.T.Get "Git repository"}}">{{end}}
-       <link rel="top" href="{{.Cfg.URLPrefix}}/" title="{{$.T.Get "top"}}">
-       <link rel="alternate" title="{{$.T.Get "Comments feed"}}" href="{{.AtomCommentsURL}}" type="application/atom+xml">
-       {{if .Parent}}<link rel="prev" href="{{.Cfg.URLPrefix}}/{{.Parent}}" title="{{$.T.Get "prev"}}">{{end}}
+       <link rel=vcs-git href="{{.}}" title="{{$.T.Get "Git repository"}}">{{end}}
+       <link rel=alternate title="{{$.T.Get "Comments feed"}}" href="{{.AtomCommentsURL}}" type="application/atom+xml">
+       {{with .Cfg.AboutURL}}<link rel=home href="{{.}}" title="{{$.T.Get "about"}}">{{end}}
+       <link rel=top href="{{.Cfg.URLPrefix}}/" title="{{$.T.Get "top"}}">
+       {{if .Parent}}<link rel=prev href="{{.Cfg.URLPrefix}}/{{.Parent}}" title="{{$.T.Get "prev"}}">{{end}}
 </head>
 <body>
-{{with .Cfg.AboutURL}}[<a href="{{.}}">{{$.T.Get "about"}}</a>]{{end}}
-[<a href="{{.Cfg.URLPrefix}}/">{{$.T.Get "top"}}</a>]
-{{if .Parent}}[<a href="{{.Cfg.URLPrefix}}/{{.Parent}}">{{$.T.Get "prev"}}</a>]{{end}}
-[<tt><a title="{{$.T.Get "When"}}">{{.When}}</a></tt>]
-[<tt><a title="{{$.T.Get "What"}}">{{.Commit.Hash.String}}</a></tt>]
-
 {{if .Topics}}
-<hr/>
 {{$.T.Get "Topics"}}: {{range .Topics}}[<tt><a href="{{$.Cfg.URLPrefix}}/?topic={{.}}">{{.}}</a></tt>]{{end}}
 {{end}}
 
-<hr/>
 <h2>{{.Title}}</h2>
 <pre>
 {{range .Lines}}{{. | lineURLize $.Cfg.URLPrefix}}
index 4bff19b6f01e3ebfcf85d3480e67b558f4ceb218..aca42fdbc7672b814811e33fd8a686c680d2d7fb 100644 (file)
@@ -1,24 +1,20 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <meta name="generator" content="SGBlog {{.Version}}">
-    <title>{{.Cfg.Title}} {{if .Topic}}(topic: {{.Topic}}) {{end}}({{.Offset}}-{{.OffsetNext}})</title>
-    {{with .Cfg.CSS}}<link rel="stylesheet" type="text/css" href="{{.}}">{{end}}
-    {{with .Cfg.Webmaster}}<link rev="made" href="mailto:{{.}}">{{end}}
-    {{range .Cfg.GitURLs}}<link rel="vcs-git" href="{{.}}" title="{{$.T.Get "Git repository"}}">{{end}}
-    <link rel="top" href="{{.Cfg.URLPrefix}}/" title="{{$.T.Get "top"}}">
-    <link rel="alternate" title="{{$.T.Get "Posts feed"}}" href="{{.Cfg.AtomBaseURL}}{{.Cfg.URLPrefix}}/{{.AtomPostsFeed}}{{if .Topic}}?topic={{.Topic}}{{end}}" type="application/atom+xml">
-    {{if .CommentsEnabled}}<link rel="alternate" title="{{$.T.Get "Comments feed"}}" href="{{.Cfg.AtomBaseURL}}{{.Cfg.URLPrefix}}/{{.AtomCommentsFeed}}" type="application/atom+xml">{{end}}
-    {{if .Offset}}<link rel="prev" href="{{.Cfg.URLPrefix}}/?offset={{.OffsetPrev}}{{if .Topic}}&topic={{.Topic}}{{end}}" title="{{$.T.Get "prev"}}">{{end}}
-    {{if not .LogEnded}}<link rel="next" href="{{.Cfg.URLPrefix}}/?offset={{.OffsetNext}}{{if .Topic}}&topic={{.Topic}}{{end}}" title="{{$.T.Get "next"}}">{{end}}
+       <meta http-equiv=Content-Type content="text/html; charset=utf-8">
+       <meta name=generator content="SGBlog {{.Version}}">
+       <title>{{.Cfg.Title}} {{if .Topic}}(topic: {{.Topic}}) {{end}}({{.Offset}}-{{.OffsetNext}})</title>
+       {{with .Cfg.CSS}}<link rel=stylesheet type="text/css" href="{{.}}">{{end}}
+       {{with .Cfg.Webmaster}}<link rev=made href="mailto:{{.}}">{{end}}
+       {{range .Cfg.GitURLs}}<link rel=vcs-git href="{{.}}" title="{{$.T.Get "Git repository"}}">{{end}}
+       <link rel=alternate title="{{$.T.Get "Posts feed"}}" href="{{.Cfg.AtomBaseURL}}{{.Cfg.URLPrefix}}/{{.AtomPostsFeed}}{{if .Topic}}?topic={{.Topic}}{{end}}" type="application/atom+xml">
+       {{if .CommentsEnabled}}<link rel=alternate title="{{$.T.Get "Comments feed"}}" href="{{.Cfg.AtomBaseURL}}{{.Cfg.URLPrefix}}/{{.AtomCommentsFeed}}" type="application/atom+xml">{{end}}
+       {{with .Cfg.AboutURL}}<link rel=home href="{{.}}" title="{{$.T.Get "about"}}">{{end}}
+       <link rel=top href="{{.Cfg.URLPrefix}}/" title="{{$.T.Get "top"}}">
+       {{if .Offset}}<link rel=prev href="{{.Cfg.URLPrefix}}/?offset={{.OffsetPrev}}{{if .Topic}}&topic={{.Topic}}{{end}}" title="{{$.T.Get "prev"}}">{{end}}
+       {{if not .LogEnded}}<link rel=next href="{{.Cfg.URLPrefix}}/?offset={{.OffsetNext}}{{if .Topic}}&topic={{.Topic}}{{end}}" title="{{$.T.Get "next"}}">{{end}}
 </head>
 <body>
-{{with .Cfg.AboutURL}}[<a href="{{.}}">{{$.T.Get "about"}}</a>]{{end}}
-{{block "links" .}}
-{{if .Offset}}[<a href="{{.Cfg.URLPrefix}}/?offset={{.OffsetPrev}}{{if .Topic}}&topic={{.Topic}}{{end}}">{{$.T.Get "prev"}}</a>]{{end}}
-{{if not .LogEnded}}[<a href="{{.Cfg.URLPrefix}}/?offset={{.OffsetNext}}{{if .Topic}}&topic={{.Topic}}{{end}}">{{$.T.Get "next"}}</a>]{{end}}
-{{end}}
 {{if .Topics}}<hr/>
 {{$.T.Get "Topics"}}: [<tt><a href="{{$.Cfg.URLPrefix}}/">{{$.T.Get "ALL"}}</a></tt>]
 {{range .Topics}}[<tt><a href="{{$.Cfg.URLPrefix}}/?topic={{.}}">{{.}}</a></tt>]
 {{- $datePrev := "0001-01-01" -}}
 <table border=1>
 <tr>
-    <th>N</th><th>{{$.T.Get "When"}}</th><th>{{$.T.Get "Title"}}</th>
-    <th size="2%"><a title="{{$.T.Get "Lines"}}">L</a></th>
-    <th size="2%"><a title="{{$.T.Get "Images"}}">I</a></th>
-    <th size="2%"><a title="{{$.T.Get "Comments"}}">C</a></th>
-    <th>{{$.T.Get "Linked to"}}</th>
-    {{if .TopicsEnabled}}<th>{{$.T.Get "Topics"}}</th>{{end}}
+       <th>N</th><th>{{$.T.Get "When"}}</th><th>{{$.T.Get "Title"}}</th>
+       <th size="2%"><a title="{{$.T.Get "Lines"}}">L</a></th>
+       <th size="2%"><a title="{{$.T.Get "Images"}}">I</a></th>
+       <th size="2%"><a title="{{$.T.Get "Comments"}}">C</a></th>
+       <th>{{$.T.Get "Linked to"}}</th>
+       {{if .TopicsEnabled}}<th>{{$.T.Get "Topics"}}</th>{{end}}
 </tr>
 {{range .Entries -}}
 {{- $dateCur := .Commit.Author.When.Format "2006-01-02" -}}
 {{- if ne $dateCur $datePrev -}}
-    <tr><td colspan={{if $TopicsEnabled}}8{{else}}7{{end}}><center><tt>{{$dateCur}}</tt></center></td></tr>
-    {{- $datePrev = $dateCur -}}
+       <tr><td colspan={{if $TopicsEnabled}}8{{else}}7{{end}}><center><tt>{{$dateCur}}</tt></center></td></tr>
+       {{- $datePrev = $dateCur -}}
 {{- end -}}
 <tr>
-    <td>{{.Num}}</td>
-    <td><tt>{{.Commit.Author.When.Format "15:04"}}</tt></td>
-    <td><a href="{{$.Cfg.URLPrefix}}/{{.Commit.Hash.String}}">{{.Title}}</a></td>
-    <td>{{.LinesNum}}</td>
-    <td>{{if .ImagesNum}}{{.ImagesNum}}{{else}}&nbsp;{{end}}</td>
-    <td>{{if .CommentsNum}}{{.CommentsNum}}{{else}}&nbsp;{{end}}</td>
-    <td>{{if .DomainURLs}}{{range .DomainURLs}} {{.}} {{end}}{{else}}&nbsp;{{end}}</td>
-    {{if $TopicsEnabled}}<td>{{if .Topics}}{{range .Topics}} <a href="{{$.Cfg.URLPrefix}}/?topic={{.}}">{{.}}</a> {{end}}{{else}}&nbsp;{{end}}</td>{{end}}
+       <td>{{.Num}}</td>
+       <td><tt>{{.Commit.Author.When.Format "15:04"}}</tt></td>
+       <td><a href="{{$.Cfg.URLPrefix}}/{{.Commit.Hash.String}}">{{.Title}}</a></td>
+       <td>{{.LinesNum}}</td>
+       <td>{{if .ImagesNum}}{{.ImagesNum}}{{else}}&nbsp;{{end}}</td>
+       <td>{{if .CommentsNum}}{{.CommentsNum}}{{else}}&nbsp;{{end}}</td>
+       <td>{{if .DomainURLs}}{{range .DomainURLs}} {{.}} {{end}}{{else}}&nbsp;{{end}}</td>
+       {{if $TopicsEnabled}}<td>{{if .Topics}}{{range .Topics}} <a href="{{$.Cfg.URLPrefix}}/?topic={{.}}">{{.}}</a> {{end}}{{else}}&nbsp;{{end}}</td>{{end}}
 </tr>
 {{end}}</table>
-{{template "links" .}}
 </body>
 </html>
index 416ad4b0a23386170b957cefc35e46ac585b69fd..25aab34c9b4a291d199f86dd02b3c442fcc2a84e 100644 (file)
@@ -1,3 +1,3 @@
 package internal
 
-const Version = "0.37.0"
+const Version = "0.38.0"