summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-05-01 13:09:15 -0400
committerJune McEnroe <june@causal.agency>2020-05-01 13:09:15 -0400
commit2496f0aefe4fec0169c74f27b9748f9c5e6eac86 (patch)
tree5c651dbc6287d872432ee4400f01edf5d1645e02
parentFix UIDNEXT removal documentation (diff)
downloadbubger-2496f0aefe4fec0169c74f27b9748f9c5e6eac86.tar.gz
bubger-2496f0aefe4fec0169c74f27b9748f9c5e6eac86.zip
Add generator links
Diffstat (limited to '')
-rw-r--r--archive.h2
-rw-r--r--atom.c4
-rw-r--r--default.html3
-rw-r--r--html.c8
4 files changed, 16 insertions, 1 deletions
diff --git a/archive.h b/archive.h
index 11d5a2b..75d8781 100644
--- a/archive.h
+++ b/archive.h
@@ -24,6 +24,8 @@
 
 #include "imap.h"
 
+#define GENERATOR_URL "https://git.causal.agency/bubger"
+
 struct Address {
 	char *name;
 	const char *mailbox;
diff --git a/atom.c b/atom.c
index 5b34867..7bc4fe9 100644
--- a/atom.c
+++ b/atom.c
@@ -119,6 +119,7 @@ int atomThreadOpen(FILE *file, const struct Envelope *envelope) {
 	const char *template = TEMPLATE(
 		<[q]xml version="1.0" encoding="utf-8"[q]>
 		<feed xmlns="http://www.w3.org/2005/Atom">
+		<generator uri="[generator]">bubger</generator>
 		<id>[id]</id>
 		<title>[title]</title>
 		<updated>[updated]</updated>
@@ -132,6 +133,7 @@ int atomThreadOpen(FILE *file, const struct Envelope *envelope) {
 	char *mbox = atomThreadURL(envelope, "mbox");
 	struct Variable vars[] = {
 		{ "q", "?" },
+		{ "generator", GENERATOR_URL },
 		{ "id", id },
 		{ "title", envelope->subject },
 		{ "updated", atomUpdated(time(NULL)) },
@@ -159,6 +161,7 @@ int atomIndexOpen(FILE *file) {
 	const char *template = TEMPLATE(
 		<[q]xml version="1.0" encoding="utf-8"[q]>
 		<feed xmlns="http://www.w3.org/2005/Atom">
+		<generator uri="[generator]">bubger</generator>
 		<id>mailto:[mailto]</id>
 		<title>[title]</title>
 		<updated>[updated]</updated>
@@ -167,6 +170,7 @@ int atomIndexOpen(FILE *file) {
 	);
 	struct Variable vars[] = {
 		{ "q", "?" },
+		{ "generator", GENERATOR_URL },
 		{ "mailto", baseMailto },
 		{ "title", baseTitle },
 		{ "updated", atomUpdated(time(NULL)) },
diff --git a/default.html b/default.html
index 9190086..6ff49cf 100644
--- a/default.html
+++ b/default.html
@@ -133,4 +133,7 @@ footer {
 	text-align: center;
 	color: gray;
 }
+footer a {
+	color: inherit;
+}
 </style>
diff --git a/html.c b/html.c
index bbc9662..215c208 100644
--- a/html.c
+++ b/html.c
@@ -385,6 +385,7 @@ int htmlThreadHead(FILE *file, const struct Envelope *envelope) {
 	const char *template = TEMPLATE(
 		<!DOCTYPE html>
 		<meta charset="utf-8">
+		<meta name="generator" content="[generator]">
 		<title>[subject] &middot; [title]</title>
 		<link rel="alternate" type="application/atom+xml" href="[atom]">
 		<link rel="alternate" type="application/mbox" href="[mbox]">
@@ -392,6 +393,7 @@ int htmlThreadHead(FILE *file, const struct Envelope *envelope) {
 	char *atom = htmlThreadURL(envelope, "atom");
 	char *mbox = htmlThreadURL(envelope, "mbox");
 	struct Variable vars[] = {
+		{ "generator", GENERATOR_URL },
 		{ "subject", envelope->subject },
 		{ "title", baseTitle },
 		{ "atom", atom },
@@ -475,10 +477,12 @@ int htmlSubthreadClose(FILE *file) {
 static int htmlFooter(FILE *file) {
 	const char *template = TEMPLATE(
 		<footer>
-			<small>generated <time datetime="[time]">[time]</time></small>
+			<small><a href="[generator]">generated</a>
+			<time datetime="[time]">[time]</time></small>
 		</footer>
 	);
 	struct Variable vars[] = {
+		{ "generator", GENERATOR_URL },
 		{ "time", htmlUTC(time(NULL)) },
 		{0},
 	};
@@ -495,10 +499,12 @@ int htmlIndexHead(FILE *file) {
 	const char *template = TEMPLATE(
 		<!DOCTYPE html>
 		<meta charset="utf-8">
+		<meta name="generator" content="[generator]">
 		<title>[title]</title>
 		<link rel="alternate" type="application/atom+xml" href="index.atom">
 	);
 	struct Variable vars[] = {
+		{ "generator", GENERATOR_URL },
 		{ "title", baseTitle },
 		{0},
 	};