updated for microformats2

This commit is contained in:
Phil 2025-01-07 19:43:39 -07:00
parent 88236da4b8
commit 11a09e6c3c
17 changed files with 127 additions and 19 deletions

6
archetypes/articles.md Normal file
View File

@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
type: "articles"
draft: true
---

5
archetypes/notes.md Normal file
View File

@ -0,0 +1,5 @@
---
title: ""
date: {{ .Date }}
type: "notes"
---

6
archetypes/photos.md Normal file
View File

@ -0,0 +1,6 @@
---
title: ""
date: {{ .Date }}
type: "photos"
image: "" # Add the path to your image here
---

0
exampleSite/TODO Normal file
View File

View File

@ -1,20 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Title }}</title>
<link rel="stylesheet" href="/css/style.css">
{{ partial "head.html" . }}
{{ partial "meta.html" . }}
</head>
<body>
<header>
<h1>{{ .Site.Title }}</h1>
</header>
<body class="h-card">
{{ partial "header.html" . }}
<main>
{{ block "main" . }}{{ end }}
</main>
<footer>
© {{ now.Year }} <a href="{{ .Site.Params.author.url }}">{{ .Site.Params.author.name }}</a>
</footer>
{{ partial "footer.html" . }}
</body>
</html>

View File

@ -1,12 +1,13 @@
{{ define "main" }}
<section>
<h2>Posts</h2>
<section class="h-feed">
<h2>{{ .Title }}</h2>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
<li class="h-entry">
<a href="{{ .RelPermalink }}" class="p-name u-url">{{ .Title }}</a>
<time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
</li>
{{ end }}
</ul>
</section>
{{ end }}
{{ end }}

View File

@ -1,6 +1,9 @@
{{ define "main" }}
<article>
<h2>{{ .Title }}</h2>
<div>{{ .Content }}</div>
<article class="h-entry">
<h1 class="p-name">{{ .Title }}</h1>
<time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
<div class="e-content">
{{ .Content }}
</div>
</article>
{{ end }}

View File

@ -0,0 +1,13 @@
{{ define "main" }}
<section class="h-feed">
<h2>Articles</h2>
<ul>
{{ range .Pages }}
<li class="h-entry">
<a href="{{ .RelPermalink }}" class="p-name u-url">{{ .Title }}</a>
<time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
</li>
{{ end }}
</ul>
</section>
{{ end }}

View File

@ -0,0 +1,9 @@
{{ define "main" }}
<article class="h-entry">
<h1 class="p-name">{{ .Title }}</h1>
<time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
<div class="e-content">
{{ .Content }}
</div>
</article>
{{ end }}

13
layouts/notes/list.html Normal file
View File

@ -0,0 +1,13 @@
{{ define "main" }}
<section class="h-feed">
<h2>Notes</h2>
<ul>
{{ range .Pages }}
<li class="h-entry">
<time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
<div class="e-content">{{ .Content }}</div>
</li>
{{ end }}
</ul>
</section>
{{ end }}

View File

@ -0,0 +1,8 @@
{{ define "main" }}
<article class="h-entry">
<time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
<div class="e-content">
{{ .Content }}
</div>
</article>
{{ end }}

View File

@ -0,0 +1,7 @@
<footer>
<p>
&copy; {{ now.Year }}
<span class="p-author h-card">{{ .Site.Params.author.name }}</span>
</p>
<p>Powered by Hugo and the IndieWeb.</p>
</footer>

View File

@ -0,0 +1,5 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Title }}</title>
<link rel="stylesheet" href="/css/style.css">
<link rel="me" href="{{ .Site.Params.indieweb.me_url }}" />

View File

@ -0,0 +1,8 @@
<header>
<nav>
<a class="u-url p-name" href="/">{{ .Site.Title }}</a>
<a href="/notes">Notes</a>
<a href="/articles">Articles</a>
<a href="/photos">Photos</a>
</nav>
</header>

View File

@ -0,0 +1,6 @@
<!-- Webmention -->
<link rel="webmention" href="{{ .Site.Params.webmention.endpoint }}" />
<link rel="pingback" href="{{ .Site.Params.webmention.pingback }}" />
<!-- Micropub -->
<link rel="micropub" href="{{ .Site.Params.micropub.endpoint }}" />

14
layouts/photos/list.html Normal file
View File

@ -0,0 +1,14 @@
{{ define "main" }}
<section class="h-feed">
<h2>Photos</h2>
<div class="photo-grid">
{{ range .Pages }}
<figure class="h-entry">
<img src="{{ .Params.image }}" alt="{{ .Title }}" class="u-photo">
<figcaption class="p-name">{{ .Title }}</figcaption>
<time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
</figure>
{{ end }}
</div>
</section>
{{ end }}

View File

@ -0,0 +1,10 @@
{{ define "main" }}
<article class="h-entry">
<h1 class="p-name">{{ .Title }}</h1>
<time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
<img src="{{ .Params.image }}" alt="{{ .Title }}" class="u-photo">
<div class="e-content">
{{ .Content }}
</div>
</article>
{{ end }}