Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Layout is coming together
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Jan 11, 2018
1 parent b6b4952 commit c612977
Show file tree
Hide file tree
Showing 13 changed files with 2,400 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
@@ -0,0 +1,12 @@
[Pp]ackages/
[Tt]ools/*
![Tt]ools/packages.config
[Oo]utput/
[Rr]elease/
nuget.exe
/debug.log
/node_modules/
/output.zip
/packages.xml
/config.wyam.hash
/config.wyam.dll
88 changes: 88 additions & 0 deletions build.cake
@@ -0,0 +1,88 @@
// The following environment variables need to be set:
// DISCOVERDOTNET_GITHUB_TOKEN
// DISCOVERDOTNET_NETLIFY_TOKEN

#tool "Wyam"
#addin "Cake.Wyam"
#addin "NetlifySharp"
#addin "Newtonsoft.Json"
#addin "System.Runtime.Serialization.Formatters"

using NetlifySharp;

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////

var isLocal = BuildSystem.IsLocalBuild;
var isRunningOnAppVeyor = AppVeyor.IsRunningOnAppVeyor;
var isPullRequest = AppVeyor.Environment.PullRequest.IsPullRequest;
var buildNumber = AppVeyor.Environment.Build.Number;

var outputDir = Directory("./output");

///////////////////////////////////////////////////////////////////////////////
// SETUP / TEARDOWN
///////////////////////////////////////////////////////////////////////////////

Setup(context =>
{
Information("Building Discover .NET");
});

//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Build")
.Description("Generates the site.")
.Does(() =>
{
Wyam(new WyamSettings
{
UpdatePackages = true
});
});

Task("Preview")
.Description("Generates and previews the site.")
.Does(() =>
{
Wyam(new WyamSettings
{
Preview = true,
Watch = true,
UpdatePackages = true
});
});

Task("Publish")
.Description("Generates and deploys the site.")
.IsDependentOn("Build")
.Does(() =>
{
Information("Deploying output to Netlify");
var netlifyToken = EnvironmentVariable("DISCOVERDOTNET_NETLIFY_TOKEN");
var client = new NetlifyClient(netlifyToken);
client.UpdateSite("discoverdotnet.netlify.com", MakeAbsolute(outputDir).FullPath).SendAsync().Wait();
});


//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Task("Default")
.IsDependentOn("Build");

//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////

RunTarget(target);
2 changes: 2 additions & 0 deletions build.cmd
@@ -0,0 +1,2 @@
@echo off
powershell -ExecutionPolicy Unrestricted ./build.ps1 %CAKE_ARGS% %*
33 changes: 33 additions & 0 deletions build.ps1
@@ -0,0 +1,33 @@
Param
(
[String]$CakeVersion = "0.23.0",
[String]$ToolsDir = "$PSScriptRoot\tools",
[String]$ToolsProj = "$ToolsDir\build.csproj",
[String]$BuildFile = "$PSScriptRoot\build.cake",
[String]$Target = 'Default'
)

$CAKE_DIR = "$ToolsDir\Cake.CoreCLR.$CakeVersion"
$CAKE_DLL = "$CAKE_DIR\cake.coreclr\$CakeVersion\Cake.dll"

If (!(Test-Path $ToolsDir))
{
New-Item -ItemType Directory -Force -Path $ToolsDir
}

if (!(Test-Path $ToolsProj))
{
$projectFileContents = '<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><OutputType>Exe</OutputType><TargetFramework>netcoreapp2.0</TargetFramework></PropertyGroup></Project>'
Out-File -InputObject $projectFileContents -FilePath $ToolsProj
}

dotnet add "$ToolsProj" package cake.coreclr -v "$CakeVersion" --package-directory "$CAKE_DIR"

if (!(Test-Path $CAKE_DLL))
{
Write-Error "Could not find Cake assembly '$CAKE_DLL'"
}
else
{
dotnet "$CAKE_DLL" "$BuildFile" --target="$Target"
}
14 changes: 14 additions & 0 deletions config.wyam
@@ -0,0 +1,14 @@
#n Wyam.Yaml
#n Wyam.Razor
#n Wyam.Markdown

Pipelines.Add("Pages",
ReadFiles("{!_,}*.cshtml"),
Razor()
.WithLayout("_Layout.cshtml"),
WriteFiles(".html")
);

Pipelines.Add("Resources",
CopyFiles("**/*{!.cshtml,!.md,!.less,!.yml,}")
);
61 changes: 61 additions & 0 deletions input/_Layout.cshtml
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Discover .NET</title>

<link type="text/css" rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@next/dist/css/bootstrap.min.css"/>
<link type="text/css" rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap-vue@latest/dist/bootstrap-vue.css"/>
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="/assets/styles.css"/>
<script src="//cdn.jsdelivr.net/npm/vue"></script>
<script src="//cdn.jsdelivr.net/npm/babel-polyfill@latest/dist/polyfill.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/bootstrap-vue@latest/dist/bootstrap-vue.js"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.3/js/all.js"></script>
</head>
<body>
<div id="app" class="d-flex flex-column flex-nowrap h-100">
<header class="mb-4">
<b-jumbotron fluid text-variant="white" class="text-center mb-0">
<b-img slot="header" src="/assets/logo-white.svg" fluid alt="Discover .NET" style="min-width: 50%"></b-img>
<span slot="lead" class="accent-script">Awesome .NET open source & community resources</span>
</b-jumbotron>
<b-navbar toggleable="md" type="dark" variant="dark">
<b-navbar-toggle target="nav_collapse"></b-navbar-toggle>
<b-collapse is-nav id="nav_collapse">
<b-container>
<b-navbar-nav class="float-left">
<b-nav-item href="#">Projects</b-nav-item>
<b-nav-item href="#">Help Wanted</b-nav-item>
<b-nav-item href="#">Resources</b-nav-item>
<b-nav-item href="#">Blogs</b-nav-item>
<b-nav-item href="#">People</b-nav-item>
<b-nav-item href="#">Events</b-nav-item>
</b-navbar-nav>
<b-navbar-nav class="float-right">
<b-nav-item href="#">Get Involved</b-nav-item>
<b-nav-item href="#">Add</b-nav-item>
<b-nav-item href="#">About</b-nav-item>
</b-navbar-nav>
</b-container>
</b-collapse>
</b-navbar>
</header>
<main>
<b-container>
@RenderBody()
</b-container>
</main>
<footer class="bg-dark small text-center text-muted py-3 mt-5">
<b-container>
<div>&hearts; Generated by <a href="https://wyam.io" class="text-light">Wyam</a> on <a href="https://appveyor.com" class="text-light">AppVeyor</a> and hosted at <a href="https://netlify.com" class="text-light">Netlify</a></div>
</b-container>
</footer>
</div>
<script>
new Vue({
el: '#app'
});
</script>
</body>
</html>
Binary file added input/assets/langdon.eot
Binary file not shown.

0 comments on commit c612977

Please sign in to comment.