Should be giving this a go today (even though I’m still waiting on the registrar re: if they are going to let me have a “reserved” domain). Hope for smooth sailing.
Wishing smooth sailing for you too! Let us know if you hit any snags in the process.
Before I do this, is there a command somewhere, presumably via CLI, to delete all posts, in case something goes weird or I want to roll back and do it over for some reason?
Well, crap. It apparently does not use my existing slugs. meaning anywhere I link to one of my own posts, the link is broken because Write.as generated a default slug instead.
So, yeah, someone give me a command-line command to delete all posts. I have to start again and figure out what to do about that.
Well, crap part 2. My existing pinned posts don’t pin, and I can’t pin them by going directly to them? So I have to just scroll through my entire post history to find it on an index page and do it from there?
ETA: I guess I can edit screen them to “now”, they’ll be up top on the main page, and then pin from there. I’m starting to sour a bit on this “pin a post to make a page linked in the nav bar” thing.
ETA: The above thing does work, in the meantime, but I’d suggest some other method for the future, as Write.as gradually finds more general-use users, because that’s not really a good process.
OOC, anyone know if there’s a way using the API (not my wheelhouse, but asking if it’s possible) to replace all my post slugs with ones that (1) first strip out the post’s html/markdown and then generate the slug and (2) never stop at a period, and just cut off at whatever the default W.a word-count is for slug generation?
So going from:
/thomas-oleary-says-write-as-tmo-alright-i-was-on-a-wordpress-blog-w-350k to something like
Yes, you can use the API to update slugs. That works fine. It is just the process outlined in 1 & 2 that will take some time to get right, especially if that parsing function will run through all the posts in the blog.
I don’t know if that’s exactly what the new URL would be or not, since I don’t know what the word count W.a uses is, exactly, but yes that’s the basic idea. In those specific examples, the html/markdown is stripped, but then however many words that was would then be counted out after the “350k”.
I have no idea if I am explaining this right. What I wish W.a did natively was (1) strip all html, markdown, and punctuation the post, then generate the slug using X words from the post (for whatever value of X W.a is using for slug length). What I’m wondering is whether that process I wish W.a used is possible to jerry-rig something via API.
That wouldn’t solve my OCD problem going forward, but I can do “strip all html, markdown, and punctuation the post” and paste into the slug box manually going forward.
No worries @bix, you are explaining it right.
This jerry-rigging can be done. It would take grabbing the body of a post, parsing through the body with the parameters laid out above, and then slugifying what’s left over - all of which is possible through some calls to the API.
Though you do remind me of the request for changing slugs before you publish. That would definitely help in the future. And perhaps @matt could fill us in further on the word/character limit for slugs. Once those parameters are known, a script of sorts could be made.
Hope that all makes sense!