LogoLogo
  • Hatchbox Classic Support
  • Clusters
  • Providers
  • Servers
  • Apps
    • ActionCable
    • Background Workers
    • Backups
    • BitBucket
    • Cron Jobs
    • Deploy Scripts
    • Domains & DNS
    • ElasticSearch
    • File Uploads
    • Image Processing
    • Jekyll
    • Passenger
    • Postgres
    • Puma
    • Rails
    • Rake
    • React On Rails
    • Ruby Versions
    • Sitemaps
    • Sphinx
    • SSL
    • Webhooks & Auto-Deploy
    • Webpacker
  • Security
  • Support
  • Databases
    • Backup & Restore
Powered by GitBook
On this page
  1. Apps

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

PreviousRuby VersionsNextSphinx

Last updated 6 years ago