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
|
|
@ -3,7 +3,26 @@
|
|||
<div id="corrections" class="correction">{{range .Corrections}}{{.}} {{end}}</div>
|
||||
{{end}}
|
||||
|
||||
{{if or .Answers .Infoboxes}}
|
||||
{{if .Infoboxes}}
|
||||
<div class="infobox-list" role="region" aria-label="Summary">
|
||||
{{range .Infoboxes}}
|
||||
<aside class="infobox-card">
|
||||
{{if .ImgSrc}}
|
||||
<div class="infobox-image-wrap">
|
||||
<img src="{{.ImgSrc}}" alt="" class="infobox-img" loading="lazy" width="120" height="120">
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="infobox-main">
|
||||
{{if .Title}}<h2 class="infobox-title">{{.Title}}</h2>{{end}}
|
||||
{{if .Content}}<p class="infobox-content">{{.Content}}</p>{{end}}
|
||||
{{if .URL}}<a href="{{.URL}}" class="infobox-link" target="_blank" rel="noopener noreferrer">Read article on Wikipedia</a>{{end}}
|
||||
</div>
|
||||
</aside>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .Answers}}
|
||||
<div id="answers">
|
||||
{{range .Answers}}
|
||||
<div class="dialog-error">{{.}}</div>
|
||||
|
|
@ -38,7 +57,7 @@
|
|||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{else if not .Answers}}
|
||||
{{else if and (not .Answers) (not .Infoboxes)}}
|
||||
<div class="no-results">
|
||||
<div class="no-results-icon" aria-hidden="true">🔍</div>
|
||||
<h2>No results found</h2>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue