diff --git a/articles/index.html b/articles/index.html
new file mode 100644
index 0000000..bf903de
--- /dev/null
+++ b/articles/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/garden-data-gen/source/content_gen.d b/garden-data-gen/source/content_gen.d
index f2ca108..f11f0e8 100644
--- a/garden-data-gen/source/content_gen.d
+++ b/garden-data-gen/source/content_gen.d
@@ -49,7 +49,7 @@ private void renderSpeciesCards(PlantData data) {
if (imagePairs.length > 0) {
string imageFile = imagePairs[0].filename;
string thumbnailFile = imagePairs[0].thumbnailFilename;
- string imgTag = " ";
+ string imgTag = " ";
card = replaceFirst(card, "!IMAGE!", imgTag);
} else {
card = replaceFirst(card, "!IMAGE!", "");
@@ -85,15 +85,7 @@ private void renderSpeciesPages(PlantData data) {
ImageFilePair[] imagePairs = getPlantImages(plant.identifier);
Appender!string imagesApp;
foreach (imagePair; imagePairs) {
- import std.format;
- const imgTpl = "\n" ~
- " \n" ~
- " \n";
- imagesApp ~= format!(imgTpl)(
- "../../" ~ imagePair.filename,
- imagePair.width, imagePair.height,
- "../../" ~ imagePair.thumbnailFilename,
- );
+ imagesApp ~= generatePhotoSwipeElement(imagePair);
}
card = replaceFirst(card, "!IMAGES!", imagesApp[]);
plantDivsApp ~= card;
@@ -113,6 +105,29 @@ private void renderSpeciesPages(PlantData data) {
}
}
+private string generatePhotoSwipeElement(ImageFilePair imagePair) {
+ import std.format;
+ import std.datetime;
+ import std.typecons;
+ const linkFormat = "";
+ const thumbnailFormat = " ";
+ const captionFormat = "%s ";
+ string linkTag = format!(linkFormat)("../../" ~ imagePair.filename, imagePair.width, imagePair.height);
+ string thumbnailTag = format!(thumbnailFormat)("../../" ~ imagePair.thumbnailFilename);
+ Appender!string app;
+ app ~= linkTag;
+ app ~= "\n ";
+ app ~= thumbnailTag;
+ Nullable!DateTime imageTimestamp = getImageTimestamp(imagePair.filename);
+ if (!imageTimestamp.isNull) {
+ DateTime dt = imageTimestamp.get;
+ app ~= "\n ";
+ app ~= format!(captionFormat)(dt.year, dt.month, dt.day, dt.date.toSimpleString);
+ }
+ app ~= "\n \n";
+ return app[];
+}
+
ptrdiff_t indexOfStr(string source, string target) {
for (size_t i = 0; i < source.length - target.length; i++) {
if (source[i..i+target.length] == target) {
diff --git a/garden-data-gen/templates/plant-card.html b/garden-data-gen/templates/plant-card.html
index 05f01e4..7b19c5e 100644
--- a/garden-data-gen/templates/plant-card.html
+++ b/garden-data-gen/templates/plant-card.html
@@ -6,7 +6,6 @@
!PLANTING_INFO!
- Images
!IMAGES!
diff --git a/garden.html b/garden.html
index f36e397..7b55471 100644
--- a/garden.html
+++ b/garden.html
@@ -103,7 +103,7 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/garden/index.html b/garden/index.html
new file mode 100644
index 0000000..fc35645
--- /dev/null
+++ b/garden/index.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/garden/species/allium-tuberosum.html b/garden/species/allium-tuberosum.html
index 096ded8..03835b3 100644
--- a/garden/species/allium-tuberosum.html
+++ b/garden/species/allium-tuberosum.html
@@ -73,10 +73,10 @@
Planted from seed on the 2nd of March, 2024.
- Images
diff --git a/garden/species/asclepias-curassavica.html b/garden/species/asclepias-curassavica.html
index f6acd00..d17d0fd 100644
--- a/garden/species/asclepias-curassavica.html
+++ b/garden/species/asclepias-curassavica.html
@@ -73,10 +73,10 @@
Transplanted in February, 2024.
- Images
diff --git a/garden/species/asparagus-aethiopicus.html b/garden/species/asparagus-aethiopicus.html
index 7fcad54..e82870a 100644
--- a/garden/species/asparagus-aethiopicus.html
+++ b/garden/species/asparagus-aethiopicus.html
@@ -73,10 +73,10 @@
Transplanted in February, 2024.
- Images
@@ -89,7 +89,6 @@
Transplanted in February, 2024.
- Images
diff --git a/garden/species/capsicum-annuum-var-glabriusculum.html b/garden/species/capsicum-annuum-var-glabriusculum.html
index d73a109..b601af6 100644
--- a/garden/species/capsicum-annuum-var-glabriusculum.html
+++ b/garden/species/capsicum-annuum-var-glabriusculum.html
@@ -73,10 +73,10 @@
Transplanted from a 1 gallon pot, on February 10th, 2024.
- Images
diff --git a/garden/species/capsicum-annuum-var-jalapeno.html b/garden/species/capsicum-annuum-var-jalapeno.html
index 5b916e9..b40e5cb 100644
--- a/garden/species/capsicum-annuum-var-jalapeno.html
+++ b/garden/species/capsicum-annuum-var-jalapeno.html
@@ -73,10 +73,10 @@
Transplanted on the 2nd of March, 2024.
- Images
diff --git a/garden/species/clinopodium-brownei.html b/garden/species/clinopodium-brownei.html
index ac3a179..2c7a0e2 100644
--- a/garden/species/clinopodium-brownei.html
+++ b/garden/species/clinopodium-brownei.html
@@ -73,10 +73,10 @@
Transplanted on the 10th of February, 2024.
- Images
diff --git a/garden/species/coriandrum-sativum.html b/garden/species/coriandrum-sativum.html
index 5e602ea..fed80af 100644
--- a/garden/species/coriandrum-sativum.html
+++ b/garden/species/coriandrum-sativum.html
@@ -73,10 +73,10 @@
Planted from seed on the 2nd of March, 2024.
- Images
diff --git a/garden/species/juniperus-conferta.html b/garden/species/juniperus-conferta.html
index f1a6ee5..d3179db 100644
--- a/garden/species/juniperus-conferta.html
+++ b/garden/species/juniperus-conferta.html
@@ -73,10 +73,10 @@
Transplanted on the 2nd of March, 2024.
- Images
diff --git a/garden/species/nepeta-cataria.html b/garden/species/nepeta-cataria.html
index 5c130bf..7842bf6 100644
--- a/garden/species/nepeta-cataria.html
+++ b/garden/species/nepeta-cataria.html
@@ -73,10 +73,10 @@
Transplanted from a small pot bought at a pet store, sometime in October, 2023.
- Images
diff --git a/garden/species/nephrolepis-obliterata.html b/garden/species/nephrolepis-obliterata.html
index 939de46..e58bcbb 100644
--- a/garden/species/nephrolepis-obliterata.html
+++ b/garden/species/nephrolepis-obliterata.html
@@ -73,10 +73,10 @@
Transplanted on the 2nd of March, 2024.
- Images
diff --git a/garden/species/plectranthus-mona-lavender.html b/garden/species/plectranthus-mona-lavender.html
index 3fe4463..d119595 100644
--- a/garden/species/plectranthus-mona-lavender.html
+++ b/garden/species/plectranthus-mona-lavender.html
@@ -73,10 +73,10 @@
Transplanted in February, 2024.
- Images
diff --git a/garden/species/psychotria-nervosa.html b/garden/species/psychotria-nervosa.html
index b885ba2..4b89729 100644
--- a/garden/species/psychotria-nervosa.html
+++ b/garden/species/psychotria-nervosa.html
@@ -73,10 +73,10 @@
Transplanted on the 10th of February, 2024.
- Images
diff --git a/garden/species/ruellia-caroliniensis.html b/garden/species/ruellia-caroliniensis.html
index 00fc4fb..f4c6610 100644
--- a/garden/species/ruellia-caroliniensis.html
+++ b/garden/species/ruellia-caroliniensis.html
@@ -73,10 +73,10 @@
Transplanted on the 10th of February, 2024.
- Images
diff --git a/garden/species/salvia-misella.html b/garden/species/salvia-misella.html
index 50ba31a..c9fc307 100644
--- a/garden/species/salvia-misella.html
+++ b/garden/species/salvia-misella.html
@@ -73,10 +73,10 @@
Transplanted on the 9th of March, 2024.
- Images
diff --git a/garden/species/tagetes-erecta.html b/garden/species/tagetes-erecta.html
index cb16dcf..2618179 100644
--- a/garden/species/tagetes-erecta.html
+++ b/garden/species/tagetes-erecta.html
@@ -73,10 +73,10 @@
Planted from seed in February, 2024.
- Images
diff --git a/garden/species/teucrium-canadense.html b/garden/species/teucrium-canadense.html
index 23cf64c..dea9ce1 100644
--- a/garden/species/teucrium-canadense.html
+++ b/garden/species/teucrium-canadense.html
@@ -73,10 +73,10 @@
Transplanted on the 9th of March, 2024.
- Images
diff --git a/garden/species/thymus-vulgaris.html b/garden/species/thymus-vulgaris.html
index 4714b17..f238d9a 100644
--- a/garden/species/thymus-vulgaris.html
+++ b/garden/species/thymus-vulgaris.html
@@ -73,10 +73,10 @@
Planted from seed in March, 2024.
- Images
diff --git a/garden/species/trandescantia-zebrina.html b/garden/species/trandescantia-zebrina.html
index d5c508f..9094cc5 100644
--- a/garden/species/trandescantia-zebrina.html
+++ b/garden/species/trandescantia-zebrina.html
@@ -73,10 +73,10 @@
Transplanted on the 8th of March, 2024.
- Images
diff --git a/upload.sh b/upload.sh
index 1759bc6..c7afc55 100755
--- a/upload.sh
+++ b/upload.sh
@@ -3,6 +3,14 @@
# Helper script that copies files to the server.
# You need to have authenticated access to the server via SSH to use this.
+# First we build the garden pages from the data in the "garden-plant-data.ods"
+# spreadsheet (edited via LibreOffice Calc) and the images we've added for each
+# plant in ./images/garden.
+
+cd garden-data-gen
+dub run
+cd ..
+
# Note: Quite a few files are excluded from being uploaded to the website.
# These are denoted with an "--exclude" parameter.