Skip to content

Commit d1a5954

Browse files
committed
fix: add build for cfpages
1 parent 2562ee7 commit d1a5954

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

examples/context-editor/build.sh

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
# Generate version number
4+
VERSION=$(date +'%Y.%m.%d-%H%M%S')
5+
6+
# Ensure public directory exists
7+
mkdir -p public
8+
9+
# Copy files to public directory
10+
cp -R src/* public/
11+
12+
# Create version file
13+
echo $VERSION > public/version.txt
14+
15+
# Create a simple HTML page to display the version
16+
cat << EOF > public/version.html
17+
<!DOCTYPE html>
18+
<html lang="en">
19+
<head>
20+
<meta charset="UTF-8">
21+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
22+
<title>Version Information</title>
23+
</head>
24+
<body>
25+
<h1>Current Version: <span id="version"></span></h1>
26+
<script>
27+
fetch('version.txt')
28+
.then(response => response.text())
29+
.then(version => {
30+
document.getElementById('version').textContent = version;
31+
});
32+
</script>
33+
</body>
34+
</html>
35+
EOF
36+
37+
echo "Build completed. Version: $VERSION"

examples/context-editor/public/_headers

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
X-XSS-Protection: 1; mode=block
33
X-Content-Type-Options: nosniff
44
Referrer-Policy: strict-origin-when-cross-origin
5-
Content-Security-Policy: default-src 'self' https: *.github.io context.agenticinsights.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' 'unsafe-hashes' https: *.github.io context.agenticinsights.com; style-src 'self' 'unsafe-inline' https: *.github.io context.agenticinsights.com; img-src 'self' data: https: *.github.io context.agenticinsights.com; connect-src 'self' https: *.github.io context.agenticinsights.com; font-src 'self' https: *.github.io context.agenticinsights.com; frame-src 'self' https: *.github.io context.agenticinsights.com; frame-ancestors *;
6-
Permissions-Policy: camera=(), microphone=(), geolocation=()
5+
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self';
6+
Permissions-Policy: camera=(), microphone=(), geolocation()

0 commit comments

Comments
 (0)