cs.app.pilfer.sitemap: SiteMap.url_key: add URL.cleanpath and URL.cleanrpath to the mapping, and _=cleanrpath and __=hostname/cleanrpath
1 files changed, 7 insertions(+), 0 deletions(-)

M lib/python/cs/app/pilfer/sitemap.py
M lib/python/cs/app/pilfer/sitemap.py +7 -0
@@ 89,6 89,8 @@ class SiteMap:
             (
                 (attr, getattr(url, attr)) for attr in (
                     'basename',
+                    'cleanpath',
+                    'cleanrpath',
                     'dirname',
                     'domain',
                     'hostname',

          
@@ 99,6 101,11 @@ class SiteMap:
                 )
             )
         )
+        # set _ to the url.path, __ to histname/path
+        mapping.update(
+            _=url.cleanrpath,
+            __=f'{url.hostname}/{url.cleanrpath}',
+        )
         mapping.update(url.query_dict())
         mapping.update(match)
         yield match_to, arg, match, mapping