-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
602 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// This code was generated by a kontent-generators-net tool | ||
// (see https://github.com/Kentico/kontent-generators-net). | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. | ||
// For further modifications of the class, create a separate file with the partial class. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Kentico.Kontent.Delivery.Abstractions; | ||
|
||
namespace Kentico.Kontent.Statiq.Memoirs.Models | ||
{ | ||
public partial class Author | ||
{ | ||
public const string Codename = "author"; | ||
public const string AvatarImageCodename = "avatar_image"; | ||
public const string BioCodename = "bio"; | ||
public const string ContactsCodename = "contacts"; | ||
public const string EmailCodename = "email"; | ||
public const string NameCodename = "name"; | ||
|
||
public IEnumerable<IAsset> AvatarImage { get; set; } | ||
public string Bio { get; set; } | ||
public IEnumerable<object> Contacts { get; set; } | ||
public string Email { get; set; } | ||
public string Name { get; set; } | ||
public IContentItemSystemAttributes System { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Kentico.Kontent.Delivery.Abstractions; | ||
|
||
namespace Kentico.Kontent.Statiq.Memoirs.Models | ||
{ | ||
public partial class Author | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// This code was generated by a kontent-generators-net tool | ||
// (see https://github.com/Kentico/kontent-generators-net). | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. | ||
// For further modifications of the class, create a separate file with the partial class. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Kentico.Kontent.Delivery.Abstractions; | ||
|
||
namespace Kentico.Kontent.Statiq.Memoirs.Models | ||
{ | ||
public partial class Contact | ||
{ | ||
public const string Codename = "contact"; | ||
public const string IconCodename = "icon"; | ||
public const string NameCodename = "name"; | ||
public const string UrlCodename = "url"; | ||
|
||
public string Icon { get; set; } | ||
public string Name { get; set; } | ||
public IContentItemSystemAttributes System { get; set; } | ||
public string Url { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Kentico.Kontent.Delivery.Abstractions; | ||
|
||
namespace Kentico.Kontent.Statiq.Memoirs.Models | ||
{ | ||
public partial class Contact | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Kentico.Kontent.Delivery.Abstractions; | ||
using System.Collections.Generic; | ||
|
||
namespace Kentico.Kontent.Statiq.Memoirs.Models | ||
{ | ||
public interface IPageMetadata | ||
{ | ||
public string MetadataTwitterCreator { get; } | ||
public string UrlPattern { get; } | ||
public string MetadataMetaKeywords { get; } | ||
public IEnumerable<IAsset> MetadataTwitterImage { get; } | ||
public string MetadataOgTitle { get; } | ||
public IEnumerable<IAsset> MetadataOgImage { get; } | ||
public string MetadataTwitterSite { get; } | ||
public string MetadataMetaDescription { get; } | ||
public string MetadataMetaTitle { get; } | ||
public string MetadataOgDescription { get; } | ||
|
||
public string Title { get; } | ||
public IEnumerable<IAsset> TeaserImage { get; } | ||
public IEnumerable<IMultipleChoiceOption> MetadataTwitterCard { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
| ||
namespace Kentico.Kontent.Statiq.Memoirs.Models | ||
{ | ||
public class PostViewModel | ||
{ | ||
public PostViewModel(Post post, Author author, SiteSettings metadata) | ||
{ | ||
Post = post; | ||
Author = author; | ||
Metadata = metadata; | ||
} | ||
public Post Post { get; } | ||
public Author Author { get; } | ||
public SiteSettings Metadata { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Kentico.Kontent.Statiq.Memoirs.Models{ | ||
public class SiteSettings{ | ||
public string Name {get; set;} | ||
public string Title {get; set;} | ||
public string Description {get; set;} | ||
public string Logo {get; set;} | ||
public string Favicon {get; set;} | ||
public bool LazyImages { get; set; } | ||
public bool ImageShadow { get; set; } | ||
public string Copyright { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Statiq.Common; | ||
using Statiq.Core; | ||
|
||
namespace Kentico.Kontent.Statiq.Lumen.Pipelines | ||
{ | ||
public class Assets : Pipeline | ||
{ | ||
public Assets() | ||
{ | ||
InputModules = new ModuleList | ||
{ | ||
new ReadFiles(pattern: "assets/**/*.{*,!scss}"), | ||
new WriteFiles() | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Kentico.Kontent.Delivery.Abstractions; | ||
using Kentico.Kontent.Statiq.Memoirs.Models; | ||
using Kontent.Statiq; | ||
using Statiq.Common; | ||
using Statiq.Core; | ||
|
||
namespace Kentico.Kontent.Statiq.Lumen.Pipelines | ||
{ | ||
public class Authors : Pipeline | ||
{ | ||
public Authors(IDeliveryClient deliveryClient) | ||
{ | ||
InputModules = new ModuleList{ | ||
new Kontent<Author>(deliveryClient) | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Kentico.Kontent.Statiq.Lumen.Pipelines; | ||
using Kontent.Statiq; | ||
using Statiq.Common; | ||
using Statiq.Core; | ||
using System.Linq; | ||
|
||
namespace MemoirsTheme.Pipelines | ||
{ | ||
public class DownloadImages : Pipeline | ||
{ | ||
public DownloadImages() | ||
{ | ||
Dependencies.AddRange(nameof(Posts)); | ||
PostProcessModules = new ModuleList( | ||
// pull documents from other pipelines | ||
new ReplaceDocuments(Dependencies.ToArray()), | ||
new KontentDownloadImages() | ||
); | ||
OutputModules = new ModuleList( | ||
|
||
new WriteFiles() | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using Kentico.Kontent.Delivery.Abstractions; | ||
using Kentico.Kontent.Delivery.Urls.QueryParameters; | ||
using Kentico.Kontent.Statiq.Memoirs.Models; | ||
using Kontent.Statiq; | ||
using Statiq.Common; | ||
using Statiq.Core; | ||
using Statiq.Razor; | ||
using System.Linq; | ||
|
||
namespace Kentico.Kontent.Statiq.Lumen.Pipelines | ||
{ | ||
public class Posts : Pipeline | ||
{ | ||
public Posts(IDeliveryClient deliveryClient, SiteSettings site) | ||
{ | ||
Dependencies.AddRange(nameof(Authors)); | ||
InputModules = new ModuleList{ | ||
new Kontent<Post>(deliveryClient) | ||
.OrderBy(Post.PostDateCodename, SortOrder.Descending) | ||
.WithQuery(new DepthParameter(1), new IncludeTotalCountParameter()), | ||
/*new SetMetadata(nameof(Category), Config.FromDocument((doc, ctx) => | ||
{ | ||
// Add category (useful for grouping) | ||
return doc.AsKontent<Article>().SelectedCategory.System.Codename; | ||
})), | ||
new SetMetadata(nameof(Article.SelectedCategory), Config.FromDocument((doc, ctx) => | ||
{ | ||
// Add some extra metadata to be used later for creating filenames | ||
return doc.AsKontent<Article>().SelectedCategory; | ||
})), | ||
new SetMetadata(nameof(Tag), Config.FromDocument((doc, ctx) => | ||
{ | ||
// Add tag (useful for grouping) | ||
return doc.AsKontent<Article>().TagObjects.Select(t=>t.System.Codename); | ||
})), | ||
new SetMetadata(nameof(Article.TagObjects), Config.FromDocument((doc, ctx) => | ||
{ | ||
// Add some extra metadata to be used later for creating filenames | ||
return doc.AsKontent<Article>().TagObjects; | ||
})),*/ | ||
new SetDestination(Config.FromDocument((doc, ctx) => new NormalizedPath($"posts/{doc.AsKontent<Post>().Url}" ))), | ||
}; | ||
|
||
ProcessModules = new ModuleList { | ||
new MergeContent(new ReadFiles(patterns: "Post.cshtml") ), | ||
new RenderRazor() | ||
.WithModel(Config.FromDocument((document, context) => | ||
new PostViewModel(document.AsKontent<Post>(), | ||
context.Outputs.FromPipeline(nameof(Authors)).Select(x => x.AsKontent<Author>()).FirstOrDefault(), | ||
site | ||
))), | ||
new KontentImageProcessor() | ||
}; | ||
|
||
OutputModules = new ModuleList { | ||
new WriteFiles(), | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Kentico.Kontent.Delivery.Abstractions; | ||
using Kentico.Kontent.Statiq.Memoirs.Models; | ||
using System.Linq; | ||
|
||
namespace MemoirsTheme.Resolvers | ||
{ | ||
public class CodeSnippetResolver : IInlineContentItemsResolver<CodeSnippet> | ||
{ | ||
public string Resolve(CodeSnippet data) | ||
{ | ||
return $"<pre><code class=\"language-{data.Language.First().Codename}\">{data.Code}</code></pre>"; | ||
} | ||
} | ||
} |
Oops, something went wrong.