Add markets widget link templates & automatic name

This commit is contained in:
Svilen Markov
2025-01-12 04:21:47 +00:00
parent 260bc15577
commit 5723fbdea5
3 changed files with 55 additions and 10 deletions

View File

@@ -1719,6 +1719,8 @@ Preview:
| ---- | ---- | -------- |
| markets | array | yes |
| sort-by | string | no |
| chart-link-template | string | no |
| symbol-link-template | string | no |
##### `markets`
An array of markets for which to display information about.
@@ -1726,7 +1728,21 @@ An array of markets for which to display information about.
##### `sort-by`
By default the markets are displayed in the order they were defined. You can customize their ordering by setting the `sort-by` property to `change` for descending order based on the stock's percentage change (e.g. 1% would be sorted higher than -1%) or `absolute-change` for descending order based on the stock's absolute price change (e.g. -1% would be sorted higher than +0.5%).
###### Properties for each stock
##### `chart-link-template`
A template for the link to go to when clicking on the chart that will be applied to all markets. The value `{SYMBOL}` will be replaced with the symbol of the market. You can override this on a per-market basis by specifying a `chart-link` property. Example:
```yaml
chart-link-template: https://www.tradingview.com/chart/?symbol={SYMBOL}
```
##### `symbol-link-template`
A template for the link to go to when clicking on the symbol that will be applied to all markets. The value `{SYMBOL}` will be replaced with the symbol of the market. You can override this on a per-market basis by specifying a `symbol-link` property. Example:
```yaml
symbol-link-template: https://www.google.com/search?tbm=nws&q={SYMBOL}
```
###### Properties for each market
| Name | Type | Required |
| ---- | ---- | -------- |
| symbol | string | yes |
@@ -1743,9 +1759,11 @@ The symbol, as seen in Yahoo Finance.
The name that will be displayed under the symbol.
`symbol-link`
The link to go to when clicking on the symbol.
`chart-link`
The link to go to when clicking on the chart.
### Twitch Channels