feat: blog index
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2022-01-29 16:32:53 +01:00
parent 207820ee34
commit d259f4e8f2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 44 additions and 25 deletions

View File

@ -31,7 +31,7 @@
<input id="f0bc9" type="hidden" name="l" value="f0bc9ec2-56a4-48c8-baad-7a31b137484e"/>
<input type="submit" value="Subscribe"
class="mt-4 px-4 py-2 border border-transparent text-base font-medium rounded-md text-white bg-primary hover:bg-primary-darker cursor-pointer"/>
class="mt-4 px-4 py-2 text-base font-medium rounded-md text-white bg-primary hover:bg-primary-darker cursor-pointer"/>
</form>
</div>
<div class="w-full md:w-1/5 mt-4 md:mt-0 flex flex-col">

View File

@ -1,37 +1,56 @@
{{ partial "header.html" . }}
<div class="container content page">
<article class="max-w-screen-lg mx-auto mt-4">
<h1 class="font-title text-4xl font-bold mb-2">Blog</h1>
<p class="text-gray-600 mb-10">All the latest Vikunja news and updates.</p>
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}{{ range $paginator.Pages }}
<div class="card">
<div class="card-content">
<div class="media">
<div class="media-content">
<a class="title is-4" href="{{ .Permalink }}">{{ .Title }}</a>
<p class="subtitle is-6">
{{ .Date.Format "2006-01-02" }}
</p>
</div>
</div>
<div class="content">
{{ .Summary }}
</div>
<a href="{{ .Permalink }}" class="button is-primary is-outlined noshadow">
<section class="mb-8">
<a class="font-title text-2xl font-bold" href="{{ .Permalink }}">{{ .Title }}</a>
<p class="text-gray-400">
{{ .Date.Format "2006-01-02" }}
</p>
<p class="pt-4 text-gray-600">
{{ .Summary }}
</p>
<a href="{{ .Permalink }}"
class="inline-flex items-center mt-4 px-2 py-2 rounded-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<span class="mr-1">
Read more
</a>
</div>
</div>
</span>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"/>
</svg>
</a>
</section>
{{ end }}
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
{{ if .Paginator.HasPrev}}
<a class="pagination-previous" href="{{ .Paginator.Prev.URL }}">Previous</a>
<a href="{{ .Paginator.Prev.URL }}" class="relative inline-flex items-center px-2 py-2 {{ if .Paginator.HasNext }} rounded-l-md {{ else }} rounded-md {{ end }} border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
Previous
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
aria-hidden="true">
<path fill-rule="evenodd"
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
clip-rule="evenodd"/>
</svg>
</a>
{{ end }}
{{ if .Paginator.HasNext }}
<a class="pagination-next" href="{{ .Paginator.Next.URL }}">Next</a>
<a href="{{ .Paginator.Next.URL }}" class="relative inline-flex items-center px-2 py-2 {{ if .Paginator.HasPrev }} rounded-r-md {{ else }} rounded-md {{ end }} border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
Next
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
aria-hidden="true">
<path fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"/>
</svg>
</a>
{{ end }}
</nav>
</div>
</article>
{{ partial "footer.html" . }}