Appearance
Sitemaps
Sitemap files
Currently:
txt
sitemap-index.xml
sitemap-google-news.xml
sitemap-images-{yyyymm}.xml << compressed .gz
sitemap-noticias-{yyyymm}.xml << compressed .gz
sitemap-category.xml
sitemap-tag.xml
Manual sitemap generation
For some ENV
and some FILE
(images
, noticias
, ...) and some month yyyy-mm
or yyyy-yyyy
, you can force the file generation running:
shell
$ ./app/admin/console --env={ENV} app:cms:sitemap:dump --section={FILE}-{yyyymm}-all sitemap
----
$ ./app/public/console wf:cms:generate:sitemap general-news --filterDate={(YYYY-YYYY|YYYY-mm)} --gzip >>> sitemap-noticias-{yyyyMM}.xml[.gz]
$ ./app/public/console wf:cms:generate:sitemap general-images --filterDate={YYYY-YYYY|YYYY-mm} --gzip >>> sitemap-images-{yyyyMM}.xml[.gz]
$ ./app/public/console wf:cms:generate:sitemap general-videos --filterDate={YYYY-YYYY|YYYY-mm} --gzip >>> sitemap-videos-{yyyyMM}.xml[.gz]
$ ./app/public/console wf:cms:generate:sitemap section-news --filterDate={YYYY-YYYY|YYYY-mm} --gzip --filterSection={category-slug} >>> sitemap-noticias-{category-slug}-{yyyyMM}.xml[.gz]
$ ./app/public/console wf:cms:generate:sitemap section-images --filterDate={YYYY-YYYY|YYYY-mm} --gzip --filterSection={category-slug} >>> sitemap-images-{category-slug}-{yyyyMM}.xml[.gz]
$ ./app/public/console wf:cms:generate:sitemap section-videos --filterDate={YYYY-YYYY|YYYY-mm} --gzip --filterSection={category-slug} >>> sitemap-videos-{category-slug}-{yyyyMM}.xml[.gz]
$ ./app/public/console wf:cms:generate:sitemap category >>>> sitemap-category.xml
$ ./app/public/console wf:cms:generate:sitemap tags >>>> sitemap-tag.xml
Last (Google) news generation
The final file:
sitemap-google-news.xml
shell
$ ./app/public/console --env={ENV} wf:cms:generate:sitemap google-news
Automatic sitemap generation
Based on REDIS annotated entities changes, you can update automatically the affected sitemap files running:
shell
$ ./app/public/console --env={ENV} wf:cms:update:sitemap
Index generation
Using all the sitemap previous generated files, you can generate the main index file running:
shell
$ ./app/public/console --env={ENV} wf:cms:generate:sitemap index
Cron jobs
Usually, the following cron jobs should be configured:
shell
4 17 * * * www-data cd /var/www/sites/enabled/{APP_NAME}/vendor/xalok-go/cobase && php app/public/console wf:cms:generate:sitemap index --env=prod
*/5 * * * * www-data cd /var/www/sites/enabled/{APP_NAME}/vendor/xalok-go/cobase && php app/admin/console wf:cms:update:sitemap --env=prod
* * * * * www-data cd /var/www/sites/enabled/{APP_NAME}/vendor/xalok-go/cobase && php app/admin/console wf:cms:generate:sitemap google-news --env=prod &>> /var/log/xalok/{APP_NAME}_sitemap_google_news.log
Where APP_NAME
is the app_name
for the given project.
First time or regenerate sitemaps from scratch
shell
for Y in `seq 2017 2023`; do
for M in 01 02 03 04 05 06 07 08 09 10 11 12; do
./app/public/console wf:cms:generate:sitemap --env=prod general-news --filterDate="$Y-$M" --gzip
./app/public/console wf:cms:generate:sitemap --env=prod general-images --filterDate="$Y-$M" --gzip
./app/public/console wf:cms:generate:sitemap --env=prod general-videos --filterDate="$Y-$M" --gzip
./app/public/console wf:cms:generate:sitemap --env=prod section-news --filterDate="$Y-$M" --gzip
./app/public/console wf:cms:generate:sitemap --env=prod section-images --filterDate="$Y-$M" --gzip
./app/public/console wf:cms:generate:sitemap --env=prod section-videos --filterDate="$Y-$M" --gzip
done
done
./app/public/console --env=prod wf:cms:generate:sitemap category
./app/public/console --env=prod wf:cms:generate:sitemap tags
./app/public/console --env=prod wf:cms:update:sitemap
./app/public/console --env=prod wf:cms:generate:sitemap google-news
./app/public/console --env=prod wf:cms:generate:sitemap index