Skip to content

Commit

Permalink
Converting to Kontent.Statiq - step 1
Browse files Browse the repository at this point in the history
Add basic generator
StyleSheet pipeline
Models + generator tool config
  • Loading branch information
alanta committed Nov 18, 2020
1 parent 9568dba commit 8ec92d3
Show file tree
Hide file tree
Showing 181 changed files with 482 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"kentico.kontent.modelgenerator": {
"version": "6.0.0",
"commands": [
"KontentModelGenerator"
]
}
}
}
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
*.swp
*.*~
project.lock.json
.DS_Store
*.pyc
nupkg/

# Visual Studio Code
.vscode

# Rider
.idea

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
msbuild.log
msbuild.err
msbuild.wrn

# Visual Studio 2015
.vs/
output

_site
.DS_Store
Gemfile.lock
Expand Down
15 changes: 15 additions & 0 deletions MemoirsTheme.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Kontent.Statiq" Version="1.0.0-beta0007" />
<PackageReference Include="Statiq.App" Version="1.0.0-beta.24" />
<PackageReference Include="Statiq.Sass" Version="1.0.0-beta.24" />
<PackageReference Include="Statiq.Web" Version="1.0.0-beta.8" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions MemoirsTheme.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
23 changes: 23 additions & 0 deletions Models/ContentTypes/CodeSnippet.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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 CodeSnippet
{
public const string Codename = "code_snippet";
public const string CodeCodename = "code";
public const string LanguageCodename = "language";

public string Code { get; set; }
public IEnumerable<IMultipleChoiceOption> Language { get; set; }
public IContentItemSystemAttributes System { get; set; }
}
}
10 changes: 10 additions & 0 deletions Models/ContentTypes/CodeSnippet.cs
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 CodeSnippet
{
}
}
45 changes: 45 additions & 0 deletions Models/ContentTypes/Container.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 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 Container
{
public const string Codename = "container";
public const string ItemsCodename = "items";
public const string MetadataMetaDescriptionCodename = "metadata__meta_description";
public const string MetadataMetaKeywordsCodename = "metadata__meta_keywords";
public const string MetadataMetaTitleCodename = "metadata__meta_title";
public const string MetadataOgDescriptionCodename = "metadata__og_description";
public const string MetadataOgImageCodename = "metadata__og_image";
public const string MetadataOgTitleCodename = "metadata__og_title";
public const string MetadataTwitterCardCodename = "metadata__twitter_card";
public const string MetadataTwitterCreatorCodename = "metadata__twitter_creator";
public const string MetadataTwitterImageCodename = "metadata__twitter_image";
public const string MetadataTwitterSiteCodename = "metadata__twitter_site";
public const string TitleCodename = "title";
public const string UrlCodename = "url";

public IEnumerable<object> Items { get; set; }
public string MetadataMetaDescription { get; set; }
public string MetadataMetaKeywords { get; set; }
public string MetadataMetaTitle { get; set; }
public string MetadataOgDescription { get; set; }
public IEnumerable<IAsset> MetadataOgImage { get; set; }
public string MetadataOgTitle { get; set; }
public IEnumerable<IMultipleChoiceOption> MetadataTwitterCard { get; set; }
public string MetadataTwitterCreator { get; set; }
public IEnumerable<IAsset> MetadataTwitterImage { get; set; }
public string MetadataTwitterSite { get; set; }
public IContentItemSystemAttributes System { get; set; }
public string Title { get; set; }
public string Url { get; set; }
}
}
10 changes: 10 additions & 0 deletions Models/ContentTypes/Container.cs
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 Container
{
}
}
30 changes: 30 additions & 0 deletions Models/ContentTypes/CustomTypeProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Kentico.Kontent.Delivery.Abstractions;

