Skip to content

Commit

Permalink
docs: use generated og image (#17601)
Browse files Browse the repository at this point in the history
* docs: use generated og image

* fix: revert code for testing

* Update docs/src/_includes/layouts/base.html

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

* chore: urlencode title and summary in og

---------

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
  • Loading branch information
kecrily and mdjermanovic authored Oct 1, 2023
1 parent 0a9c433 commit dbf831e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/src/_includes/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@
{% set page_title = site[hook].title %}
{% endif %}

{% set rule_meta = rules_meta[title] %}
{% set page_title = site.shared.title_format | replace("PAGE_TITLE", page_title) %}
{% set cover_image = ["https://", site.hostname, "/icon-512.png" ] | join %}
{% set cover_image_alt = site.shared.eslint_logo_alt %}
{% set page_desc = site.shared.description %}
{% set relative_page_url = page.url | url | prettyURL %}
{% set cover_image = [
"https://", site.hostname, "/og",
"?title=", title | urlencode, "&summary=", page_desc | urlencode,
"&is_rule=", rule_meta !== undefined,
"&recommended=", rule_meta.docs.recommended,
"&fixable=", rule_meta.fixable,
"&suggestions=", rule_meta.hasSuggestions
] | join %}
{% set cover_image_alt = site.shared.eslint_logo_alt %}
{% set page_url = ["https://", site.hostname, relative_page_url ] | join %}

<!-- SEO -->
Expand Down

0 comments on commit dbf831e

Please sign in to comment.