Skip to content

Commit b53db79

Browse files
committed
website: setup statix
1 parent 32217c9 commit b53db79

File tree

6 files changed

+232
-0
lines changed

6 files changed

+232
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
website/content/**/index.html
12
testOutput
23
bin
34
obj

website/builder/Program.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+

2+
using System;
3+
using System.IO;
4+
5+
namespace Builder
6+
{
7+
public static class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
string thisFile = System.Reflection.Assembly.GetExecutingAssembly().Location;
12+
string repoRoot = Path.GetFullPath(Path.Combine(thisFile, "../../../../../../"));
13+
string contentFolder = Path.Combine(repoRoot, "website/content/");
14+
string themeFolder = Path.Combine(repoRoot, "website/theme/");
15+
string sourceUrl = "https://github.com/swharden/pyABF/tree/master/website/content/";
16+
string rootUrl = (args.Length == 1) ? args[0] : "http://localhost:8080/pyabf/";
17+
18+
Console.WriteLine($"Creating website with root URL: {rootUrl}");
19+
var gen = new Statix.Generator(contentFolder, themeFolder, rootUrl, sourceUrl);
20+
gen.HeaderRequirements.RequireDate = false;
21+
gen.Generate();
22+
}
23+
}
24+
}

website/builder/builder.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net5.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="statix" Version="0.0.9" />
10+
</ItemGroup>
11+
12+
</Project>

website/docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
pyabf:
3+
image: httpd:2
4+
ports:
5+
- "8080:80"
6+
volumes:
7+
- ./content/:/usr/local/apache2/htdocs/pyabf/

website/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
To build and run the website locally:
2+
3+
* build: `dotnet run`
4+
* serve: `docker-compose up -d`
5+
* http://localhost:8080/pyabf/

