Replies: 2 comments 1 reply
1 reply
|
Hi Mohammad, is there any particular reason why the content of your answer was removed? I still have it in an email from GitHub, just wanted to make sure that I can "safely" use your Python script for cleaning the links stored in the Publii sqlite DB. Best wishes, |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi all, I have just recently switched to Publii, coming from WP. My WordPress had day and name permalinks like https://www.example.com/2026/08/10/postname/. My Publii blog only has www.example.com/postname/, which leads to a lot of broken internal links in my older posts.
How can I best batch modify all files so that the yyyy/mm/dd/ part is being removed from all my internal links? (Ideally so that this works for both absolute and relative links, but that is not prio 1)
ChatGPT proposed:
find . -type f -name '*.html' -exec perl -pi.bak -e 's#https?://www\.domain\.de/[0-9]{4}/[0-9]{2}/([^/"<> ]+)/?#www.domain.de/$1#g' {} +Does this make sense? Is that even possible? Which Publii dir would I have to run that command on?
Any tips are welcome.
All reactions