First of all, as usual, my apologies if this has been covered before.
I did find some posts in here on search boxes, but nothing I could really use with my basic skills.
Is there a guide on how to implement a search feature in blogs in write.as, that does not use google services?
Something like this: https://search.cjeller.site/
Or, if no notes exist, is there a good, patient soul willing to help me implement this?
I was able to remix the search app I use for my blog into something like this that uses your theme and searches your blog. What do you think? All you would need to do is pin a placeholder post (like https://blog.melyanna.net/search for example) and add the following JavaScript to the Custom JavaScript on your Customize page:
cjeller1592, hi. I tried to do the same on my blog, inserting my blog title into the code. I added it to the Java script section under customization. Pinned a “search” post. But no luck.
In order to have a search app for your blog, the search app will have to be remixed on Glitch with your blog’s credentials. I am assuming you are using it on your Write Dirt blog, so I remixed the app for you here.
Note that it will not find pinned posts, so the only post you can search for currently is the Main Blog Page post. You can clean up your pinned posts and add other posts to further test the search app.
For the JavaScript, you will just change the href of the second line of code. It will look like this:
Once you clean up your pinned posts, I can help make the app reflect those changes (since the pinned posts are copied & posted into the app). Hope that helps and let me know if you need anything further along the way!
Hi @anihil! I was able to remix the search app for your blog here. As mentioned above, create a placeholder search post, pin it to the top, and then add the Custom JavaScript below which replaces the href of the placeholder search post with the search app url:
It should work then. Let me know if that works! I am hoping to write up a definitive guide for remixing/configuring the search app so that if you want to modify it in the future, you can do so from your own Glitch account (note: it is written in Python using Flask and a custom Write.as API library).
Hope this helps and let me know if you have any other questions!
I created a Search page and pinned it to my blog and then pasted that url (which is the same as what you posted) and then updated the Customize Javascript box. Nothing happened.
Did you try accessing the search page from your custom domain? If you try to access the search post from https://write.as/anihil then the JavaScript will not run. It will only run on your custom domain (https://anihil.com). That was a problem I ran into before when trying to do the same thing.