website/theme/article-single.html

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
8+
<title>{{TITLE}}</title>
9+
<meta name='description' content='{{DESCRIPTION}}' />
10+
<link rel="shortcut icon" href="{{URL_SITE_ROOT}}/favicon.ico" />
11+
<base href="{{URL_PAGE_BASE}}">
12+
13+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
14+
integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
15+
16+
<!-- Global site tag (gtag.js) - Google Analytics -->
17+
<script async src='https://www.googletagmanager.com/gtag/js?id=UA-560719-1'></script>
18+
<script>
19+
window.dataLayer = window.dataLayer || [];
20+
function gtag() { dataLayer.push(arguments); }
21+
gtag('js', new Date());
22+
gtag('config', 'UA-560719-1');
23+
</script>
24+
25+
<!-- syntax highlighting -->
26+
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/xcode.min.css">
27+
<script src="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
28+
<script defer>hljs.highlightAll();</script>
29+
<style>
30+
a {
31+
text-decoration: none;
32+
}
33+
34+
a:hover {
35+
text-decoration: underline;
36+
}
37+
38+
article img {
39+
margin-top: 1em;
40+
margin-bottom: 1em;
41+
max-width: 100% !important;
42+
}
43+
44+
article .img-border img {
45+
border: 1px solid black;
46+
box-shadow: 5px 5px 10px rgb(0 0 0 / 20%);
47+
margin-top: 1em;
48+
margin-bottom: 2em;
49+
}
50+
51+
article .img-micro img {
52+
max-width: 25% !important;
53+
max-height: 12em !important;
54+
margin: .5em !important;
55+
}
56+
57+
article .img-small img {
58+
max-width: 35% !important;
59+
margin: 1em !important;
60+
}
61+
62+
article .img-medium img {
63+
max-width: 65% !important;
64+
margin: 1em !important;
65+
}
66+
67+
article code.hljs {
68+
background: transparent;
69+
margin-top: 2em;
70+
margin-bottom: 2em;
71+
padding: .5em !important;
72+
background: #f8f8f8;
73+
border-radius: 5px;
74+
border: 1px solid #ddd !important;
75+
font-size: 14px;
76+
line-height: 150%;
77+
overflow-x: auto;
78+
}
79+
80+
/* GitHub-style tables */
81+
82+
table {
83+
margin: 2em 0em;
84+
}
85+
86+
td {
87+
border: 1px solid #dfe2e5;
88+
padding: .4em;
89+
}
90+
91+
th {
92+
background-color: #f6f8fa;
93+
border: 1px solid #dfe2e5;
94+
font-weight: 600;
95+
padding: .4em;
96+
}
97+
</style>
98+
99+
</head>
100+
101+
<body class="bg-light">
102+
103+
<!-- BACKGROUND SPLASH COLOR -->
104+
<div class="h-50 w-100" style="position: absolute; background-color: #00523f"></div>
105+
106+
<!-- CENTER CONTAINER -->
107+
<div class="container-md mx-auto" style="position: relative; max-width: 950px;">
108+
<div class="row">
109+
<div class="col mb-5">
110+
111+
<!-- CUSTOMIZE NAVIGATION -->
112+
<nav class="text-end p-2">
113+
<a class="btn btn-lg menuButton ms-2 text-light" href="{{URL_SITE_ROOT}}" role="button">Home</a>
114+
115+
<div class="dropdown d-inline-block">
116+
<a class="btn btn-lg menuButton ms-2 text-light dropdown-toggle" role="button" id="dropdownMenuLink"
117+
data-bs-toggle="dropdown" aria-expanded="false">
118+
Tutorial
119+
</a>
120+
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
121+
<li><a class="dropdown-item" href="{{URL_SITE_ROOT}}/tutorial">Quickstart</a></li>
122+
<li><a class="dropdown-item" href="{{URL_SITE_ROOT}}/advanced">Advanced Examples</a></li>
123+
</ul>
124+
</div>
125+
126+
<div class="dropdown d-inline-block">
127+
<a class="btn btn-lg menuButton ms-2 text-light dropdown-toggle" role="button" id="dropdownMenuLink"
128+
data-bs-toggle="dropdown" aria-expanded="false">
129+
Developers
130+
</a>
131+
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
132+
<li><a class="dropdown-item" href="https://github.com/swharden/pyABF">pyABF on GitHub</a></li>
133+
<li><a class="dropdown-item" href="{{URL_SITE_ROOT}}/abf2-file-format">ABF2 File Format</a></li>
134+
<li><a class="dropdown-item" href="{{URL_SITE_ROOT}}/abf1-file-format">ABF1 File Format</a></li>
135+
</ul>
136+
</div>
137+
138+
</nav>
139+
140+
<header class="row mt-3 p-2 text-light">
141+
<div class="display-3 fw-normal">
142+
<a href="{{URL_SITE_ROOT}}" style="color: inherit;">
143+
pyABF
144+
</a>
145+
</div>
146+
<div class="fs-6" style="opacity: 50%;">
147+
A simple Python interface for Axon Binary Format (ABF) files
148+
</div>
149+
</header>
150+
151+
<article class="row border-top border-2 mb-5">
152+
<div class="bg-white text-dark border shadow">
153+
<div class="p-3">
154+
{{CONTENT}}
155+
</div>
156+
</div>
157+
</article>
158+
159+
</div>
160+
</div>
161+
162+
</div>
163+
164+
<footer class="opacity-50 p-3 mt-5 text-center" style="opacity: 30%;">
165+
<div>
166+
167+
</div>
168+
<div>
169+
<a href='https://github.com/swharden/statix' class="text-dark">Built with Statix</a>
170+
|
171+
Copyright &#169;
172+
<script>document.write(new Date().getFullYear())</script> Scott W Harden
173+
|
174+
<a href='{{URL_PAGE_SOURCE}}' class="text-dark">View Source</a>
175+
</div>
176+
</footer>
177+
178+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
179+
integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ"
180+
crossorigin="anonymous"></script>
181+
</body>
182+
183+
</html>

0 commit comments

Comments
 (0)