internal bool Load(string configFile)
{
_configFileSourcePath = Path.GetDirectoryName(configFile);
var configData = File.ReadAllText(configFile, Encoding.UTF8);
if(string.IsNullOrWhiteSpace(configData))
{
Console.WriteLine("[ERROR] '{0}' is empty.", configFile);
return false;
}
_configData = JObject.Parse(configData);
if(_configData == null)
{
Console.WriteLine("[ERROR] Parsing '{0}' failed!", configFile);
return false;
}
if(string.IsNullOrWhiteSpace(this.ThemeFolder) || !Directory.Exists(this.ThemeFolder))
{
Console.WriteLine("[ERROR] Theme '{0}' or Themes folder not found.", this.ThemeFolder);
return false;
}
_templateContents = File.ReadAllText(this.PageTemplateFile, Encoding.UTF8);
if(string.IsNullOrWhiteSpace(_templateContents))
{
Console.WriteLine("[ERROR] Page template '{0}' is empty.", _configData.PageTemplate);
return false;
}
return true;
}