diff --git a/docs/docs/devices.mdx b/docs/docs/adding-devices.mdx similarity index 100% rename from docs/docs/devices.mdx rename to docs/docs/adding-devices.mdx diff --git a/docs/docs/configuration.mdx b/docs/docs/parameters.mdx similarity index 100% rename from docs/docs/configuration.mdx rename to docs/docs/parameters.mdx diff --git a/docs/docs/ui/configuration.mdx b/docs/docs/ui/configuration.mdx index 6806f5d..bfa6047 100644 --- a/docs/docs/ui/configuration.mdx +++ b/docs/docs/ui/configuration.mdx @@ -66,13 +66,14 @@ If your organization's policy allows, and you don't mind, I request that you kee If you're not familiar with [OpenGraph](https://ogp.me/), it's the thing that generates the pretty pictures, titles, and descriptions for links when you post them to sites/tools such as Facebook, Twitter, Slack, etc. -By default, no Opengraph image is set. If you define one with `image`, hyperglass will try to determine the image's dimensions automatically. Or, you can override those dimensions with the `width` and `height` parameters. +By default, [this Opengraph image](/opengraph.jpg) is set. If you define one with `image`, hyperglass will automatically generate an Opengraph image using the following methodology: -| Parameter | Type | Description | -| :-------- | :-----: | :---------------------- | -| `image` | String | Path to opengraph image | -| `width` | Integer | Opengraph image width | -| `height` | Integer | Opengraph image height | +- If the image is already 1200x630, it will be used +- If the image is or is not 1200x630, but contains transparency (like in a `.png` formatted image), it will be converted to a JPEG file with the [`black`](theme#colors) used as the background color. + +| Parameter | Type | Description | +| :-------- | :----: | :---------------------- | +| `image` | String | Path to opengraph image | ## `terms` diff --git a/docs/docs/ui/example.mdx b/docs/docs/ui/example.mdx index b9bc5af..89ee7f5 100644 --- a/docs/docs/ui/example.mdx +++ b/docs/docs/ui/example.mdx @@ -24,15 +24,13 @@ web: file: null title: Help logo: - dark: /home/ubuntu/hyperglass/hyperglass-light.png - light: /home/ubuntu/hyperglass/hyperglass-dark.png - favicon: /home/ubuntu/hyperglass/icon.png + dark: /home/ubuntu/hyperglass/hyperglass-light.svg + light: /home/ubuntu/hyperglass/hyperglass-dark.svg + favicon: /home/ubuntu/hyperglass/hyperglass-icon.svg height: null - width: 384 + width: "75%" opengraph: - height: 1132 - image: /images/hyperglass-opengraph.png - width: 7355 + image: /home/ubuntu/hyperglass/hyperglass-opengraph.png terms: enable: true file: null @@ -50,7 +48,7 @@ web: theme: default_color_mode: light colors: - black: "#262626" + black: "#121212" blue: "#314cb6" cyan: "#118ab2" danger: "#d84b4b" diff --git a/docs/docs/ui/logo.mdx b/docs/docs/ui/logo.mdx index 587950c..7ea7dde 100644 --- a/docs/docs/ui/logo.mdx +++ b/docs/docs/ui/logo.mdx @@ -13,8 +13,8 @@ description: Customize the Logo & Favicon | `light` | String | hyperglass logo | Path to logo that will be used in light mode | | `dark` | String | hyperglass logo | Path to logo that will be used in dark mode | | `favicon` | String | hyperglass icon | Path to logo that will be used as the favicon | -| `width` | Integer | `384` | Maximum logo width in pixels | -| `height` | Integer | | Maximum logo height in pixels | +| `width` | Integer | `75%` | Maximum logo width as a percentage | +| `height` | Integer | | Maximum logo height as a percentage | ### Favicon diff --git a/docs/docs/ui/theme.mdx b/docs/docs/ui/theme.mdx index 1d4f47d..c3402da 100644 --- a/docs/docs/ui/theme.mdx +++ b/docs/docs/ui/theme.mdx @@ -35,8 +35,8 @@ import PageLink from "../../src/components/PageLink"; | `warning` | String | | Warning message/status color | | `error` | String | | Error message/status color | | `danger` | String | | Danger message/status color | -| `black` | String | | Used as background color in dark mode | -| `white` | String | | Used as background color in light mode | +| `black` | String | | Used as background color in dark mode | +| `white` | String | | Used as background color in light mode | | `red` | String | | Used as `danger` color if undefined | | `orange` | String | | Used as `error` color if undefined | | `yellow` | String | | Used as `warning` color if undefined | diff --git a/docs/static/sitemap.xml b/docs/static/sitemap.xml index 85f5360..d3f12db 100644 --- a/docs/static/sitemap.xml +++ b/docs/static/sitemap.xml @@ -1,21 +1,13 @@ - https://hyperglass.io/docs/cache + https://hyperglass.io/docs/adding-devices https://hyperglass.io/docs/commands - - https://hyperglass.io/docs/configuration - - - - https://hyperglass.io/docs/devices - - https://hyperglass.io/docs/getting-started @@ -36,6 +28,10 @@ https://hyperglass.io/docs/messages + + https://hyperglass.io/docs/parameters + + https://hyperglass.io/docs/platforms @@ -45,7 +41,11 @@ - https://hyperglass.io/docs/queries + https://hyperglass.io/docs/query-settings + + + + https://hyperglass.io/docs/response-caching @@ -57,7 +57,7 @@ - https://hyperglass.io/docs/structured-data + https://hyperglass.io/docs/table-output diff --git a/hyperglass/configuration/models/opengraph.py b/hyperglass/configuration/models/opengraph.py index 76380fb..34b899c 100644 --- a/hyperglass/configuration/models/opengraph.py +++ b/hyperglass/configuration/models/opengraph.py @@ -2,11 +2,10 @@ # Standard Library import os -from typing import Optional from pathlib import Path # Third Party -from pydantic import FilePath, StrictInt, validator +from pydantic import FilePath, validator # Project from hyperglass.models import HyperglassModel @@ -18,8 +17,6 @@ DEFAULT_IMAGES = Path(__file__).parent.parent.parent / "images" class OpenGraph(HyperglassModel): """Validation model for params.opengraph.""" - width: Optional[StrictInt] - height: Optional[StrictInt] image: FilePath = DEFAULT_IMAGES / "hyperglass-opengraph.jpg" @validator("image")