Skip to content

Commit

Permalink
add static build script
Browse files Browse the repository at this point in the history
  • Loading branch information
beni69 committed Aug 9, 2024
1 parent 4b100ed commit 380f891
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ testing

.mpy
.obsidian

out/
18 changes: 18 additions & 0 deletions build_static.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
set -e

test -d out && rm -rf out

mkdir -v out

cp -Rv datasheets lessons/{*.html,res} out/

wget "https://github.com/hakimel/reveal.js/archive/refs/tags/5.1.0.tar.gz"
tar -xvf 5.1.0.tar.gz
rm 5.1.0.tar.gz
mv -v reveal.js-5.1.0 out/reveal.js

cat datasheets/_index.html | tr '\n' ' ' |
python -c "print(input().replace('%TEMPLATE%', '$(ls -1 out/datasheets/*.pdf | xargs -n1 basename | awk '{print "<li><a href=\""$1"\">"$1"</a></li>"}' | tr '\n' ' ')'))" \
> out/datasheets/index.html
rm -v out/datasheets/_index.html
19 changes: 19 additions & 0 deletions datasheets/_index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Robotika[2024]</title>

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../reveal.js/dist/theme/night.css" />
</head>
<body class="reveal-viewport">
<div class="reveal">
<h3>Robotika[2024]</h3>

<ul>
%TEMPLATE%
</ul>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion lessons/03.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<!-- Title -->
<section>
<h1 class="r-fit-text">Robotika[3]</h1>
<h1 class="r-fit-text">Robotika[2]</h1>
<h2>2024</h2>
</section>

Expand Down
27 changes: 27 additions & 0 deletions lessons/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Robotika[2024]</title>

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="reveal.js/dist/theme/night.css" />
</head>
<body class="reveal-viewport">
<div class="reveal">
<h3>Robotika[2024]</h3>

<ul>
<li><a href="datasheets/index.html">Datasheets</a></li>
<li><a href="01.html">Robotika[0]</a></li>
<li><a href="02.html">Robotika[1]</a></li>
<li><a href="03.html">Robotika[2]</a></li>
<li><a href="04.html">Robotika[3]</a></li>
<li><a href="05.html">Robotika[4]</a></li>
<li><a href="06.html">Robotika[5]</a></li>
<li><a href="07.html">Robotika[6]</a></li>
<li><a href="08.html">Robotika[7]</a></li>
</ul>
</div>
</body>
</html>

0 comments on commit 380f891

Please sign in to comment.