Пример #1
0
        protected TemplateObject(SiteObject site, ContentObjectType objectType, FileEntry sourceFileInfo = null, ScriptInstance scriptInstance = null, UPath?path = null)
        {
            Site         = site ?? throw new ArgumentNullException(nameof(site));
            SourceFile   = sourceFileInfo;
            FrontMatter  = scriptInstance?.FrontMatter;
            Script       = scriptInstance?.Template;
            ObjectType   = objectType;
            Dependencies = new List <ContentDependency>();


            Path = path ?? SourceFile?.Path ?? null;
            if (SourceFile != null)
            {
                Length       = SourceFile.Length;
                Extension    = SourceFile.ExtensionWithDot?.ToLowerInvariant();
                ModifiedTime = SourceFile.LastWriteTime;
            }
        }
Пример #2
0
 protected ContentObject(SiteObject site, ContentObjectType objectType, FileEntry sourceFileInfo = null, ScriptInstance scriptInstance = null, UPath?path = null) : base(site, objectType, sourceFileInfo, scriptInstance, path)
 {
     // Default to single layout type
     LayoutType = "single";
 }