diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..56a2f3a --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,39 @@ +[Bb]in/ +[Bb]uild/ +[Oo]bj/ +[Dd]ebug/ +[Rr]elease/ +[Pp]ackages/ +[Tt]ools/ +![Tt]ools/packages.config +[Oo]utput/ +![Ii]nput/ +nuget.exe +*.com +*.class +*.exe +*.o +*.so +*.user +Thumbs.db +_ReSharper* +*ReSharper.user +*dotCover +.JustCode +*.suo +.svn +ipch +*.ilk +*.sdf +*.opensdf +*.pdb +/*.~vsd +*UpgradeWizard* +.vs/* +TestResult.xml +/debug.log +/packages.xml +*.ncrunch* +.*crunch*.local.xml +/_NCrunch_Statiq.Framework +*.pfx \ No newline at end of file diff --git a/docs/Docs.csproj b/docs/Docs.csproj new file mode 100644 index 0000000..890536e --- /dev/null +++ b/docs/Docs.csproj @@ -0,0 +1,29 @@ + + + + Exe + netcoreapp3.1 + $(MSBuildProjectDirectory) + $(DefaultItemExcludes);output\**;.gitignore + + + + + + + + + + Never + + + Never + + + + + + + + + \ No newline at end of file diff --git a/docs/Docs.sln b/docs/Docs.sln new file mode 100644 index 0000000..2c71b39 --- /dev/null +++ b/docs/Docs.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Docs", "Docs.csproj", "{C337F609-A890-4E52-BDA3-91658039B0E3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C337F609-A890-4E52-BDA3-91658039B0E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C337F609-A890-4E52-BDA3-91658039B0E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C337F609-A890-4E52-BDA3-91658039B0E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C337F609-A890-4E52-BDA3-91658039B0E3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2FB3922B-494A-45EB-A479-FC507B8E107C} + EndGlobalSection +EndGlobal diff --git a/docs/Program.cs b/docs/Program.cs new file mode 100644 index 0000000..eb4c582 --- /dev/null +++ b/docs/Program.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using Docs.Shortcodes; +using Statiq.App; +using Statiq.Common; +using Statiq.Web; + +namespace Docs +{ + public static class Program + { + public static async Task Main(string[] args) => + await Bootstrapper.Factory + .CreateWeb(args) + .AddSetting(Constants.EditLink, ConfigureEditLink()) + .ConfigureSite("spectresystems", "spectre.console", "main") + .ConfigureDeployment(deployBranch: "docs") + .AddShortcode("Children", typeof(ChildrenShortcode)) + .AddShortcode("ColorTable", typeof(ColorTableShortcode)) + .AddPipelines() + .RunAsync(); + + private static Config ConfigureEditLink() + { + return Config.FromDocument((doc, ctx) => + { + return string.Format("https://github.com/{0}/{1}/edit/{2}/docs/input/{3}", + ctx.GetString(Constants.Site.Owner), + ctx.GetString(Constants.Site.Repository), + ctx.GetString(Constants.Site.Branch), + doc.Source.GetRelativeInputPath()); + }); + } + } +} diff --git a/docs/input/_layout.cshtml b/docs/input/_layout.cshtml new file mode 100644 index 0000000..fd9b35a --- /dev/null +++ b/docs/input/_layout.cshtml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + @{ + string title = @Document.ContainsKey(Keys.Title) ? $"Spectre.Console - {Document.GetString(Keys.Title)}" : "Spectre.Console"; + } + @title + + +
+ + @if (IsSectionDefined(Constants.Sections.Splash)) + { + @RenderSection(Constants.Sections.Splash, false) + } + @{ + string section = Document.Destination.Segments.Length > 1 ? Document.Destination.Segments[0].ToString() : null; + } + +
+ @if(section != null) + { +
+
+
+ @{ + string titleBarClasses = Document.GetBool(Constants.NoSidebar) ? string.Empty : "offset-md-3 offset-lg-2"; + } +
+
Spectre.Console
+
@(Document.GetString(Keys.Title) ?? Document.GetTitle())
+ @if (IsSectionDefined(Constants.Sections.Subtitle)) + { + @RenderSection(Constants.Sections.Subtitle, false) + } +
+
+
+
+
+
+
+ @if (Document.GetBool(Constants.NoSidebar)) + { +
+
+ } + else + { +
+
+
+
+ } +
+
+
+
+
+ } + +
+ @if (Document.GetBool(Constants.NoContainer)) + { +
+ @RenderBody() +
+ } + else + { +
+
+ @if (Document.GetBool(Constants.NoSidebar)) + { + IgnoreSection(Constants.Sections.Sidebar); + +
+ @RenderBody() +
+ } + else + { + +
+ @RenderBody() +
+ } +
+ @{ + IReadOnlyList headings = Document.GetDocumentList(Statiq.Html.HtmlKeys.Headings); + if (headings.Count > 0) + { +
+

On This Page

+ @foreach (IDocument heading in headings) + { +

@(await heading.GetContentStringAsync())

+ } +
+ } + } + @if (Document.ContainsKey("EditLink")) + { +

Edit This Page

+ } +
+
+
+ } +
+
+
+ + + + \ No newline at end of file diff --git a/docs/input/_posts.cshtml b/docs/input/_posts.cshtml new file mode 100644 index 0000000..8303499 --- /dev/null +++ b/docs/input/_posts.cshtml @@ -0,0 +1,42 @@ +
+ @foreach (IDocument post in Document.GetChildren()) + { + IDocument topicDocument = Outputs[nameof(Archives)][$"blog/topics/{post.GetString("topic")}/index.html"]; + string excerpt = post.GetString(Statiq.Html.HtmlKeys.Excerpt); +
+
+
@post.GetString("Title")
+
+ @post.GetDateTime("Published").ToLongDateString() in + @topicDocument.GetTitle() +
+ @if (!string.IsNullOrEmpty(excerpt)) + { + @Html.Raw(excerpt) +

Read more...

+ } +
+
+ } + @{ + IDocument older = Document.GetDocument(Keys.Next); + IDocument newer = Document.GetDocument(Keys.Previous); + } + @if (older != null || newer != null) + { +
+
+ @if (older != null) + { + Older + } +
+
+ @if (newer != null) + { + Newer + } +
+
+ } +
\ No newline at end of file diff --git a/docs/input/_viewimports.cshtml b/docs/input/_viewimports.cshtml new file mode 100644 index 0000000..0ceab77 --- /dev/null +++ b/docs/input/_viewimports.cshtml @@ -0,0 +1,7 @@ +@using Statiq.Common +@using Statiq.Razor +@using Statiq.Web +@using Statiq.Web.Pipelines +@using Docs + +@inherits StatiqRazorPage \ No newline at end of file diff --git a/docs/input/_viewstart.cshtml b/docs/input/_viewstart.cshtml new file mode 100644 index 0000000..4b0dc6f --- /dev/null +++ b/docs/input/_viewstart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = @"/_layout.cshtml"; +} \ No newline at end of file diff --git a/docs/input/assets/bootstrap/_alert.scss b/docs/input/assets/bootstrap/_alert.scss new file mode 100644 index 0000000..da2a98a --- /dev/null +++ b/docs/input/assets/bootstrap/_alert.scss @@ -0,0 +1,51 @@ +// +// Base styles +// + +.alert { + position: relative; + padding: $alert-padding-y $alert-padding-x; + margin-bottom: $alert-margin-bottom; + border: $alert-border-width solid transparent; + @include border-radius($alert-border-radius); +} + +// Headings for larger alerts +.alert-heading { + // Specified to prevent conflicts of changing $headings-color + color: inherit; +} + +// Provide class for links that match alerts +.alert-link { + font-weight: $alert-link-font-weight; +} + + +// Dismissible alerts +// +// Expand the right padding and account for the close button's positioning. + +.alert-dismissible { + padding-right: $close-font-size + $alert-padding-x * 2; + + // Adjust close link position + .close { + position: absolute; + top: 0; + right: 0; + padding: $alert-padding-y $alert-padding-x; + color: inherit; + } +} + + +// Alternate styles +// +// Generate contextual modifier classes for colorizing the alert. + +@each $color, $value in $theme-colors { + .alert-#{$color} { + @include alert-variant(theme-color-level($color, $alert-bg-level), theme-color-level($color, $alert-border-level), theme-color-level($color, $alert-color-level)); + } +} diff --git a/docs/input/assets/bootstrap/_badge.scss b/docs/input/assets/bootstrap/_badge.scss new file mode 100644 index 0000000..42c5d08 --- /dev/null +++ b/docs/input/assets/bootstrap/_badge.scss @@ -0,0 +1,54 @@ +// Base class +// +// Requires one of the contextual, color modifier classes for `color` and +// `background-color`. + +.badge { + display: inline-block; + padding: $badge-padding-y $badge-padding-x; + @include font-size($badge-font-size); + font-weight: $badge-font-weight; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + @include border-radius($badge-border-radius); + @include transition($badge-transition); + + @at-root a#{&} { + @include hover-focus() { + text-decoration: none; + } + } + + // Empty badges collapse automatically + &:empty { + display: none; + } +} + +// Quick fix for badges in buttons +.btn .badge { + position: relative; + top: -1px; +} + +// Pill badges +// +// Make them extra rounded with a modifier to replace v3's badges. + +.badge-pill { + padding-right: $badge-pill-padding-x; + padding-left: $badge-pill-padding-x; + @include border-radius($badge-pill-border-radius); +} + +// Colors +// +// Contextual variations (linked badges get darker on :hover). + +@each $color, $value in $theme-colors { + .badge-#{$color} { + @include badge-variant($value); + } +} diff --git a/docs/input/assets/bootstrap/_breadcrumb.scss b/docs/input/assets/bootstrap/_breadcrumb.scss new file mode 100644 index 0000000..d748894 --- /dev/null +++ b/docs/input/assets/bootstrap/_breadcrumb.scss @@ -0,0 +1,42 @@ +.breadcrumb { + display: flex; + flex-wrap: wrap; + padding: $breadcrumb-padding-y $breadcrumb-padding-x; + margin-bottom: $breadcrumb-margin-bottom; + @include font-size($breadcrumb-font-size); + list-style: none; + background-color: $breadcrumb-bg; + @include border-radius($breadcrumb-border-radius); +} + +.breadcrumb-item { + // The separator between breadcrumbs (by default, a forward-slash: "/") + + .breadcrumb-item { + padding-left: $breadcrumb-item-padding; + + &::before { + display: inline-block; // Suppress underlining of the separator in modern browsers + padding-right: $breadcrumb-item-padding; + color: $breadcrumb-divider-color; + content: escape-svg($breadcrumb-divider); + } + } + + // IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built + // without `