feat: semantic hgroup tags

This commit is contained in:
Himadri Bhattacharjee
2025-10-25 18:56:16 +05:30
parent e155e276a3
commit 60f64252ad
4 changed files with 9 additions and 29 deletions

View File

@@ -272,11 +272,11 @@ header {
position: relative;
padding: var(--small-gap);
gap: 1rem;
justify-content: space-between;
nav {
display: flex;
gap: 1rem;
margin-left: auto;
a {
width: 4rem;
@@ -320,22 +320,6 @@ header {
}
}
@media (max-width: 360px) {
header {
justify-content: space-evenly;
flex-wrap: wrap;
.push {
display: none;
}
h1 {
text-align: center;
flex: 100%;
}
}
}
.main {
max-width: var(--narrow);
flex: 1;
@@ -390,15 +374,15 @@ header {
}
/* a single post */
.post-title {
hgroup {
margin-bottom: var(--y-gap);
p {
display: flex;
margin-bottom: 1.5rem;
margin-top: 0.4rem;
margin-bottom: 1.1rem;
font-size: 1.6rem;
color: var(--air);
transform: translateY(0.4rem);
}
p span::before {
@@ -408,7 +392,6 @@ header {
h1 {
font-size: 5rem;
transform: translateX(-0.3rem);
}
}

View File

@@ -1,12 +1,12 @@
{{ define "main" }}
<article class="post-single">
<header class="post-title">
<hgroup>
<p>
{{ .Date | time.Format ":date_medium" }}
</p>
<h1>{{ .Title }}</h1>
</header>
</hgroup>
<section class="post-content">{{ .Content }}
<img src="{{ .Params.image }}" style="border-radius: 1rem">
{{ if .Params.timelapse }}

View File

@@ -2,7 +2,7 @@
<html lang="{{ site.LanguageCode }}">
{{ partial "head.html" . }}
<body data-menu="{{ isset site.Menus `main` }}">
<body>
{{ partial "header.html" . }}
<main class="main">{{ block "main" . }}{{ end }}</main>

View File

@@ -1,20 +1,17 @@
{{ define "main" }}
<article class="post-single" data-pagefind-body>
<header class="post-title">
<hgroup>
<p data-pagefind-ignore>
{{ partial "description" . }}
</p>
<h1 data-pagefind-meta="title">{{ .Title }}</h1>
</header>
</hgroup>
<section class="post-content">{{ .Content }}</section>
</article>
<!-- Post Tags -->
{{ if .Params.tags }}
<footer class="post-tags" data-pagefind-meta="tags">
{{ partial "tags" . }}
</footer>
{{ end }}
<!-- Post Nav -->
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}