Personalized urls for topic (yaml file)

Hi guys,

My yaml file is like this:

routes:

collections:
/services/:
permalink: /services/{slug}/
filter: tag:services
template:
- home
- index
/:
permalink: /{slug}/
template:
- home
- index

taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/


After the file upload i don’t know how to personalize the page domain/services and how to create new pages inside /services for example domain/services/marketing. Because when i go to stories creation settings “Post URL” nothing appear and i’m with tag “services” in filter. I don’t know what i’m doing wrong…

Could i please have your help?

Kind Regards

how to create new pages inside /services

Collections only own posts, not static pages.

If you create a post with a tag “services”, it will appear under /services/.

Side note: Please use inverse filters, see docs.

Hi Kate,

Yes that’s true thanks for your help :slight_smile:

Now i have tested and i have post not published on the timeline and taged by Servises, that appears like domain/services/marketing/.

Although i prefer static pages, do you know how can i configure yaml file for that effect?

Kind Regards

I guess you could define a custom route for that.

routes:
  /services/marketing/:
    data: page.marketing 

Let use know if it works.

Hello Kate,

This don’t work for me :worried:, but i don’t know why …

I hope you can provide some leads on this :smile:

Notes: Now i have a page named by “domain/marketing/” and i need to put this page inside services “domain/services/marketing/”

Now i have done the flowing experiments:

  1. Like you have said:
 routes:
    /services/marketing/:
    data: page.marketing
  1. With some changes
routes:
   /services/marketing/:
     data: page.marketing
     slug: marketing
     redirect: false
  1. Result in multiple errors on the website
    routes:
      /services/marketing/: marketing

Unfortunately i have same result (1 and 2) of "404 Page Not Found, but it acquired the new path “domain/services/marketing/”, it seams unable to find the page.

Do you have any clue? What’s happening down here?

Kind Regards

Can you please share the full routes.yaml? I am not sure i can follow the steps. Thanks :slight_smile:

Hi Kate,

I just have this on the file (complete):

 routes:
   /services/marketing/:
     data: page.marketing
     slug: marketing
     redirect: false
 collections:
   /services/:
     permalink: /services/{slug}/
     filter: tag:services
     template:
       - home
       - index
   /:
     permalink: /{slug}/
     template:
       - home
       - index
 
 taxonomies:
   tag: /tag/{slug}/
   author: /author/{slug}/

Thanks

routes.yaml

 routes:
   /services/marketing/:
     data: page.marketing
     template: marketing

 collections:
   /services/:
     permalink: /services/{slug}/
     filter: tag:services
     template:
       - home
       - index
   /:
     permalink: /{slug}/
     filter: tag:-services
     template:
       - home
       - index

 taxonomies:
   tag: /tag/{slug}/
   author: /author/{slug}/

marketing.hbs

{{#page}}
  {{content}}
{{/page}}
1 Like

Hi kate,

Now it seams working but unfortunately my page from “domain/services”, it’s a blanc page only with website structure how can i edit this for a normal static page with general services description? Do i need to add in routes also with new template?

With this structure:

routes:
   /services/marketing/:
     data: page.marketing
     template: marketing

It’s working but it seams having a redirection, what’s the effect on the search engines? What link they index? domain/marketing or domain/services/marketing, because i desire index the second one.

Can i have this with no redirection at all, directly to destiny “domain/services/marketing” ?

Why this happening?

Kind Regards

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.