main
Mansoor Barri 2025-01-07 19:00:46 +00:00 committed by GitHub
parent 3e78ce4955
commit e5d9b6bdb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 67 additions and 45 deletions

View File

@ -161,13 +161,29 @@ h6::before { color: var(--maincolor); content: '###### '; }
letter-spacing: -0.5px; letter-spacing: -0.5px;
} }
.post-container {
align-items: flex-start;
display: flex;
gap: 20px;
}
.post-content {
flex: 3;
min-width: 0;
}
.toc { .toc {
background-color: #ececec; background-color: #ececec;
color: #232333;
padding: 10px;
padding-bottom: 0;
border-radius: 5px; border-radius: 5px;
display: inline-block; color: #232333;
flex: 0 0 auto;
height: auto;
margin-left: 20px;
max-width: 300px;
overflow-y: auto;
padding: 10px;
position: sticky;
top: 20px;
} }
/* Footer */ /* Footer */

View File

@ -1,6 +1,9 @@
{{ define "main" }} {{ define "main" }}
<main> <main>
<article> <article>
<div class="post-container">
<!-- Main Content -->
<div class="post-content">
<div class="title"> <div class="title">
<h1 class="title">{{ .Title }}</h1> <h1 class="title">{{ .Title }}</h1>
<div class="meta">Posted on {{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div> <div class="meta">Posted on {{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
@ -10,17 +13,9 @@
<strong>tl;dr:</strong> <strong>tl;dr:</strong>
{{ .Params.tldr }} {{ .Params.tldr }}
</div>{{ end }} </div>{{ end }}
{{ if isset .Params "toc" }}
<div class="toc">
<strong>Table of contents:</strong>
{{ .TableOfContents }}
</div>{{ end }}
<section class="body"> <section class="body">
{{ .Content }} {{ .Content }}
</section> </section>
<div class="post-tags"> <div class="post-tags">
{{ if ne .Type "page" }} {{ if ne .Type "page" }}
{{ if gt .Params.tags 0 }} {{ if gt .Params.tags 0 }}
@ -34,8 +29,19 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>
</div>
<!-- TOC -->
{{ if isset .Params "toc" }}
<div class="toc">
<strong>Table of contents:</strong>
{{ .TableOfContents }}
</div>
{{ end }}
</div>
<!-- Disqus -->
{{- $.Scratch.Set "isDisqus" true -}} {{- $.Scratch.Set "isDisqus" true -}}
<!-- Check if disqus short name is given -->
{{ if not .Site.Config.Services.Disqus.Shortname }} {{ if not .Site.Config.Services.Disqus.Shortname }}
{{- $.Scratch.Set "isDisqus" false -}} {{- $.Scratch.Set "isDisqus" false -}}
{{ end }} {{ end }}