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

OpenGraph for search link #52

Open
yelizariev opened this issue Jun 11, 2020 · 0 comments
Open

OpenGraph for search link #52

yelizariev opened this issue Jun 11, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@yelizariev
Copy link

yelizariev commented Jun 11, 2020

Feature request.

Add following OpenGraph meta to html body:

<meta property="og:title" content="{{Search for QUERY in REPO_NUM repositories}}">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ ---the same as original url--- }}">
<meta property="og:image" content="{{ ---Link for an image with results preview. See below--- }}}">
<meta property="og:description" content="{{  Found ~TOTAL_RESULTS results }}">

Image

For example, for a link https://odoo-source.com/?q=Pedro+M.+Baeza&excludeFiles=po%24%7Cpot%24%7Cyml%24%7Cyaml%24%7Ccss%24%7C%2Fstatic%2Flib%2F&files=&i=nope&repos=13.0
the image should be similar to first result of the search:

image
i.e.

  • has repo name
  • has file name
  • has lines numbers
  • contains some lines before and lines after
  • highlights the match

Additionally it must have text at the bottom aligned right and equal to page title + website domain. For example above it's "RegExp search in Odoo source and OCA modules | odoo-source.com"

The image must be in png format.

Image size is 1200 x 630

Text must be readable (not too small)

text fields

  • QUERY is q value, i.e. Pedro M. Baeza in example above
  • REPO_NUM is num of repositories that match repos filter
  • TOTAL_RESULTS is computed as sum of len(PreSearchResponse.Files) in all repos
@yelizariev yelizariev added the enhancement New feature or request label Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant