예제 #1
0
        public string GetTemplateString(ITemplatedItem item)
        {
            var finderStrategy = _finderFactory.GetStrategy(item);
            var templatePath   = TemplatesBasePath + finderStrategy.GetTemplatePathByConvention(item) + Extension;

            if (!File.Exists(templatePath))
            {
                templatePath = TemplatesBasePath + finderStrategy.GetTemplatePathDefault(item) + Extension;
            }
            if (string.IsNullOrEmpty(templatePath))
            {
                throw new InvalidOperationException($"liquid viewnot found for {item.GetType()} handle => {item.Handle}");
            }
            return(GetTemplateString(templatePath));
        }
예제 #2
0
 private static string CunstructMessage(ITemplatedItem item, ILiquidTemplateFinderStrategy strategy)
 {
     return($"invalid templated item : {item.GetType().Name} for strategy : {strategy.GetType().Name}");
 }