Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Rob Loranger
4662ddd304
move shared post css into core.less
also changes less function article-title to have a bottom margin of
0.5em as it was being reset on both post views. this also brings
anonymous posts into a consistent style with the rest.
2019-10-03 08:33:50 -07:00
Rob Loranger
d7258beacc
change class to make sense
the old class was dt-published, at first it was split to keep the
display: block without the rest. this changes the published class to
subtle to be more logical
2019-10-02 13:33:28 -07:00
Rob Loranger
9c3bee8a7d
add dates to posts on collections w/ blog format 2019-10-02 13:20:48 -07:00
5 changed files with 22 additions and 24 deletions

View file

@ -86,6 +86,7 @@ body {
} }
header { header {
padding: 1em 1rem;
nav { nav {
span, a { span, a {
&.pinned { &.pinned {
@ -102,6 +103,13 @@ body {
.owner-visible { .owner-visible {
display: none; display: none;
} }
time.dt-published {
display: block;
&.subtle {
color: #666;
margin-bottom: 0.5em;
}
}
} }
&#post, &#collection, &#subpage { &#post, &#collection, &#subpage {

View file

@ -59,7 +59,7 @@ body#post article, pre, .hljs {
font-size: 1.5em; font-size: 1.5em;
display: block; display: block;
margin-top: 0; margin-top: 0;
margin-bottom: 1em; margin-bottom: 0.5em;
} }
.hljs { .hljs {

View file

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

View file

@ -30,26 +30,6 @@
{{range .Images}}<meta property="og:image" content="{{.}}" />{{else}}<meta property="og:image" content="{{.Collection.AvatarURL}}">{{end}} {{range .Images}}<meta property="og:image" content="{{.}}" />{{else}}<meta property="og:image" content="{{.Collection.AvatarURL}}">{{end}}
<meta property="article:published_time" content="{{.Created8601}}"> <meta property="article:published_time" content="{{.Created8601}}">
{{if .Collection.StyleSheet}}<style type="text/css">{{.Collection.StyleSheetDisplay}}</style>{{end}} {{if .Collection.StyleSheet}}<style type="text/css">{{.Collection.StyleSheetDisplay}}</style>{{end}}
<style type="text/css">
body footer {
max-width: 40rem;
margin: 0 auto;
}
body#post header {
padding: 1em 1rem;
}
article time.dt-published {
display: block;
color: #666;
}
body#post article h2#title{
margin-bottom: 0.5em;
}
article time.dt-published {
margin-bottom: 1em;
}
</style>
{{if .Collection.RenderMathJax}} {{if .Collection.RenderMathJax}}
<!-- Add mathjax logic --> <!-- Add mathjax logic -->
{{template "mathjax" . }} {{template "mathjax" . }}
@ -65,7 +45,11 @@ article time.dt-published {
{{template "user-navigation" .}} {{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-published{{if .Title.String}} subtle{{end}}" datetime="{{.Created}}" pubdate itemprop="datePublished" content="{{.Created}}">{{.DisplayDate}}</time>{{end}}
<div class="e-content">{{.HTMLContent}}</div></article>
{{ if .Collection.ShowFooterBranding }} {{ if .Collection.ShowFooterBranding }}
<footer dir="ltr"> <footer dir="ltr">

View file

@ -32,7 +32,6 @@
<meta property="article:published_time" content="{{.Created8601}}"> <meta property="article:published_time" content="{{.Created8601}}">
{{ end }} {{ end }}
{{if .Collection.StyleSheet}}<style type="text/css">{{.Collection.StyleSheetDisplay}}</style>{{end}} {{if .Collection.StyleSheet}}<style type="text/css">{{.Collection.StyleSheetDisplay}}</style>{{end}}
{{if .Collection.RenderMathJax}} {{if .Collection.RenderMathJax}}
<!-- Add mathjax logic --> <!-- Add mathjax logic -->
{{template "mathjax" . }} {{template "mathjax" . }}
@ -59,7 +58,12 @@
</nav> </nav>
</header> </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-published{{if .Title.String}} subtle{{end}}" datetime="{{.Created}}" pubdate itemprop="datePublished" content="{{.Created}}">{{.DisplayDate}}</time>{{end}}
<div class="e-content">{{.HTMLContent}}</div>
</article>
{{ if .Collection.ShowFooterBranding }} {{ if .Collection.ShowFooterBranding }}
<footer dir="ltr"><hr><nav><p style="font-size: 0.9em">{{localhtml "published with write.as" .Language.String}}</p></nav></footer> <footer dir="ltr"><hr><nav><p style="font-size: 0.9em">{{localhtml "published with write.as" .Language.String}}</p></nav></footer>