Skip to content

Commit db451f5

Browse files
committed
Add JS/CSS minification to pages workflow and update README
1 parent 61edf70 commit db451f5

4 files changed

Lines changed: 24 additions & 4 deletions

File tree

‎.github/workflows/pages.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ jobs:
2121
- name: Checkout repository
2222
uses: actions/checkout@v4
2323

24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 24
28+
29+
- name: Minify JavaScript
30+
run: npx terser script-builder/script.js -o script-builder/script.min.js
31+
32+
- name: Minify CSS
33+
run: npx clean-css-cli -o script-builder/style.min.css script-builder/style.css
34+
2435
- name: Upload artifact
2536
uses: actions/upload-pages-artifact@v3
2637
with:

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ node_modules/
55
/blob-report/
66
/playwright/.cache/
77
/playwright/.auth/
8+
9+
# Generated minified files
10+
script-builder/*.min.js
11+
script-builder/*.min.css

‎README.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# form-attribution
1+
# Form Attribution
22

33
Automatically capture and persist marketing attribution parameters (UTM tags, referrer data, landing pages) and inject them into HTML forms as hidden fields.
44

5+
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE.md)
6+
[![npm version](https://img.shields.io/npm/v/form-attribution.svg)](https://www.npmjs.com/package/form-attribution)
7+
8+
**[Try the Script Builder](https://form-attribution.flashbrew.digital)** - Generate a configured script tag with a visual interface.
9+
510
## Features
611

712
- **Zero dependencies** - Self-contained script using only browser APIs
@@ -142,7 +147,7 @@ This creates fields like `lead_utm_source`, `lead_utm_medium`, etc.
142147

143148
## Script Builder
144149

145-
Use the interactive [Script Builder](script-builder/index.html) tool to generate a configured script tag with a visual interface.
150+
Use the interactive [Script Builder](https://form-attribution.flashbrew.digital) tool to generate a configured script tag with a visual interface.
146151

147152
## Storage Fallback Chain
148153

‎script-builder/index.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
content="https://form-attribution.flashbrew.digital/opengraph-image.png"
5858
>
5959

60-
<link rel="stylesheet" href="style.css">
60+
<link rel="stylesheet" href="style.min.css" fetchpriority="high">
6161

6262
<link
6363
id="hljs-theme-light"
@@ -696,6 +696,6 @@ <h2 class="card-title">Generated Script Tag</h2>
696696
src="https://cdn.jsdelivr.net/npm/gsap@3.14.1/dist/gsap.min.js"
697697
></script>
698698

699-
<script defer src="script.js"></script>
699+
<script defer src="script.min.js"></script>
700700
</body>
701701
</html>

0 commit comments

Comments
 (0)