fix: remove bare html page from showing up as a post

This commit is contained in:
Himadri Bhattacharjee
2025-10-30 15:39:13 +05:30
parent 09643daa7c
commit 381870b88c
7 changed files with 29 additions and 35 deletions

View File

@@ -20,4 +20,4 @@ Feel free to look around: rotate, zoom or pan the 3D view.
Frames for the outline animation will be recomputed on the fly! The hardcoded duration for the animation
is 5 seconds in this example.
{{< rawhtml "content/post/project_mana.html" >}}
{{< rawhtml "content/project_mana.html" >}}

View File

@@ -331,6 +331,7 @@ main {
}
nav[data-main] {
justify-content: space-between;
margin-top: var(--gap);
a {
@@ -341,10 +342,9 @@ nav[data-main] {
color: var(--lit);
border-radius: 0.5rem;
padding-inline: 3rem;
}
a:nth-child(2) {
margin-left: auto;
&[href="#"] {
visibility: hidden;
}
}
}

View File

@@ -1,6 +1,5 @@
{{ define "main" }}
<article class="post-single">
<hgroup>
<p>
{{ .Date | time.Format ":date_medium" }}
@@ -38,5 +37,4 @@
{{ end }}
</nav>
{{ end }}
</article>
{{ end }}

View File

@@ -2,33 +2,27 @@
<!-- $pages -->
{{ $pages := union .RegularPages .Sections }}
<!---->{{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ end }}
<section class="post-content">
{{.Content}}
</section>
<!-- Articles -->
{{ $paginator := .Paginate $pages }} {{ range $index, $page := $paginator.Pages }}
<article class="post-entry">
<article>
<h2>{{ .Title }}</h2>
<br>
<img src="{{ .Params.image }}" style="border-radius: 1rem">
<a href="{{ .Permalink }}" class="post-link"></a>
<a href="{{ .Permalink }}" aria-label="{{ .Title }}" class="post-link"></a>
</article>
{{ end }}
<!-- Main Nav -->
{{ if gt $paginator.TotalPages 1 }}
<nav class="main-nav">
{{ if $paginator.HasPrev }}
<a class="prev" href="{{ $paginator.Prev.URL }}">← Previous Page</a>
{{ end }}
{{ if $paginator.HasNext }}
<a class="next" href="{{ $paginator.Next.URL }}">Next Page →</a>
{{ end }}
</nav>
<nav data-main>
<a href="{{ if $paginator.HasPrev }}{{ $paginator.Prev.URL }}{{ end }}">Previous Page</a>
<a href="{{ if $paginator.HasNext }}{{ $paginator.Next.URL }}{{ end }}">Next Page</a>
</nav>
{{ end }}
{{ end }}

View File

@@ -1,8 +1,7 @@
{{ define "main" }}
<!-- $pages -->
{{ $pages := union .RegularPages .Sections }}
<!---->{{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ end }}
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
@@ -10,27 +9,26 @@
<search></search>
<section class="post-content">
{{.Content}}
{{.Content}}
</section>
{{ $paginator := .Paginate $pages }} {{ range $index, $page := $paginator.Pages }}
{{ $paginator := .Paginate $pages }}
{{ range $page := $paginator.Pages }}
<article>
<h2>{{ .Title }}</h2>
<a aria-label="{{ .Title }}" href="{{ .Permalink }}"><h2>{{ .Title }}</h2></a>
{{ partial "description" . }}<br>
{{ partial "tags" . }}
<a class="post-link" href="{{ .Permalink }}"></a>
<a class="post-link" aria-label="{{ .Title }}" href="{{ .Permalink }}"></a>
</article>
{{ end }}
{{ if gt $paginator.TotalPages 1 }}
<nav data-main>
{{ if $paginator.HasPrev }}
<a href="{{ $paginator.Prev.URL }}">Previous Page</a>
{{ end }}
{{ if $paginator.HasNext }}
<a href="{{ $paginator.Next.URL }}">Next Page</a>
{{ end }}
</nav>
<a href="{{ if $paginator.HasPrev }}{{ $paginator.Prev.URL }}{{ else }}#{{ end }}">Previous Page</a>
<a href="{{ if $paginator.HasNext }}{{ $paginator.Next.URL }}{{ else }}#{{ end }}">Next Page</a>
</nav>
{{ end }}
<script>
window.addEventListener('DOMContentLoaded', (event) => {
@@ -38,4 +36,3 @@
});
</script>
{{ end }}
{{ end }}

View File

@@ -17,8 +17,13 @@
<nav data-post>
{{ with $pages.Next . }}
<a href="{{ .Permalink }}"><span></span><span>{{ .Name }}</span></a>
{{ end }} {{ with $pages.Prev . }}
{{ else }}
<br>
{{ end }}
{{ with $pages.Prev . }}
<a href="{{ .Permalink }}"><span>{{ .Name }}</span><span></span></a>
{{ else }}
<br>
{{ end }}
</nav>
{{ end }}