Skip to content

Commit 7f6b757

Browse files
committed
add a sitemap for main app + keep the same storage folder over the deployments
1 parent a36675d commit 7f6b757

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

app/controllers/sitemap_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class SitemapController < ApplicationController
2+
end

app/views/sitemap/index.xml.erb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url>
4+
<loc>https://demo-pro.maglev.dev/</loc>
5+
<priority>1</priority>
6+
</url>
7+
<url>
8+
<loc>https://demo-pro.maglev.dev/session/new</loc>
9+
<priority>0.9</priority>
10+
</url>
11+
<url>
12+
<loc>https://demo-pro.maglev.dev/users/new</loc>
13+
<priority>0.9</priority>
14+
</url>
15+
</urlset>

config/deploy.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ registry:
1515
password:
1616
- DOCKER_REGISTRY_TOKEN
1717

18+
volumes:
19+
- "/var/local/data/storage:/rails/storage"
20+
1821
# Inject ENV variables into containers (secrets come from .env).
1922
# Remember to run `kamal env push` after making changes!
2023
env:
@@ -27,6 +30,7 @@ env:
2730
RAILS_LOG_TO_STDOUT: true
2831
secret:
2932
- RAILS_MASTER_KEY
33+
- POSTGRES_USER
3034
- POSTGRES_PASSWORD
3135
- BUNDLE_GITHUB__COM
3236
- BUNDLE_PACKAGES__NOCOFFEE__FR
@@ -41,9 +45,9 @@ accessories:
4145
port: 5432
4246
env:
4347
clear:
44-
POSTGRES_USER: 'jack'
4548
POSTGRES_DB: 'site_builder_demo_production'
4649
secret:
50+
- POSTGRES_USER
4751
- POSTGRES_PASSWORD
4852
files:
4953
- db/init.sql:/docker-entrypoint-initdb.d/setup.sql

config/routes.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# Root of the main domain -> sign up page
1818
get '/' => 'users#new', constraints: { host: Rails.application.config.x.main_host }
1919

20+
# Sitemap of the demo app
21+
get '/sitemap.xml', to: 'sitemap#index', constraints: { host: Rails.application.config.x.main_host }
22+
2023
# [Maglev] For more information, go to https://doc.maglev.dev
2124
# [Maglev] Editor UI + preview endpoint
2225
mount Maglev::Pro::Engine => '/maglev', as: :maglev

0 commit comments

Comments
 (0)