1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950(* YOCaml a static blog generator.
Copyright (C) 2024 The Funkyworkers and The YOCaml's developers
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. *)moduleTpl=structtypet=Mustache.Json.valueletrecfrom=function|Yocaml.Data.Null->`Null|Yocaml.Data.Boolb->`Boolb|Yocaml.Data.Inti->`Float(float_of_inti)|Yocaml.Data.Floatf->`Floatf|Yocaml.Data.Strings->`Strings|Yocaml.Data.Listl->`A(List.mapfroml)|Yocaml.Data.Recordr->`O(List.map(fun(k,v)->(k,fromv))r)letrender?(strict=true)parameterscontent=letlayout=Mustache.of_stringcontentinMustache.render~strictlayout(`Oparameters)endletread_template?snapshot?stricttemplate=Yocaml.Pipeline.read_template(moduleTpl)?snapshot?stricttemplateletread_templates?snapshot?stricttemplates=Yocaml.Pipeline.read_templates(moduleTpl)?snapshot?stricttemplatesmodulePipeline=structletas_template(typea)(moduleI:Yocaml.Required.DATA_INJECTABLEwithtypet=a)?snapshot?stricttemplate=Yocaml.Pipeline.as_template(moduleTpl)(moduleI)?snapshot?stricttemplateendincludeTpl