Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a widget that will automatically generate URL when new post is created #7185

Open
mohammedasker opened this issue Apr 20, 2024 · 0 comments

Comments

@mohammedasker
Copy link

Hello. I have a job board website that is built with Eleventy (11ty) and Decap CMS. I want to add a widget that will automatically generate the URL of posts I created from Decap CMS. The reason why I want it is so that every time I create new job posts, it will automatically add a URL in the markdown front matter. I need these URLs so that they will show up in Google Rich Results and improve the SEO of my website.

collections:
  - name: "blog"
    label: "Blog"
    folder: "src/blogs"
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields:
    - { label: "Title", name: "title", widget: "string" }
    - { label: "Post URL", name: "posturl", widget: "slug" } <--- something like that
    
---
title: Sample post
posturl: https://www.example.com/blogs/2024-04-16-sample-post/ <--- creates url in markdown frontmatter
---

I don't see any examples in the documentation, so I was wondering if it is possible to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant