summary refs log tree commit diff
path: root/GitStaticPageBuilder
diff options
context:
space:
mode:
Diffstat (limited to 'GitStaticPageBuilder')
-rw-r--r--GitStaticPageBuilder/GitStaticPageBuilder.csproj21
-rw-r--r--GitStaticPageBuilder/Pages/RepoPage.cs14
-rw-r--r--GitStaticPageBuilder/Program.cs14
-rw-r--r--GitStaticPageBuilder/Resources/RepoPage.html12
-rw-r--r--GitStaticPageBuilder/output/repo.html10
-rw-r--r--GitStaticPageBuilder/output/repo.json5
6 files changed, 76 insertions, 0 deletions
diff --git a/GitStaticPageBuilder/GitStaticPageBuilder.csproj b/GitStaticPageBuilder/GitStaticPageBuilder.csproj
new file mode 100644
index 0000000..2858582
--- /dev/null
+++ b/GitStaticPageBuilder/GitStaticPageBuilder.csproj
@@ -0,0 +1,21 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net7.0</TargetFramework>
+        <ImplicitUsings>enable</ImplicitUsings>
+        <Nullable>enable</Nullable>
+    </PropertyGroup>
+
+    <ItemGroup>
+      <ProjectReference Include="..\LibGit\LibGit.csproj" />
+    </ItemGroup>
+
+    <ItemGroup>
+        <Folder Include="Resources\" />
+        <Content Include="Resources\**">
+            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
+
+</Project>
diff --git a/GitStaticPageBuilder/Pages/RepoPage.cs b/GitStaticPageBuilder/Pages/RepoPage.cs
new file mode 100644
index 0000000..d0aac1e
--- /dev/null
+++ b/GitStaticPageBuilder/Pages/RepoPage.cs
@@ -0,0 +1,14 @@
+using System.Text.Encodings.Web;
+using LibGit;
+
+namespace GitStaticPageBuilder.Pages;
+
+public class RepoPage
+{
+    public static string GetRepoPage(GitRepo repo)
+    {
+        var basePage = File.ReadAllText("Resources/RepoPage.html");
+
+        return basePage;
+    }
+}
\ No newline at end of file
diff --git a/GitStaticPageBuilder/Program.cs b/GitStaticPageBuilder/Program.cs
new file mode 100644
index 0000000..e70e3c0
--- /dev/null
+++ b/GitStaticPageBuilder/Program.cs
@@ -0,0 +1,14 @@
+// See https://aka.ms/new-console-template for more information
+
+using GitStaticPageBuilder.Pages;
+using LibGit;
+using LibGit.Extensions;
+
+Console.WriteLine("Hello, World!");
+
+var repo = new GitRepo("/home/root@Rory/git/spacebar/server/.git");
+Console.WriteLine(repo.ToJson(ignoreNull: false, indent: true, unsafeContent: true));
+if(!Directory.Exists("output"))
+    Directory.CreateDirectory("output");
+File.WriteAllText("output/repo.json", repo.ToJson(ignoreNull: false, indent: true, unsafeContent: true));
+File.WriteAllText("output/repo.html", RepoPage.GetRepoPage(repo));
\ No newline at end of file
diff --git a/GitStaticPageBuilder/Resources/RepoPage.html b/GitStaticPageBuilder/Resources/RepoPage.html
new file mode 100644
index 0000000..e9ba4fb
--- /dev/null
+++ b/GitStaticPageBuilder/Resources/RepoPage.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Repository</title>
+</head>
+<body>
+    <h1>$NAME</h1>
+    <p>$DESCRIPTION</p>
+    <p></p>
+</body>
+</html>
\ No newline at end of file
diff --git a/GitStaticPageBuilder/output/repo.html b/GitStaticPageBuilder/output/repo.html
new file mode 100644
index 0000000..9cbfb90
--- /dev/null
+++ b/GitStaticPageBuilder/output/repo.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Repository</title>
+</head>
+<body>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/GitStaticPageBuilder/output/repo.json b/GitStaticPageBuilder/output/repo.json
new file mode 100644
index 0000000..f2140f4
--- /dev/null
+++ b/GitStaticPageBuilder/output/repo.json
@@ -0,0 +1,5 @@
+{
+  "RepoPath": "/home/root@Rory/git/spacebar/server/.git",
+  "Name": null,
+  "Description": "Spacebar Server - TypeScript version\n"
+}
\ No newline at end of file