Skip to content

Commit 217f526

Browse files
committed
init website
1 parent b007028 commit 217f526

28 files changed

+1423
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Helps to maintain consistent coding style
2+
# Feel free to delete this file if you don't want it
3+
# Documentation: https://editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
indent_style = space
9+
indent_size = 2
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
charset = utf-8

.eleventyignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
./src/pages/test.njk
2+
./.github/**/*
3+
./.git/**/*
4+
./.cache/**/*
5+
./node_modules/**/*
6+
./README.md
7+
./LICENSE.md
8+
./functions/**/*

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_site/
2+
_temp/
3+
node_modules/
4+
.netlify/
5+
.idea/
6+
.wrangler/

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.16.0

_content/_headers.njk

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
layout: nada
3+
permalink: '/_headers'
4+
eleventyExcludeFromCollections: true
5+
---
6+
7+
{# Default #}
8+
/*
9+
X-Frame-Options: "SAMEORIGIN"
10+
X-Content-Type-Options: "nosniff"
11+
X-XSS-Protection: "1; mode=block"
12+
{%- if eleventy.env.runMode == 'build' -%}Access-Control-Allow-Origin = "{{ build.url or 'https://campaign-url-builder.com' }}"{%- endif -%}
13+
{# Content-Security-Policy = "frame-ancestors 'none';" #}
14+
15+
16+
{# API Endpoint #}
17+
/api/*
18+
Cache-Control: "max-age=0, no-cache, no-store, must-revalidate"
19+
20+
21+
{# TW Config #}
22+
/tw-config/*
23+
X-Robots-Tag: "noindex, nofollow"
24+
Cache-Control: "max-age=0, no-cache, no-store, must-revalidate"
25+
26+
27+
{# Helpers #}
28+
/_*
29+
X-Robots-Tag: "noindex, nofollow"
30+
Cache-Control: "max-age=0, no-cache, no-store, must-revalidate"
31+
32+
{# CloudFlare Custom Domain #}
33+
https://:project.pages.dev/*
34+
X-Robots-Tag: noindex
35+
36+
https://alex-zappa-dev.pages.dev*
37+
Link: <https://campaign-url-builder-com.pages.dev/:splat>; rel="canonical"
38+
X-Robots-Tag: noindex
39+
Refresh: 0; url=https://campaign-url-builder.com/:splat

_content/_redirects.njk

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: nada
3+
permalink: '/_redirects'
4+
eleventyExcludeFromCollections: true
5+
---
6+
7+
{# Misc #}
8+
/sitemap/ /sitemap.xml
9+
/sitemap_index.xml /sitemap.xml

_content/index.njk

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
layout: base.njk
3+
permalink: /
4+
title: "Campaign URL Builder"
5+
desc: "Use the Campaign URL Builder to easily add campaign parameters to URLs so you can track Custom Campaigns in Google Analytics."
6+
---
7+
8+
<main class="" x-data="CampaignURLBuilder">
9+
10+
<div class="prose md:prose-xl mx-auto">
11+
12+
<h1 class="flex text-center xs:text-right justify-center">
13+
<a href="https://freshjuice.dev" class="hover:no-underline group flex flex-col relative">
14+
<span class="block pb-3 font-black text-transparent bg-gradient-60 from-red-500 via-amber-500 dark:via-amber-400 to-orange-600 dark:to-orange-500 bg-clip-text">Campaign URL&nbsp;Builder</span>
15+
<span class="text-sm md:text-base italic -mt-4 group-hover:underline">
16+
by FreshJuice
17+
</span>
18+
</a>
19+
</h1>
20+
21+
<p>Use the Campaign URL Builder to easily add campaign parameters to URLs so you can track Custom Campaigns in Google Analytics.</p>
22+
23+
<form @submit.prevent>
24+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 gap-x-8">
25+
<div class="md:col-span-2">
26+
<label for="website-url" class="block">Website URL *</label>
27+
<input type="url" id="website-url" class="input" x-model="url" @input.debounce="generateURL()" placeholder="https://www.example.com">
28+
<div class="text-sm px-4">The full website URL (e.g. https://example.com).</div>
29+
</div>
30+
<div>
31+
<label for="campaign-id" class="block">Campaign ID</label>
32+
<input type="text" id="campaign-source" class="input" @input.debounce="generateURL()" x-model="id" placeholder="">
33+
<div class="text-sm px-4">The ads campaign id.</div>
34+
</div>
35+
<div>
36+
<label for="campaign-source" class="block">Campaign Source *</label>
37+
<input type="text" id="campaign-source" class="input" @input.debounce="generateURL()" x-model="source" placeholder="newsletter">
38+
<div class="text-sm px-4">The referrer (e.g. google, newsletter).</div>
39+
</div>
40+
<div>
41+
<label for="campaign-medium" class="block">Campaign Medium *</label>
42+
<input type="text" id="campaign-medium" class="input" @input.debounce="generateURL()" x-model="medium" placeholder="cpc">
43+
<div class="text-sm px-4">Marketing medium (e.g. cpc, banner, email)</div>
44+
</div>
45+
<div>
46+
<label for="campaign-name" class="block">Campaign Name *</label>
47+
<input type="text" id="campaign-name" class="input" @input.debounce="generateURL()" x-model="name" placeholder="spring_sale">
48+
<div class="text-sm px-4">Product, promo code, or slogan (e.g. spring_sale).</div>
49+
</div>
50+
<div>
51+
<label for="campaign-term" class="block">Campaign Term</label>
52+
<input type="text" id="campaign-term" class="input" @input.debounce="generateURL()" x-model="term" placeholder="">
53+
<div class="text-sm px-4">Identify the paid keywords.</div>
54+
</div>
55+
<div>
56+
<label for="campaign-content" class="block">Campaign Content</label>
57+
<input type="text" id="campaign-content" class="input" @input.debounce="generateURL()" x-model="content" placeholder="">
58+
<div class="text-sm px-4">Use to differentiate ads.</div>
59+
</div>
60+
</div>
61+
62+
<div class="hidden">
63+
<button type="button" class="btn" @click="generateURL()">Generate URL</button>
64+
</div>
65+
66+
<hr class="!my-8">
67+
68+
<div>
69+
<label for="generated-url" class="block">Generated URL</label>
70+
<div class="relative">
71+
<input type="text" id="generated-url" class="input pr-24" x-model="generatedURL" placeholder="" readonly>
72+
<div class="cursor-pointer font-mono text-sm absolute right-1 top-1 px-3 py-1.5 rounded-full transition-all bg-gray-100 hover:bg-gray-200 dark:hover:bg-cursor border-2 border-gray-300 dark:border-gray-400 inline-flex gap-2 items-center text-terminal"
73+
x-show="generatedURL"
74+
x-transition:enter="transition ease-out duration-700"
75+
x-transition:enter-start="opacity-0"
76+
x-transition:enter-end="opacity-100"
77+
x-transition:leave="transition ease-in duration-300"
78+
x-transition:leave-start="opacity-100"
79+
x-transition:leave-end="opacity-0"
80+
@click="copyToClipboard">
81+
{% phicon "copy", "duotone", { class: "size-5" } %}
82+
<span>Copy</span>
83+
</div>
84+
<div class="not-prose text-base absolute inset-x-0 -bottom-6 text-center"
85+
aria-hidden="true" style="display: none"
86+
x-transition:enter="transition ease-out duration-300"
87+
x-transition:enter-start="opacity-0 transform -translate-y-4"
88+
x-transition:enter-end="opacity-100 transform translate-y-0"
89+
x-transition:leave="transition ease-in duration-200"
90+
x-transition:leave-start="opacity-100 transform translate-y-0"
91+
x-transition:leave-end="opacity-0 transform -translate-y-4"
92+
x-show="copySuccess">Link copied to clipboard!</div>
93+
</div>
94+
</div>
95+
</form>
96+
97+
<hr>
98+
99+
<h2>More information and examples for each parameter</h2>
100+
<p>The following table provides more information about each parameter and examples of how they can be used.</p>
101+
102+
103+
<table-saw>
104+
<table>
105+
<thead>
106+
<tr>
107+
<th>Parameter</th>
108+
<th>Required</th>
109+
<th>Example</th>
110+
<th>Description</th>
111+
</tr>
112+
</thead>
113+
<tbody>
114+
<tr>
115+
<td>
116+
<p class="!mt-0 !mb-1 whitespace-nowrap">Campaign ID</p>
117+
<span class="whitespace-nowrap"><code>utm_id</code></span>
118+
</td>
119+
<td>No</td>
120+
<td><span class="whitespace-nowrap"><code>abc.123</code></span></td>
121+
<td>Used to identify which ads campaign this referral references. Use utm_id to identify a specific ads campaign.</td>
122+
</tr>
123+
<tr>
124+
<td>
125+
<p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Source</p>
126+
<span class="whitespace-nowrap"><code>utm_source</code></span>
127+
</td>
128+
<td>Yes</td>
129+
<td><span class="whitespace-nowrap"><code>newsletter</code></span></td>
130+
<td>Use utm_source to identify a search engine, newsletter name, or other source.</td>
131+
</tr>
132+
<tr>
133+
<td>
134+
<p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Medium</p>
135+
<span class="whitespace-nowrap"><code>utm_medium</code></span>
136+
</td>
137+
<td>Yes</td>
138+
<td><span class="whitespace-nowrap"><code>cpc</code></span></td>
139+
<td>Use utm_medium to identify a medium such as email or cost-per-click.</td>
140+
</tr>
141+
<tr>
142+
<td>
143+
<p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Name</p>
144+
<span class="whitespace-nowrap"><code>utm_campaign</code></span>
145+
</td>
146+
<td>No</td>
147+
<td><span class="whitespace-nowrap"><code>spring_sale</code></span></td>
148+
<td>Used for keyword analysis. Use utm_campaign to identify a specific product promotion or strategic campaign.</td>
149+
</tr>
150+
<tr>
151+
<td>
152+
<p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Term</p>
153+
<span class="whitespace-nowrap"><code>utm_term</code></span>
154+
</td>
155+
<td>No</td>
156+
<td><span class="whitespace-nowrap"><code>running+shoes</code></span></td>
157+
<td>Used for paid search. Use utm_term to note the keywords for this ad.</td>
158+
</tr>
159+
<tr>
160+
<td>
161+
<p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Content</p>
162+
<span class="whitespace-nowrap"><code>utm_content</code></span>
163+
</td>
164+
<td>No</td>
165+
<td><span class="whitespace-nowrap"><code>logolink</code></span></td>
166+
<td>Used for A/B testing and content-targeted ads. Use utm_content to differentiate ads or links that point to the same URL.</td>
167+
</tr>
168+
</tbody>
169+
</table>
170+
</table-saw>
171+
172+
</div>
173+
174+
</main>

_content/robots.txt.njk

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
layout: nada
3+
permalink: /robots.txt
4+
eleventyExcludeFromCollections: true
5+
---
6+
# Build: {{ build.hash.short }} at {{ build.timestamp.formatted }}
7+
User-agent: *
8+
Allow: /
9+
10+
Sitemap: {{ build.url }}/sitemap.xml

_content/sitemap.xml.njk

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
layout: nada
3+
permalink: /sitemap.xml
4+
eleventyExcludeFromCollections: true
5+
---
6+
<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="{{ build.url }}/sitemap.xsl"?>
7+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
8+
{%- for page in collections.all %}
9+
{%- if page.url and page.data.excludeFromSitemap != true -%}
10+
{%- set absoluteUrl %}{{ page.url | htmlBaseUrl(metadata.url) }}{% endset -%}
11+
<url>
12+
<loc>{{ absoluteUrl }}</loc>
13+
<lastmod>{{ page.date | htmlDateString }}</lastmod>
14+
</url>
15+
{%- endif -%}
16+
{%- endfor %}
17+
</urlset>

0 commit comments

Comments
 (0)