namespace Kentico.Kontent.Statiq.Memoirs.Models
{
public class CustomTypeProvider : ITypeProvider
{
private static readonly Dictionary<Type, string> _codenames = new Dictionary<Type, string>
{
{typeof(CodeSnippet), "code_snippet"},
{typeof(Container), "container"},
{typeof(CustomerCase), "customer_case"},
{typeof(GithubGist), "github_gist"},
{typeof(Home), "home"},
{typeof(Post), "post"}
};

public Type GetType(string contentType)
{
return _codenames.Keys.FirstOrDefault(type => GetCodename(type).Equals(contentType));
}

public string GetCodename(Type contentType)
{
return _codenames.TryGetValue(contentType, out var codename) ? codename : null;
}
}
}
61 changes: 61 additions & 0 deletions Models/ContentTypes/CustomerCase.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// 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 CustomerCase
{
public const string Codename = "customer_case";
public const string CustomerCodename = "customer";
public const string DescriptionCodename = "description";
public const string LinkCodename = "link";
public const string MetadataMetaDescriptionCodename = "metadata__meta_description";
public const string MetadataMetaKeywordsCodename = "metadata__meta_keywords";
public const string MetadataMetaTitleCodename = "metadata__meta_title";
public const string MetadataOgDescriptionCodename = "metadata__og_description";
public const string MetadataOgImageCodename = "metadata__og_image";
public const string MetadataOgTitleCodename = "metadata__og_title";
public const string MetadataTwitterCardCodename = "metadata__twitter_card";
public const string MetadataTwitterCreatorCodename = "metadata__twitter_creator";
public const string MetadataTwitterImageCodename = "metadata__twitter_image";
public const string MetadataTwitterSiteCodename = "metadata__twitter_site";
public const string SlidesCodename = "slides";
public const string StatusCodename = "status";
public const string TeaserImageCodename = "teaser_image";
public const string TeaserTextCodename = "teaser_text";
public const string TechnologyCodename = "technology";
public const string TitleCodename = "title";
public const string UrlPatternCodename = "url_pattern";
public const string WhatCodename = "what";

public string Customer { get; set; }
public string Description { get; set; }
public string Link { get; set; }
public string MetadataMetaDescription { get; set; }
public string MetadataMetaKeywords { get; set; }
public string MetadataMetaTitle { get; set; }
public string MetadataOgDescription { get; set; }
public IEnumerable<IAsset> MetadataOgImage { get; set; }
public string MetadataOgTitle { get; set; }
public IEnumerable<IMultipleChoiceOption> MetadataTwitterCard { get; set; }
public string MetadataTwitterCreator { get; set; }
public IEnumerable<IAsset> MetadataTwitterImage { get; set; }
public string MetadataTwitterSite { get; set; }
public IEnumerable<IAsset> Slides { get; set; }
public string Status { get; set; }
public IContentItemSystemAttributes System { get; set; }
public IEnumerable<IAsset> TeaserImage { get; set; }
public string TeaserText { get; set; }
public string Technology { get; set; }
public string Title { get; set; }
public string UrlPattern { get; set; }
public string What { get; set; }
}
}
10 changes: 10 additions & 0 deletions Models/ContentTypes/CustomerCase.cs
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 CustomerCase
{
}
}
25 changes: 25 additions & 0 deletions Models/ContentTypes/GithubGist.Generated.cs
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 GithubGist
{
public const string Codename = "github_gist";
public const string AccountCodename = "account";
public const string GistIdCodename = "gist_id";
public const string SubscriptCodename = "subscript";

public string Account { get; set; }
public string GistId { get; set; }
public string Subscript { get; set; }
public IContentItemSystemAttributes System { get; set; }
}
}
10 changes: 10 additions & 0 deletions Models/ContentTypes/GithubGist.cs
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 GithubGist
{
}
}
43 changes: 43 additions & 0 deletions Models/ContentTypes/Home.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// 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 Home
{
public const string Codename = "home";
public const string ContactCodename = "contact";
public const string MetadataMetaDescriptionCodename = "metadata__meta_description";
public const string MetadataMetaKeywordsCodename = "metadata__meta_keywords";
public const string MetadataMetaTitleCodename = "metadata__meta_title";
public const string MetadataOgDescriptionCodename = "metadata__og_description";
public const string MetadataOgImageCodename = "metadata__og_image";
public const string MetadataOgTitleCodename = "metadata__og_title";
public const string MetadataTwitterCardCodename = "metadata__twitter_card";
public const string MetadataTwitterCreatorCodename = "metadata__twitter_creator";
public const string MetadataTwitterImageCodename = "metadata__twitter_image";
public const string MetadataTwitterSiteCodename = "metadata__twitter_site";
public const string UrlPatternCodename = "url_pattern";

public string Contact { get; set; }
public string MetadataMetaDescription { get; set; }
public string MetadataMetaKeywords { get; set; }
public string MetadataMetaTitle { get; set; }
public string MetadataOgDescription { get; set; }
public IEnumerable<IAsset> MetadataOgImage { get; set; }
public string MetadataOgTitle { get; set; }
public IEnumerable<IMultipleChoiceOption> MetadataTwitterCard { get; set; }
public string MetadataTwitterCreator { get; set; }
public IEnumerable<IAsset> MetadataTwitterImage { get; set; }
public string MetadataTwitterSite { get; set; }
public IContentItemSystemAttributes System { get; set; }
public string UrlPattern { get; set; }
}
}
10 changes: 10 additions & 0 deletions Models/ContentTypes/Home.cs
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 Home
{
}
}
Loading

0 comments on commit 8ec92d3

Please sign in to comment.