Post listing?

This commit is contained in:
Mats Rauhala 2023-03-29 22:49:20 +03:00
parent 23658182c2
commit c1058994f3
4 changed files with 301 additions and 10 deletions

View File

@ -516,6 +516,285 @@ video {
--tw-backdrop-sepia: ;
}
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.inset-0 {
inset: 0px;
}
.z-10 {
z-index: 10;
}
.mx-auto {
margin-left: auto;
margin-right: auto;
}
.mt-10 {
margin-top: 2.5rem;
}
.mt-2 {
margin-top: 0.5rem;
}
.mt-3 {
margin-top: 0.75rem;
}
.mt-5 {
margin-top: 1.25rem;
}
.mt-8 {
margin-top: 2rem;
}
.line-clamp-3 {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
}
.flex {
display: flex;
}
.grid {
display: grid;
}
.h-10 {
height: 2.5rem;
}
.w-10 {
width: 2.5rem;
}
.max-w-2xl {
max-width: 42rem;
}
.max-w-7xl {
max-width: 80rem;
}
.max-w-xl {
max-width: 36rem;
}
.shrink {
flex-shrink: 1;
}
.grow {
flex-grow: 1;
}
.grid-cols-1 {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
.flex-col {
flex-direction: column;
}
.items-start {
align-items: flex-start;
}
.items-center {
align-items: center;
}
.justify-between {
justify-content: space-between;
}
.gap-x-4 {
-moz-column-gap: 1rem;
column-gap: 1rem;
}
.gap-x-8 {
-moz-column-gap: 2rem;
column-gap: 2rem;
}
.gap-y-16 {
row-gap: 4rem;
}
.rounded-full {
border-radius: 9999px;
}
.border-t {
border-top-width: 1px;
}
.border-gray-200 {
--tw-border-opacity: 1;
border-color: rgb(229 231 235 / var(--tw-border-opacity));
}
.bg-white {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}
.bg-gray-50 {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}
.py-24 {
padding-top: 6rem;
padding-bottom: 6rem;
}
.px-3 {
padding-left: 0.75rem;
padding-right: 0.75rem;
}
.px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.py-1 {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
}
.py-1\.5 {
padding-top: 0.375rem;
padding-bottom: 0.375rem;
}
.pt-10 {
padding-top: 2.5rem;
}
.font-sans {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
.text-3xl {
font-size: 1.875rem;
line-height: 2.25rem;
}
.text-lg {
font-size: 1.125rem;
line-height: 1.75rem;
}
.text-sm {
font-size: 0.875rem;
line-height: 1.25rem;
}
.text-xs {
font-size: 0.75rem;
line-height: 1rem;
}
.font-bold {
font-weight: 700;
}
.font-medium {
font-weight: 500;
}
.font-semibold {
font-weight: 600;
}
.leading-6 {
line-height: 1.5rem;
}
.leading-8 {
line-height: 2rem;
}
.tracking-tight {
letter-spacing: -0.025em;
}
.text-gray-500 {
--tw-text-opacity: 1;
color: rgb(107 114 128 / var(--tw-text-opacity));
}
.text-gray-600 {
--tw-text-opacity: 1;
color: rgb(75 85 99 / var(--tw-text-opacity));
}
.text-gray-900 {
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity));
}
.hover\:bg-gray-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
}
.group:hover .group-hover\:text-gray-600 {
--tw-text-opacity: 1;
color: rgb(75 85 99 / var(--tw-text-opacity));
}
@media (min-width: 640px) {
.sm\:mt-16 {
margin-top: 4rem;
}
.sm\:py-32 {
padding-top: 8rem;
padding-bottom: 8rem;
}
.sm\:pt-16 {
padding-top: 4rem;
}
.sm\:text-4xl {
font-size: 2.25rem;
line-height: 2.5rem;
}
}
@media (min-width: 1024px) {
.lg\:mx-0 {
margin-left: 0px;
margin-right: 0px;
}
.lg\:max-w-none {
max-width: none;
}
.lg\:grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.lg\:px-8 {
padding-left: 2rem;
padding-right: 2rem;
}
}

View File

@ -5,15 +5,11 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>rauhala.info - $title$</title>
<link rel="stylesheet" href="/css/default.css" />
<link rel="stylesheet" href="/css/highlight.css">
<link rel="stylesheet" href="/css/index.css">
</head>
<body>
<header>
<!-- <div class="logo"> -->
<!-- <a href="/">rauhala.info</a> -->
<!-- </div> -->
<nav>
<!-- Git logo from https://git-scm.com/downloads/logos -->
<!-- Logo by Jason Long -->

View File

@ -1,7 +1,21 @@
<ul>
<div class="bg-white py-24 sm:py-32">
<div class="mx-auto max-w-7xl px-6 lg:px-8">
$for(items)$
<li>
<a href="$url$">$title$</a> - $date$
</li>
<div class="mx-auto mt-10 grid max-w-2xl grid-cols-1 gap-x-8 gap-y-16 border-t border-gray-200 pt-10 sm:mt-16 sm:pt-16 lg:mx-0 lg:max-w-none lg:grid-cols-3">
<article class="flex max-w-xl flex-col items-start justify-between">
<div class="flex items-center gap-x-4 text-xs">
<time datetime="$date$" class="text-gray-500">$date$</time>
</div>
<div class="group relative">
<h3 class="mt-3 text-lg font-semibold leading-6 text-gray-900 group-hover:text-gray-600">
<a href="$url$">
<span class="absolute inset-0"></span>
$title$
</a>
</h3>
</div>
</article>
</div>
$endfor$
</ul>
</div>
</div>

View File

@ -36,6 +36,7 @@ main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/post.html" postContext
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
@ -43,6 +44,7 @@ main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do
match "projects/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/project.html" postContext
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
@ -97,7 +99,7 @@ archive Archive{..} = create [output] $ do
listField "items" context items
<> constField "title" title
<> defaultContext
items = recentFirst =<< loadAll input
items = recentFirst =<< loadAllSnapshots input "content"
makeItem ""
>>= loadAndApplyTemplate template itemsContext
>>= loadAndApplyTemplate "templates/default.html" itemsContext