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

Bard: automatically replace absolute urls with entry IDs #1298

Open
stuartcusackie opened this issue Jan 24, 2025 · 0 comments
Open

Bard: automatically replace absolute urls with entry IDs #1298

stuartcusackie opened this issue Jan 24, 2025 · 0 comments

Comments

@stuartcusackie
Copy link

I'm migrating a large WP site over to Statamic and the most time consuming thing is replacing internal absolute urls on bard links with Entry IDs.

I've been trying to figure out an artisan command to do it but the best I can think of is using a file reader on each markdown file, running through it line by line and attempting to replace each url line when a matching entry is found, then rewriting the entire markdown file. I'm not going to do this as I'm afraid it will break the markdown or lose content.

I think the easiest thing would be if when saving a bard field it checks all links for matching entries and performs an automatic replacement.

And if you're wondering, why don't I just keep the absolute urls? It's because we're moving from urls with trailing slashes (WP) to ones with no trailing slash.

Thanks!

@stuartcusackie stuartcusackie changed the title Bard automatically replace absolute urls with entry IDs Bard: automatically replace absolute urls with entry IDs Jan 24, 2025
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