Skip to content

Commit 9892130

Browse files
committed
feat: add original project metadata watermark
1 parent be8255d commit 9892130

2 files changed

Lines changed: 65 additions & 1 deletion

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,34 @@ Instead of maintaining CV text in multiple documents, the source of truth is one
4141
3. Strictly validated through JSON Schema.
4242
4. Consistent output across local and CI builds.
4343

44+
## Watermarking & Origin Tracking
45+
46+
Every build automatically embeds invisible metadata watermarks in the compiled HTML to prove origin and track distribution:
47+
48+
**What is watermarked:**
49+
- Proof of origin (project name: `folio-cv`)
50+
- Original author attribution (GitHub user: `txitxo0`)
51+
- Build timestamp (UTC ISO 8601)
52+
53+
**Where it's stored:**
54+
- Hidden HTML `<meta>` tags in the document `<head>`
55+
- Invisible to the rendered page, visible in HTML source code
56+
- Preserved in PDF exports (as document properties/metadata)
57+
58+
**Why hardcoded:**
59+
The watermark is intentionally hardcoded to the original project (`folio-cv` by `txitxo0`). This serves two purposes:
60+
61+
1. **Proof of origin** – Even if someone clones or forks this project, the watermark points back to the original creator.
62+
2. **Distribution tracking** – Each build is timestamped, making it possible to trace when a copy was created and distributed.
63+
64+
**For users cloning this project:**
65+
When you clone and build `folio-cv`, the watermark will still reference the original project. This is intentional and transparent. You are free to modify the JSON data, styles, and functionality, but the watermark remains as attribution to the original project source.
66+
67+
**Transparency:**
68+
- Watermark logic is visible in `build.py``generate_watermark_metadata()` function
69+
- No obfuscation or hidden code
70+
- Design choice is documented here in README
71+
4472
## Project Map
4573

4674
```text

build.py

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,32 @@
1313
import base64
1414
import json
1515
from pathlib import Path
16+
from datetime import datetime, timezone
17+
18+
19+
def generate_watermark_metadata() -> str:
20+
"""Generate invisible HTML watermark metadata for origin tracking and distribution proof.
21+
22+
Watermark is intentionally hardcoded to the original project (folio-cv by txitxo0).
23+
This serves as proof of origin and helps track distribution, even in forks/clones.
24+
See README.md for details.
25+
26+
Returns:
27+
HTML meta tags as string with origin, timestamp, and attribution
28+
"""
29+
github_user = "txitxo0" # Original project author - hardcoded by design
30+
project_name = "folio-cv" # Original project name - hardcoded by design
31+
timestamp = datetime.now(timezone.utc).isoformat().replace("+00:00", "Z")
32+
watermark = f"{project_name}:{github_user}:{timestamp}"
33+
34+
meta_tags = (
35+
" <!-- Watermark metadata for origin tracking and distribution proof -->\n"
36+
f' <meta name="watermark-origin" content="{watermark}">\n'
37+
f' <meta name="watermark-project" content="{project_name}">\n'
38+
f' <meta name="watermark-author" content="{github_user}">\n'
39+
f' <meta name="watermark-timestamp" content="{timestamp}">\n'
40+
)
41+
return meta_tags
1642

1743

1844
def validate_data_schema(schema_path: Path, data_obj: dict):
@@ -59,10 +85,18 @@ def main():
5985
js = src_js.read_text(encoding="utf-8-sig")
6086
data = src_data.read_text(encoding="utf-8-sig")
6187

88+
# Inject watermark metadata before </head>
89+
watermark_meta = generate_watermark_metadata()
90+
head_close = "</head>"
91+
if head_close in html:
92+
compiled = html.replace(head_close, watermark_meta + head_close)
93+
else:
94+
compiled = html
95+
6296
# Inject CSS (remove link tag, add style tag)
6397
css_link = '<link rel="stylesheet" href="assets/css/cv.css">'
6498
style_tag = f"<style>\n{css}\n</style>"
65-
compiled = html.replace(css_link, style_tag)
99+
compiled = compiled.replace(css_link, style_tag)
66100

67101
# Inline favicon so dist/index.html remains self-contained.
68102
favicon_link = (
@@ -159,7 +193,9 @@ def main():
159193
size_kb = len(compiled.encode("utf-8")) / 1024
160194
print(f"✅ Build complete: {output_path}")
161195
print(f"📦 Size: {size_kb:.2f} KB")
196+
print("🔐 Watermark metadata embedded (proof of origin: folio-cv by txitxo0)")
162197
print("🚀 Ready to deploy to GitHub Pages")
198+
print(" See README.md for details on watermarking and distribution tracking")
163199

164200
except Exception as err:
165201
print(f"❌ Build failed: {err}")

0 commit comments

Comments
 (0)