mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Content pages and table of contents
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
{{ define "styles" }}
|
||||
{{ $styles := resources.Get "css/single.css" | toCSS | minify }}
|
||||
|
||||
<link rel="stylesheet" href="{{ $styles.Permalink }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ partial "breadcrumb.html" . }}
|
||||
|
||||
<section id="metadata">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<div>
|
||||
<span>{{ .Date.Format .Site.Params.dateFormat }}</span>
|
||||
<span>{{ printf "%d minutes read" .ReadingTime }}</span>
|
||||
<span
|
||||
id="share"
|
||||
data-title="{{ .Title }}"
|
||||
data-description="{{ .Params.description }}"
|
||||
data-url="{{ .Permalink }}"
|
||||
>
|
||||
Share
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="content">
|
||||
<div>
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ partial "table-of-contents.html" . }}
|
||||
</section>
|
||||
|
||||
<h2>Contact</h2>
|
||||
{{ partial "contact-form.html" }}
|
||||
|
||||
<script>
|
||||
document.querySelector('#share').addEventListener('click', async event => {
|
||||
await navigator.share({
|
||||
title: event.target.getAttribute('data-title'),
|
||||
description: event.target.getAttribute('data-description'),
|
||||
url: event.target.getAttribute('data-url'),
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{{ $styles := resources.Get "css/partials/table-of-contents.css" | toCSS | minify }}
|
||||
|
||||
<link rel="stylesheet" href="{{ $styles.Permalink }}" />
|
||||
|
||||
<aside>
|
||||
{{ .TableOfContents }}
|
||||
</aside>
|
||||
Reference in New Issue
Block a user