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

Added the Capability to Search the *Contents* of Blog Posts #865

Merged
merged 5 commits into from
Jan 27, 2025

Conversation

splifingate
Copy link
Contributor

By Default, HTMLy searches the content of the filename, only.

Extremely fantastic, and quite functional.

But, there are times when an individual wants to drill-down into their Content, and pull-up something contextual; something pertinent to the discussion, at-hand.

I have been working on this for a while, now. I've learned more about PHP by working with HTMLy than all my two-decades of study.

I write on Nature,
And create many haikus.
Some are elegant.

How does a person search for 'elegant', when--by-default--HTMLy only queries the title (which is "I write on Nature", in this instance)?

One can't in a default installation of HTMLy.

Unless . . . the query dives-deeper!

I have a Post on the matter which highlights the process:

Searching inside HTMLy content

So, it's so . . . Content Search is now a real possibility.

Here is my production HTMLy instance (heavily-modified Doks Theme):

blog

Here is my HTMLy Testing instance:

testing-blog

Give a Search in each, and you'll notice the disparity.

I have 2-5 posts that claim hits outside of the stock Search functionality.

[I also added extras to main.html.php to highlight the search term, and hit-count]

It is my hope that this gets Review and Inclusion ;)

normalization of Source line endings
comment-out for testing
By Default, Search in HTMLy only queries the filename.

I have added code that enables the Search function to capture whole-word results from the *contents* of each blog post.

See:

https://splifingate.net/blog/

vs

https://splifingate/test/blog/

My Study:

https://andyrew.info/blog/2025/01/searching-inside-htmly-content
extra / *oops*
@danpros danpros merged commit 416ce7e into danpros:master Jan 27, 2025
@danpros
Copy link
Owner

danpros commented Jan 27, 2025

Thanks for the PR.

Currently, the built-in search is still very simple. In the future, we must find a way to develop it, if necessary, adding third-party code using composer.

@splifingate
Copy link
Contributor Author

"the built-in search is still very simple"

Which is good, no? The Algolia Search in doks seems, er, overly complicated...

Thank you for your thoughts, and your good works.

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

Successfully merging this pull request may close these issues.

2 participants