private static bool IsOnlyFrontmatterCategories(SiteContext context) { object onlyFrontmatterCategories; if (!context.Config.TryGetValue("only_frontmatter_categories", out onlyFrontmatterCategories)) { return false; } return onlyFrontmatterCategories is bool && (bool) onlyFrontmatterCategories; }