aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/outputs
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-20 23:41:28 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-22 12:44:37 -0400
commit271bca112afd357a3002d169b961b03a7b48364c (patch)
tree358924b351cf5e9dbad7fcd8eaebc6db8c67fd67 /src/sisudoc/outputs
parentdownloads: honour --allow-downloads (diff)
pod digests: multilingual document digests sorted
Fixes for three faults in the insert (.ssi) digests. The key was the language captured from whichever path resolved the insert. It did not change across the loop over languages, so every language's inserts were filed under one language. The key is now the language being digested, as the digest of the primary file above it already did. - digest is taken after the check that the file exists. - digest is now taken inside the guard. - non-pod path now correctly keyed on the document's own language. (assisted by Claude-Code)
Diffstat (limited to 'src/sisudoc/outputs')
-rw-r--r--src/sisudoc/outputs/io_out/source_pod.d23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/sisudoc/outputs/io_out/source_pod.d b/src/sisudoc/outputs/io_out/source_pod.d
index 76f841b..0ba6007 100644
--- a/src/sisudoc/outputs/io_out/source_pod.d
+++ b/src/sisudoc/outputs/io_out/source_pod.d
@@ -440,16 +440,20 @@ template spinePod() {
string _path_to_pod = _x.captures["path_to_pod"];
string _podname = _x.captures["podname"];
string _root_to_lang = _x.captures["from_root"];
- string _language = _x.captures["language"];
string _filename = _x.captures["filename"];
+ /+ ↓ The digest key is the language being digested (as the sstm
+ digest above already does), not the language captured from the
+ resolved insert path.
+ +/
foreach (_lang; doc_matters.pod.manifest_list_of_languages) {
string _pth_mkup_src_in = _path_to_pod ~ _podname ~ "/" ~ _root_to_lang ~ _lang ~ "/" ~ _filename;
- { // take DIGEST write to pod file digests.txt
- ST_file_stat file_ = getFileStat(_pth_mkup_src_in);
- _digests[_language]["ssi"] ~= file_.sha256hash.toHexString ~ "::" ~ file_.fileSize.to!string ~ " - " ~ _filename ~ " - [" ~ _lang ~ "]" ~ "\n";
- }
string _pth_mkup_src_out = "pod/" ~ _root_to_lang ~ _lang ~ "/" ~ _filename;
+ /+ ↓ the digest must be taken inside this guard, not before it (getFileStat opens the file) +/
if (exists(_pth_mkup_src_in)) {
+ { // take DIGEST write to pod file digests.txt
+ ST_file_stat file_ = getFileStat(_pth_mkup_src_in);
+ _digests[_lang]["ssi"] ~= file_.sha256hash.toHexString ~ "::" ~ file_.fileSize.to!string ~ " - " ~ _filename ~ " - [" ~ _lang ~ "]" ~ "\n";
+ }
if (doc_matters.opt.action.source_or_pod) {
auto fn_src_out_filesystem // you need to change language sources
= pths_pod.fn_doc_insert(
@@ -471,9 +475,14 @@ template spinePod() {
}
} else {
auto fn_src_in = insert_file;
- { // take DIGEST write to pod file digests.txt // FIX likely bug insert_file includes path, not what you wish to write
+ /+ ↓ keyed on the document's own language, not on hard-coded "en". The
+ emit loop looks each key up in the manifest's language list.
+ FIX likely bug: insert_file still includes its path, and the
+ line wants the filename as the pod carries it.
+ +/
+ if (exists(fn_src_in)) { // take DIGEST write to pod file digests.txt
ST_file_stat file_ = getFileStat(fn_src_in);
- _digests["en"]["ssi"] ~= file_.sha256hash.toHexString ~ "::" ~ file_.fileSize.to!string ~ " - " ~ insert_file ~ "\n";
+ _digests[doc_matters.src.language]["ssi"] ~= file_.sha256hash.toHexString ~ "::" ~ file_.fileSize.to!string ~ " - " ~ insert_file ~ "\n";
}
auto fn_src_out_pod_zip_base
= pths_pod.fn_doc_insert(