| 1 | # Set the host name for URL creation |
| 2 | SitemapGenerator::Sitemap.default_host = 'https://musik88.com' |
| 3 | SitemapGenerator::Sitemap.adapter = SitemapGenerator::S3Adapter.new( |
| 4 | fog_provider: 'AWS', |
| 5 | aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'], |
| 6 | aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], |
| 7 | fog_directory: ENV['S3_BUCKET'], |
| 8 | fog_region: ENV['AWS_REGION'] |
| 9 | ) |
| 10 | SitemapGenerator::Sitemap.public_path = 'tmp/' |
| 11 | SitemapGenerator::Sitemap.sitemaps_host = 'https://musik88.s3.amazonaws.com/' |
| 12 | SitemapGenerator::Sitemap.sitemaps_path = 'sitemaps/' |
| 13 | SitemapGenerator::Sitemap.ping_search_engines('https://musik88.com/sitemap') |
| 14 | |
| 15 | SitemapGenerator::Sitemap.create do |
| 16 | I18n.available_locales.each do |locale| |
| 17 | I18n.locale = locale |
| 18 | |
| 19 | # Index paths |
| 20 | [javanese_gending_path, javanese_gending_gamelan_notation_path, artist_path, album_path, song_path, |
| 21 | lyrics_path].each do |path| |
| 22 | add path, changefreq: 'daily' |
| 23 | end |
| 24 | |
| 25 | JavaneseGending.find_each do |gending| |
| 26 | add javanese_gending_detail_path(gending.slug), changefreq: 'daily', lastmod: gending.updated_at |
| 27 | end |
| 28 | |
| 29 | JavaneseGendingNotation.find_each do |notation| |
| 30 | add javanese_gending_gamelan_notation_detail_path(notation.slug), changefreq: 'daily', |
| 31 | lastmod: notation.updated_at |
| 32 | end |
| 33 | |
| 34 | Chord.find_each do |chord| |
| 35 | add guitar_chord_detail_path(chord.slug), changefreq: 'daily', lastmod: chord.updated_at |
| 36 | end |
| 37 | |
| 38 | Song.find_each do |song| |
| 39 | add song_detail_path(song.slug), changefreq: 'daily', lastmod: song.updated_at |
| 40 | end |
| 41 | |
| 42 | SongProvider.find_each do |song| |
| 43 | add song_bridge_path(song.slug), changefreq: 'daily', lastmod: song.updated_at |
| 44 | end |
| 45 | |
| 46 | ArtistProvider.find_each do |artist| |
| 47 | add artist_bridge_path(artist.slug), changefreq: 'daily', lastmod: artist.updated_at |
| 48 | end |
| 49 | |
| 50 | AlbumProvider.find_each do |album| |
| 51 | add album_bridge_path(album.slug), changefreq: 'daily', lastmod: album.updated_at |
| 52 | end |
| 53 | |
| 54 | # PAGES |
| 55 | [splitfire_path, bass64_path, contact_path, term_of_use_path, privacy_policy_path, login_path, |
| 56 | signup_path].each do |path| |
| 57 | add path, changefreq: 'monthly' |
| 58 | end |
| 59 | end |
| 60 | end |