mirror of https://github.com/writeas/writefreely
This adds a special page at `blog-url/archive/` that lists all posts on a blog in descending order. It includes stylesheet changes. Update with `make ui`. Ref T873pull/1128/head
parent
8d3d7419cd
commit
76818287d6
@ -0,0 +1,118 @@ |
||||
{{define "collection"}}<!DOCTYPE HTML> |
||||
<html> |
||||
<head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#"> |
||||
<meta charset="utf-8"> |
||||
|
||||
<title>Archive — {{.Collection.DisplayTitle}}</title> |
||||
|
||||
<link rel="stylesheet" type="text/css" href="/css/write.css" /> |
||||
{{if .CustomCSS}}<link rel="stylesheet" type="text/css" href="/local/custom.css" />{{end}} |
||||
<link rel="shortcut icon" href="/favicon.ico" /> |
||||
<link rel="canonical" href="{{.CanonicalURL}}"> |
||||
{{if gt .CurrentPage 1}}<link rel="prev" href="{{.PrevPageURL .Prefix .NavSuffix .CurrentPage .IsTopLevel}}">{{end}} |
||||
{{if lt .CurrentPage .TotalPages}}<link rel="next" href="{{.NextPageURL .Prefix .NavSuffix .CurrentPage .IsTopLevel}}">{{end}} |
||||
{{if not .IsPrivate}}<link rel="alternate" type="application/rss+xml" title="{{.DisplayTitle}} » Feed" href="{{.CanonicalURL}}feed/" />{{end}} |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
|
||||
<meta name="generator" content="WriteFreely"> |
||||
<meta name="description" content="{{.PlainDescription}}"> |
||||
<meta itemprop="name" content="{{.DisplayTitle}}"> |
||||
<meta itemprop="description" content="{{.PlainDescription}}"> |
||||
<meta name="twitter:card" content="summary"> |
||||
<meta name="twitter:title" content="{{.DisplayTitle}}"> |
||||
<meta name="twitter:image" content="{{.AvatarURL}}"> |
||||
<meta name="twitter:description" content="{{.PlainDescription}}"> |
||||
<meta property="og:title" content="{{.DisplayTitle}}" /> |
||||
<meta property="og:site_name" content="{{.DisplayTitle}}" /> |
||||
<meta property="og:type" content="article" /> |
||||
<meta property="og:url" content="{{.CanonicalURL}}" /> |
||||
<meta property="og:description" content="{{.PlainDescription}}" /> |
||||
<meta property="og:image" content="{{.AvatarURL}}"> |
||||
{{template "collection-meta" .}} |
||||
{{if .StyleSheet}}<style type="text/css">{{.StyleSheetDisplay}}</style>{{end}} |
||||
|
||||
</head> |
||||
<body id="subpage"> |
||||
|
||||
<div id="overlay"></div> |
||||
|
||||
<header> |
||||
<h1 dir="{{.Direction}}" id="blog-title"><a href="{{if .IsTopLevel}}/{{else}}/{{.Collection.Alias}}/{{end}}" class="h-card p-author">{{.Collection.DisplayTitle}}</a></h1> |
||||
<nav> |
||||
{{if .PinnedPosts}} |
||||
{{range .PinnedPosts}}<a class="pinned" href="{{if $.IsOwner}}/{{$.Collection.Alias}}/{{.Slug.String}}{{else}}{{.CanonicalURL}}{{end}}">{{.DisplayTitle}}</a>{{end}} |
||||
{{end}} |
||||
</nav> |
||||
</header> |
||||
|
||||
{{if .Posts -}} |
||||
<section id="wrapper" class="archive" itemscope itemtype="http://schema.org/Blog"> |
||||
{{- else -}} |
||||
<div id="wrapper" class="archive"> |
||||
{{- end}} |
||||
|
||||
<h1>Archive</h1> |
||||
|
||||
{{if .Flash}} |
||||
<div class="alert success flash"> |
||||
<p>{{.Flash}}</p> |
||||
</div> |
||||
{{end}} |
||||
|
||||
<ul> |
||||
{{ $curYear := 0 }} |
||||
{{ range $el := .Posts }} |
||||
{{if ne $curYear .Created.Year}}<li class="year">{{.Created.Year}}</li>{{ $curYear = .Created.Year }}{{end}} |
||||
<li> |
||||
{{if .HasTitleLink -}} |
||||
{{.HTMLTitleArrow}} |
||||
{{- else -}} |
||||
<a href="{{if $.SingleUser}}/{{else}}/{{$.Alias}}/{{end}}{{.Slug.String}}" itemprop="url" class="u-url"> |
||||
{{- if .DisplayTitle -}} |
||||
{{- .DisplayTitle -}} |
||||
{{- else -}} |
||||
(Untitled) |
||||
{{end}} |
||||
</a> |
||||
{{- end}} |
||||
{{if .IsScheduled}}[Scheduled]{{end}} |
||||
{{if $.Format.ShowDates -}} |
||||
<time class="dt-published" datetime="{{.Created8601}}" pubdate itemprop="datePublished" content="{{.Created}}"> |
||||
{{- if .HasTitleLink -}} |
||||
<a href="{{if $.SingleUser}}/{{else}}/{{$.Alias}}/{{end}}{{.Slug.String}}" itemprop="url"> |
||||
{{- end -}} |
||||
{{.DisplayDate}} |
||||
{{- if .HasTitleLink -}} |
||||
{{- if .IsPaid}}{{template "paid-badge" (dict "CDNHost" $.CDNHost)}}{{end -}}</a> |
||||
{{- end -}} |
||||
</time> |
||||
{{- else -}} |
||||
{{- if .HasTitleLink -}} |
||||
<a href="{{if $.SingleUser}}/{{else}}/{{$.Alias}}/{{end}}{{.Slug.String}}" itemprop="url">view</a> |
||||
{{- end -}} |
||||
{{- end}} |
||||
</li> |
||||
{{end}} |
||||
</ul> |
||||
|
||||
{{template "paging" .}} |
||||
|
||||
{{if .Posts}}</section>{{else}}</div>{{end}} |
||||
|
||||
{{if .ShowFooterBranding }} |
||||
<footer> |
||||
<hr /> |
||||
<nav dir="ltr"> |
||||
{{if not .SingleUser}}<a class="home pubd" href="/">{{.SiteName}}</a> · {{end}}powered by <a style="margin-left:0" href="https://writefreely.org">writefreely</a> |
||||
</nav> |
||||
</footer> |
||||
{{ end }} |
||||
|
||||
</body> |
||||
|
||||
{{if .CanShowScript}} |
||||
{{range .ExternalScripts}}<script type="text/javascript" src="{{.}}" async></script>{{end}} |
||||
{{if .Collection.Script}}<script type="text/javascript">{{.ScriptDisplay}}</script>{{end}} |
||||
{{end}} |
||||
<script src="/js/localdate.js"></script> |
||||
</html>{{end}} |
Loading…
Reference in new issue