From 433f0b2ed0f9d5461c0fdf2b49e41eb26802cc2e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 9 Oct 2019 15:21:34 -0400 Subject: 0.8.2 yaml pod.manifest, read site config first - yaml (configuration & metadata) site config, pod: pod.manifest, doc header: make, meta - pod.manifest in yaml breaks - older program reading new pod and - newer program reading old pod - read config first, - get site default language in case it is absent in pod.manifest - ensure config is not read too many times (it is at present, revisit) --- src/doc_reform/source/paths_source.d | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'src/doc_reform/source/paths_source.d') diff --git a/src/doc_reform/source/paths_source.d b/src/doc_reform/source/paths_source.d index b1622bd..86338af 100644 --- a/src/doc_reform/source/paths_source.d +++ b/src/doc_reform/source/paths_source.d @@ -17,7 +17,7 @@ template PodManifest() { mixin DocReformRgxInit; static auto rgx = Rgx(); auto PodManifest(P)( - P _pth + P _pth="" ) { struct ManifestFile_ { string pod_manifest_filename() { @@ -370,9 +370,8 @@ template PathMatters() { if (!exists(_output_path)) { try { _output_path.mkdirRecurse; - } - // catch (ErrnoException ex) { - catch (Exception ex) { + // } catch (ErrnoException ex) { + } catch (Exception ex) { // Handle error } } @@ -581,6 +580,10 @@ template DocReformPathsPods() { pth ~ " == " ~ _base_dir_pod ~ "/" ~ base_filename_(fn_src) ~ "?"); return pth; } + string output_pod_manifest_file(string fn_src) { + string pth = base_filesystem_(fn_src).chainPath("pod.manifest").array; + return pth; + } string base_pod_(string fn_src) { string pth = _base_dir_pod.chainPath(base_filename_(fn_src)).array; // change this return pth; @@ -625,8 +628,8 @@ template DocReformPathsPods() { return _pods(); } auto pod_root(string fn_src) { - auto pth_1_ = ""; - auto pth_2_ = ((base(fn_src).filesystem_open_zpod.chainPath("")).asNormalizedPath).array; + auto pth_1_ = "pod"; + auto pth_2_ = ((base(fn_src).filesystem_open_zpod.chainPath("")).asNormalizedPath).array; // "dr_doc" struct _pods { auto zpod() { return pth_1_; @@ -667,9 +670,24 @@ template DocReformPathsPods() { } return _pods(); } + auto pod_manifest(string fn_src) { + auto pod_root_ = pod_root(fn_src); + auto pth_1_ = ((pod_root(fn_src).zpod.chainPath("pod.manifest")).asNormalizedPath).array; + auto pth_2_ = ((pod_root(fn_src).filesystem_open_zpod.chainPath("pod.manifest")).asNormalizedPath).array; + struct _pods { + auto zpod() { + return pth_1_; + } + auto filesystem_open_zpod() { + assert(pod_root_.filesystem_open_zpod.chainPath(zpod).array == pth_2_); + return pth_2_; + } + } + return _pods(); + } auto media_root(string fn_src) { auto pod_root_ = pod_root(fn_src); - auto pth_1_ = "media"; + auto pth_1_ = ((pod_root(fn_src).zpod.chainPath("media")).asNormalizedPath).array; auto pth_2_ = ((pod_root(fn_src).filesystem_open_zpod.chainPath("media")).asNormalizedPath).array; struct _pods { auto zpod() { -- cgit v1.2.3