예제 #1
0
        public static void SetTemplateHtml(TemplateInfo templateInfo, string html)
        {
            var directoryPath = GetTemplatesDirectoryPath();
            var htmlPath      = ApplicationUtils.PathCombine(directoryPath, templateInfo.Name, templateInfo.Main);

            ApplicationUtils.WriteText(htmlPath, html);
            ClearCache(htmlPath);
        }
예제 #2
0
        public static void Clone(string nameToClone, TemplateInfo templateInfo, List <TemplateInfo> templateInfoList)
        {
            var directoryPath = Context.PluginApi.GetPluginPath(ApplicationUtils.PluginId, "templates");

            ApplicationUtils.CopyDirectory(ApplicationUtils.PathCombine(directoryPath, nameToClone), ApplicationUtils.PathCombine(directoryPath, templateInfo.Name), true);

            var configJson = ApplicationUtils.JsonSerialize(templateInfo);
            var configPath = ApplicationUtils.PathCombine(directoryPath, templateInfo.Name, "config.json");

            ApplicationUtils.WriteText(configPath, configJson);
        }