dragonwocky / psyche Goto Github PK
View Code? Open in Web Editor NEWa drop-in solution for searching documentation
Home Page: https://deno.land/x/psyche
License: MIT License
a drop-in solution for searching documentation
Home Page: https://deno.land/x/psyche
License: MIT License
Astro is another static site generator.
Hi.
Is it possible to order the results by relevance? For instance, right now when I search markdown
I have the following result:
The first results are pages from "Getting started" or other pages with the word "markdown" in the content. And the page of the markdown
plugin is way down in the results list. I think a page having this word in the title should be more relevant than a page with this word in the content. So I'd like to propose a way rank the results by relevance. For example:
1
.0.5
.0.2
.This allows to order the page by rank and opens the door to implement in the future more advanced ranking features, like define different weights for different properties, or if the word is repeat, or is at the begining of the content, etc.
Hi.
As I can see, this component use a style tag in the shadow root to apply styles and use themes to apply colors and fonts.
I recommend to use CSS ::part()
pseudo selector for more flexibility and maintainability.
You can see an example of this in the oom-components/searcher web component:
part
attribute: https://github.com/oom-components/searcher/blob/main/searcher.js#L37:hover
, :focus
, :disabled
etc: https://github.com/oom-components/searcher/blob/main/demo/styles.css#L9-L16This would make more easy to apply styles on different media queries, light/dark themes, etc. For example:
psyche-search::part(input) {
border-color: var(--primary-color);
}
And it allows to combine a base theme in the shadow DOM that can be overrided by outside css.
Hi, see that you use this code to get the urls of the pages:
Lines 65 to 67 in 53f44fd
In Lume, all pages have a url
value with the public url, so you could do simply:
const url = page.data.url;
But it could happen that the site is published in a subdirectory (like https://example.com/blog/
) so all urls should prepend the /blog
subdirectory. A more strong way to get the url is:
const url = site.url(page.data.url);
site.url()
returns the final url of any path, prepending subdirectories if needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.