Sitemaps

How can I symlink the sitemaps directory every deploy?

For sitemaps, we recommend you create a directory called shared and symlink it every deploy so that you can keep a copy of your sitemaps across every deploy.
Add the following to the top of your app's Deploy Script:
1
ln -s $DIR/shared/public/shared $RELEASE_DIR/public/shared
Copied!
You'll need to manually create this directory on your server with the following command:
1
mkdir -p ~/appname/shared/public/shared
Copied!
If you're using SitemapGenerator, you can use the following options to make sure they matched the folder we just created in our deploy script.
1
# Shared directory so all deployments will have the sitemap
2
SitemapGenerator::Sitemap.sitemaps_path = 'shared/'
3
4
SitemapGenerator::Sitemap.create do
5
group(sitemaps_path: 'shared/sitemaps', filename: 'general-pages') do
6
end
7
end
Copied!
Last modified 3yr ago
Copy link