-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
43 lines (32 loc) · 952 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$index_file = './index.html'
$panels_file = './Panels.json'
Set-Content -Path $index_file -Value @'
<!DOCTYPE html>
<html>
<head>
<title>Camto</title>
<link rel="stylesheet" href="style.css">
<script src="jquery-3.2.1.min.js"></script>
<script src="Panels.js"></script>
</head>
<body>
<h1>This is my GitHub page.</h1>
<div id="Panels">
'@
$panels = Get-Content -Raw -Path $panels_file | ConvertFrom-Json
Add-Content -Path $index_file -Value (($panels | % {@"
<div class="Panel">
<div class="Panel-Margin-Box">
<div class="Panel-Content-Box">
<a href="$($_.link)"><div class="Panel-Image" style="background-image: url('PICS/$($_.image)')"></div></a>
<a class="Panel-Title" href="$($_.link)">$($_.title)</a>
<div class="Panel-Description">$($_.description)</div>
</div>
</div>
</div>
"@}) -Join "`n`t`t`t`n")
Add-Content -Path $index_file -Value @'
</div>
</body>
</html>
'@