For the 2nd time I'm building a site where not all the content is going to be manually imported into Drupal (in these cases, it can't really be automated). So, at least for a while, there's going to be a directory tree in the webroot serving the old static content. I wanted these files in the XML sitemap, and instead of doing it one-off again, I decided to write a simple reusable API for this and wrap it in a drush command.
Are you willing to include this as part of xmlsitemap_custom or should I put this in a separate project? Seems generally useful for folks who need xmlsitemap_custom. This could be expanded to include an admin UI, for now a drush command is all I need.
Thoughts?
Thanks!
-Derek
Comment | File | Size | Author |
---|---|---|---|
#8 | xmlsitemap_custom_scan_directories-2026551-8.patch | 1.43 KB | pifagor |
|
Comments
Comment #1
dwwComment #2
dwwShould be obvious from the patch, but if not -- this makes use of the 'subtype' field in {xmlsitemap} to keep track of all the links in a given directory tree. E.g. in my case, I'm invoking this like so:
drush xmlsitemap-custom-scan issues '/\.shtml/'
And ending up with this sort of thing in {xmlsitemap}:
Once the editors import issue #59, we'll remove those files from the filesystem, run the scan again, and those links will disappear from the sitemap (and there will be redirects from the legacy path pointing to the happy new Drupal nodes).
Make sense?
Cheers,
-Derek
Comment #3
Chris Matthews CreditAttribution: Chris Matthews commentedThe 6 year old patch to xmlsitemap_custom.drush.inc and xmlsitemap_custom.scan.inc applied cleanly to the latest xmlsitemap 7.x-2.x-dev and if still applicable needs review.
Comment #4
pifagorComment #6
pifagorComment #7
Dave ReidThe xml_custom_scan_directories() function is not properly namespaced. It should be xmlsitemap_custom_scan_directories()?
Comment #8
pifagorDear Dave.
I absolutely agree with you. This is a logical remark. I added a patch where I changed the function name.
Thank you for your comments
Comment #9
ciss CreditAttribution: ciss at yousign GmbH commented@pifagor Your namespace corrections to xml_custom_scan_directories() in #8 still need to be committed.
Comment #10
ciss CreditAttribution: ciss at yousign GmbH commentedComment #11
alex_optimLooks good.
Comment #13
pifagorComment #14
pifagorComment #15
pifagor