Skip to content
This repository was archived by the owner on Jan 22, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bridgetown.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
# https://learnxinyminutes.com/docs/yaml/
#

url: "" # the base hostname & protocol for your site, e.g. https://example.com
url: "https://test.com" # the base hostname & protocol for your site, e.g. https://example.com

permalink: pretty
template_engine: erb

# Other options you might want to investigate:
#
#
# base_path: "/" # the subpath of your site, e.g. /blog
# timezone: America/Los_Angeles
# pagination:
# enabled: true
# enabled: true
12 changes: 12 additions & 0 deletions plugins/builders/vercel_url.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

class Builders::VercelUrl < SiteBuilder
def build
hook :site, :pre_render do |site|
next unless ENV["VERCEL_URL"] && ENV["VERCEL_ENV"] != "production"

Bridgetown.logger.info("Subbing Vercel URL")
site.config.update(url: "https://#{ENV["VERCEL_URL"]}")
end
end
end
1 change: 1 addition & 0 deletions src/_layouts/default.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<%= render Shared::Navbar.new(metadata: site.metadata, resource: resource) %>

<main>
<span>Absolute URL: <%= resource.absolute_url %></span>
<%= yield %>
</main>

Expand Down