Skip to content

Commit c51f070

Browse files
authored
support landing site url: (#35)
- index: add conditional landing site redirect if URL is provided - if LANDING_SITE_URL env var set, add redirect in index.html to go to landing site if no hashtag provided - gh action: set https://webrecorder.net/#create as landing site for https://create.webrecorder.net/ deployment
1 parent 015c11f commit c51f070

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/workflows/site-publish.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ jobs:
3939
cache: "yarn"
4040

4141
- run: yarn install
42-
- run: yarn run build
42+
- env:
43+
LANDING_SITE_URL: "https://webrecorder.net/#create"
44+
run: yarn run build
4345

4446
- name: Setup Pages
4547
uses: actions/configure-pages@v5

src/index.ejs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
<%- title %>
1313
</title>
1414
<link rel="sitemap" href="<%= homeUrl %>/sitemap-index.xml" />
15-
15+
<% if (landingSiteUrl) { %>
16+
<script>
17+
if (!window.location.hash) {
18+
window.location.href = "<%- landingSiteUrl %>";
19+
}
20+
</script>
21+
<% } %>
1622
<meta property="og:image" content="<%= homeUrl %>/_astro/og.BLv3EsOH.avif" />
1723
<meta property="og:image:alt" content="Webrecorder">
1824
<meta property="og:title" content="<%= title %>" />

webpack.config.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ module.exports = (env, argv) => {
140140
"Create Archive Now, a demo of Webrecorder’s web archiving tools",
141141
baseUrl: "https://create.webrecorder.net",
142142
homeUrl: "https://create.webrecorder.net",
143+
// optional landing site url if no hashtag provided
144+
landingSiteUrl: process.env.LANDING_SITE_URL,
143145
},
144146
inject: "head",
145147
scriptLoading: "blocking",

0 commit comments

Comments
 (0)