Content pages and table of contents

This commit is contained in:
Hazem Krimi
2023-11-15 16:22:38 +01:00
parent 1a5a9fbfef
commit 64723c3860
11 changed files with 152 additions and 32 deletions
+7 -4
View File
@@ -5,15 +5,18 @@
<article class="card">
<div>
<h3>{{ .Title }}</h3>
{{ if .InSection ($.Site.GetPage "blog") }}
<b>{{ .Date.Format .Site.Params.dateFormat }}</b>
{{ end }}
<p>{{ .Params.description }}</p>
<div id="links">
<a class="read-more" href="{{ .Permalink }}">
Read more {{ readFile "assets/icons/arrow.svg" | safeHTML }}
</a>
{{ with .Params.demo }}
<a class="demo" href="{{ . }}" target="_blank">
Demo {{ readFile "assets/icons/eye.svg" | safeHTML }}
</a>
{{ with (and (.InSection ($.Site.GetPage "projects")) .Params.demo) }}
<a class="demo" href="{{ . }}" target="_blank">
Demo {{ readFile "assets/icons/eye.svg" | safeHTML }}
</a>
{{ end }}
</div>
</div>
+1 -1
View File
@@ -40,7 +40,7 @@
</span>
</header>
<nav>
<nav id="mobile-navigation">
<div id="menus">
{{ range site.Menus.main.Sort.ByWeight }}
<a {{ printf "href=%q" .URL | safeHTMLAttr }}>{{ .Name }}</a>
+7
View File
@@ -0,0 +1,7 @@
{{ $styles := resources.Get "css/partials/table-of-contents.css" | toCSS | minify }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" />
<aside>
{{ .TableOfContents }}
</aside>