swup / route-name-plugin

A swup plugin for named routes and route-based animation 🧭
https://swup.js.org/plugins/route-name-plugin
MIT License
2 stars 0 forks source link

Help with route plugin #1

Closed handiworknyc closed 2 years ago

handiworknyc commented 2 years ago

Hi @gmrchk hoping you can help me.

I'm using wordpress.

My URL structure is : http://localhost:8888/cdw/work/telesign/ http://localhost:8888/cdw/work/foo/ http://localhost:8888/cdw/work/bar/ http://localhost:8888/cdw/work/etc/

I just want to assign the route name "work" to any URL containing work. image

None of these are working though:

            routes: [
                { name: 'work', path: '/work/:slug' },
            ]

not working:

            routes: [
                { name: 'work', path: '/work/(.*)' },
            ]

Please help! thanks

daun commented 2 years ago

Your routes all start with cdw, the path definitions should start with /cdw/work.

handiworknyc commented 2 years ago

Thank you!!!! That was too obvious

daun commented 2 years ago

Great!