Skip to content

OpenGraph for search link #52

@yelizariev

Description

@yelizariev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions