feat: Wikidata engine and Wikipedia knowledge infobox
- Add wikidata engine (wbsearchentities), tests, factory/planner/config - Wikipedia REST summary: infobox from extract, thumbnail, article URL - InfoboxView URL; render infobox list in results_inner + base styles - Preferences Wikidata toggle; engine badge color for wikidata Made-with: Cursor
This commit is contained in:
parent
6e45abb150
commit
24577b27be
13 changed files with 344 additions and 34 deletions
|
|
@ -96,6 +96,7 @@ type InfoboxView struct {
|
|||
Title string
|
||||
Content string
|
||||
ImgSrc string
|
||||
URL string
|
||||
}
|
||||
|
||||
// FilterOption represents a filter radio option for the sidebar.
|
||||
|
|
@ -273,7 +274,10 @@ func FromResponse(resp contracts.SearchResponse, query string, pageno int, activ
|
|||
if v, ok := ib["img_src"].(string); ok {
|
||||
iv.ImgSrc = util.SanitizeResultURL(v)
|
||||
}
|
||||
if iv.Title != "" || iv.Content != "" {
|
||||
if v, ok := ib["url"].(string); ok {
|
||||
iv.URL = util.SanitizeResultURL(v)
|
||||
}
|
||||
if iv.Title != "" || iv.Content != "" || iv.ImgSrc != "" {
|
||||
pd.Infoboxes = append(pd.Infoboxes, iv)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue