Skip to content

Commit 87a36fc

Browse files
committed
Ready-ing for GHA deployment
1 parent ab0ea11 commit 87a36fc

8 files changed

Lines changed: 105 additions & 55 deletions

File tree

.github/workflows/pages.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: "3.2"
26+
bundler-cache: true
27+
28+
- name: Setup Pages
29+
id: pages
30+
uses: actions/configure-pages@v5
31+
32+
- name: Build with Jekyll
33+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
34+
env:
35+
JEKYLL_ENV: production
36+
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
40+
deploy:
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
runs-on: ubuntu-latest
45+
needs: build
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ group :jekyll_plugins do
77
gem "jekyll-sitemap"
88
gem "jekyll-feed"
99
gem "jekyll-coffeescript"
10+
gem "jekyll-redirect-from"
1011
end

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ GEM
7474
coffee-script-source (~> 1.12)
7575
jekyll-feed (0.17.0)
7676
jekyll (>= 3.7, < 5.0)
77+
jekyll-redirect-from (0.16.0)
78+
jekyll (>= 3.3, < 5.0)
7779
jekyll-sass-converter (3.1.0)
7880
sass-embedded (~> 1.75)
7981
jekyll-sitemap (1.4.0)
@@ -171,6 +173,7 @@ DEPENDENCIES
171173
jekyll
172174
jekyll-coffeescript
173175
jekyll-feed
176+
jekyll-redirect-from
174177
jekyll-sitemap
175178

176179
RUBY VERSION

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ plugins:
3737
- jekyll-sitemap
3838
- jekyll-feed
3939
- jekyll-coffeescript
40+
- jekyll-redirect-from

_includes/head.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
<script src="js/respond.min.js"></script>
4848
<![endif]-->
4949

50-
<!-- Google Recaptcha -->
51-
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
52-
5350
<!-- Stoked -->
5451
<script
5552
src="https://rakefire.stokedhq.com/get-stoked.js"

_includes/sections/contact.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ <h3>Contact Info</h3>
2323
</div>
2424
<div class="col-md-6 to-animate">
2525
<h3>Contact Form</h3>
26-
<form action="/#submit-success" method="post">
26+
<form action="https://api.web3forms.com/submit" method="post">
27+
<input type="hidden" name="access_key" value="fece4eca-24ff-4c9b-a4b8-25be504f053b">
28+
<input type="hidden" name="subject" value="Rakefire Enquiry">
29+
<input type="hidden" name="redirect" value="https://rakefire.io/#submit-success">
30+
<input type="checkbox" name="botcheck" style="display: none;">
2731
<div class="form-group">
2832
<label class="sr-only" for="name">Name</label>
2933
<input class="form-control" id="name" placeholder="Name" name="name" type="text">
3034
</div>
3135
<div class="form-group">
3236
<label class="sr-only" for="email">Email</label>
33-
<input class="form-control" id="email" placeholder="Email" name="_replyto" type="email">
37+
<input class="form-control" id="email" placeholder="Email" name="email" type="email">
3438
</div>
3539
<div class="form-group">
3640
<label class="sr-only" for="phone">Phone</label>
@@ -41,11 +45,6 @@ <h3>Contact Form</h3>
4145
<textarea class="form-control" cols="30" id="message" name="message" placeholder="Message"
4246
rows="5"></textarea>
4347
</div>
44-
<input type="hidden" name="_subject" value="Rakefire Enquiry">
45-
<input type="hidden" name="_to" value="ricky@rakefire.io">
46-
<input type="hidden" name="_cc" value="jim@rakefire.io">
47-
<!-- <input type="hidden" name="_cc" value="phil@rakefire.io"> -->
48-
<div class="g-recaptcha" data-sitekey="6LfKBEYUAAAAAE5kwioYDyIqqzpTO4akzcetKxcy"></div>
4948
<div class="form-group">
5049
<input class="btn btn-primary btn-lg" type="submit" value="Send Message">
5150
</div>

_plugins/cloudannon_redirects.rb

Lines changed: 0 additions & 45 deletions
This file was deleted.

_plugins/redirects.rb

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Generates redirect pages from _data/redirects.csv
2+
# Each row creates a page with redirect_to frontmatter,
3+
# which jekyll-redirect-from uses to generate HTML redirect pages.
4+
5+
module RedirectPages
6+
class RedirectPage < Jekyll::Page
7+
def initialize(site, from, to)
8+
@site = site
9+
@base = site.source
10+
11+
from = "/#{from}" unless from.start_with?("/")
12+
13+
@dir = from
14+
@name = "index.html"
15+
16+
self.process(@name)
17+
self.data = {
18+
"redirect_to" => to,
19+
"sitemap" => false,
20+
"layout" => nil
21+
}
22+
self.content = ""
23+
end
24+
end
25+
26+
class Generator < Jekyll::Generator
27+
safe true
28+
priority :low
29+
30+
def generate(site)
31+
redirects = site.data["redirects"]
32+
return unless redirects
33+
34+
redirects.each do |redirect|
35+
from = redirect["from"]
36+
to = redirect["to"]
37+
38+
next if from.nil? || from.empty? || to.nil? || to.empty?
39+
40+
site.pages << RedirectPage.new(site, from, to)
41+
Jekyll.logger.info "Redirect:", "#{from} -> #{to}"
42+
end
43+
end
44+
end
45+
end

0 commit comments

Comments
 (0)