public static Homepage ToHomepage(this prismic.Document doc) { return(new Homepage() { Description = doc.GetHtml($"{doc.Type}.description", new Helpers.PrismicLinkResolver()), MetaTitle = doc.GetText($"{doc.Type}.meta_title"), MetaDescription = doc.GetText($"{doc.Type}.meta_description") }); }
public static Experiment ToExperiment(this prismic.Document doc) { return(new Experiment() { Uid = doc.Uid, Name = doc.GetText($"{doc.Type}.name"), Description = doc.GetHtml($"{doc.Type}.description", new Helpers.PrismicLinkResolver()), Order = Convert.ToInt32(doc.GetNumber($"{doc.Type}.order")?.Value), ImageUrls = doc.GetGroup($"{doc.Type}.images").GroupDocs.Select(x => x.GetImageView("image", "main").Url).ToList(), MetaTitle = doc.GetText($"{doc.Type}.meta_title"), MetaDescription = doc.GetText($"{doc.Type}.meta_description") }); }