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:
ln -s $DIR/shared/public/shared $RELEASE_DIR/public/shared
You'll need to manually create this directory on your server with the following command:
mkdir -p ~/appname/shared/public/shared
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.
# Shared directory so all deployments will have the sitemap
SitemapGenerator::Sitemap.sitemaps_path = 'shared/'
SitemapGenerator::Sitemap.create do
group(sitemaps_path: 'shared/sitemaps', filename: 'general-pages') do
end
end
Last updated