Ver a proveniência

add dates to posts on collections w/ blog format

T669-date-stamps
Rob Loranger há 4 anos
ascendente
cometimento
9c3bee8a7d
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: D6F1633A4F0903B8
3 ficheiros alterados com 33 adições e 7 eliminações
  1. +2
    -0
      posts.go
  2. +9
    -5
      templates/chorus-collection-post.tmpl
  3. +22
    -2
      templates/collection-post.tmpl

+ 2
- 0
posts.go Ver ficheiro

@@ -1380,12 +1380,14 @@ Are you sure it was ever here?`,
IsFound bool
IsAdmin bool
CanInvite bool
ShowDates bool
}{
PublicPost: p,
StaticPage: pageForReq(app, r),
IsOwner: cr.isCollOwner,
IsCustomDomain: cr.isCustomDomain,
IsFound: postFound,
ShowDates: c.NewFormat().ShowDates(),
}
tp.IsAdmin = u != nil && u.IsAdmin()
tp.CanInvite = canUserInvite(app.cfg, tp.IsAdmin)


+ 9
- 5
templates/chorus-collection-post.tmpl Ver ficheiro

@@ -38,16 +38,16 @@ body footer {
body#post header {
padding: 1em 1rem;
}
article time.dt-published {
article time.dt {
display: block;
}
article time.dt.published {
color: #666;
margin-bottom: 1em;
}
body#post article h2#title{
margin-bottom: 0.5em;
}
article time.dt-published {
margin-bottom: 1em;
}
</style>

{{if .Collection.RenderMathJax}}
@@ -65,7 +65,11 @@ article time.dt-published {

{{template "user-navigation" .}}
<article id="post-body" class="{{.Font}} h-entry">{{if .IsScheduled}}<p class="badge">Scheduled</p>{{end}}{{if .Title.String}}<h2 id="title" class="p-name">{{.FormattedDisplayTitle}}</h2>{{end}}{{/* TODO: check format: if .Collection.Format.ShowDates*/}}<time class="dt-published" datetime="{{.Created}}" pubdate itemprop="datePublished" content="{{.Created}}">{{.DisplayDate}}</time><div class="e-content">{{.HTMLContent}}</div></article>
<article id="post-body" class="{{.Font}} h-entry">
{{if .IsScheduled}}<p class="badge">Scheduled</p>{{end}}
{{if .Title.String}}<h2 id="title" class="p-name">{{.FormattedDisplayTitle}}</h2>{{end}}
{{if .ShowDates}}<time class="dt{{if .Title.String}} published{{end}}" datetime="{{.Created}}" pubdate itemprop="datePublished" content="{{.Created}}">{{.DisplayDate}}</time>{{end}}
<div class="e-content">{{.HTMLContent}}</div></article>

{{ if .Collection.ShowFooterBranding }}
<footer dir="ltr">


+ 22
- 2
templates/collection-post.tmpl Ver ficheiro

@@ -32,7 +32,22 @@
<meta property="article:published_time" content="{{.Created8601}}">
{{ end }}
{{if .Collection.StyleSheet}}<style type="text/css">{{.Collection.StyleSheetDisplay}}</style>{{end}}

{{/*below css duplicated in part in chorus-collection-post.tmpl*/}}
<style type="text/css">
body#post header {
padding: 1em 1rem;
}
article time.dt {
display: block;
}
article time.dt.published {
color: #666;
margin-bottom: 1em;
}
body#post article h2#title{
margin-bottom: 0.5em;
}
</style>
{{if .Collection.RenderMathJax}}
<!-- Add mathjax logic -->
{{template "mathjax" . }}
@@ -59,7 +74,12 @@
</nav>
</header>
<article id="post-body" class="{{.Font}} h-entry {{if not .IsFound}}error-page{{end}}">{{if .IsScheduled}}<p class="badge">Scheduled</p>{{end}}{{if .Title.String}}<h2 id="title" class="p-name">{{.FormattedDisplayTitle}}</h2>{{end}}<div class="e-content">{{.HTMLContent}}</div></article>
<article id="post-body" class="{{.Font}} h-entry {{if not .IsFound}}error-page{{end}}">
{{if .IsScheduled}}<p class="badge">Scheduled</p>{{end}}
{{if .Title.String}}<h2 id="title" class="p-name">{{.FormattedDisplayTitle}}</h2>{{end}}
{{if .ShowDates}}<time class="dt{{if .Title.String}} published{{end}}" datetime="{{.Created}}" pubdate itemprop="datePublished" content="{{.Created}}">{{.DisplayDate}}</time>{{end}}
<div class="e-content">{{.HTMLContent}}</div>
</article>

{{ if .Collection.ShowFooterBranding }}
<footer dir="ltr"><hr><nav><p style="font-size: 0.9em">{{localhtml "published with write.as" .Language.String}}</p></nav></footer>


Carregando…
Cancelar
Guardar