Add title option. Fix #1
This commit is contained in:
parent
432f9d6eb2
commit
76f09fd20a
@ -3,7 +3,7 @@ favicon
|
|||||||
|
|
||||||
[](https://github.com/custom-components/hacs)
|
[](https://github.com/custom-components/hacs)
|
||||||
|
|
||||||
Change the favicon and app icons of your Home Assistant instance
|
Change the gui page title, favicon and app icons of your Home Assistant instance
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -21,6 +21,7 @@ Change the favicon and app icons of your Home Assistant instance
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
favicon:
|
favicon:
|
||||||
|
title: My Home
|
||||||
favicon: /local/favicons/favicon.ico
|
favicon: /local/favicons/favicon.ico
|
||||||
apple: /local/favicons/apple-touch-icon-180x180.png
|
apple: /local/favicons/apple-touch-icon-180x180.png
|
||||||
32: /local/favicons/favicon-32x32.png
|
32: /local/favicons/favicon-32x32.png
|
||||||
@ -33,6 +34,8 @@ favicon:
|
|||||||
|
|
||||||
# Options
|
# Options
|
||||||
|
|
||||||
|
- `title` - The title to display at the top of the window or browser tab.
|
||||||
|
|
||||||
- `favicon` - an .ico file which is displayed in your browser tab or bookmark menu.
|
- `favicon` - an .ico file which is displayed in your browser tab or bookmark menu.
|
||||||
|
|
||||||
- `apple` - a 180 x 180 px image that will be displayed on your iDevice home screen if you save the link there
|
- `apple` - a 180 x 180 px image that will be displayed on your iDevice home screen if you save the link there
|
||||||
|
@ -11,6 +11,7 @@ async def async_setup(hass, config):
|
|||||||
|
|
||||||
favicon = config[DOMAIN].get('favicon')
|
favicon = config[DOMAIN].get('favicon')
|
||||||
apple = config[DOMAIN].get('apple')
|
apple = config[DOMAIN].get('apple')
|
||||||
|
title = config[DOMAIN].get('title')
|
||||||
|
|
||||||
if favicon or apple:
|
if favicon or apple:
|
||||||
get_template = homeassistant.components.frontend.IndexView.get_template
|
get_template = homeassistant.components.frontend.IndexView.get_template
|
||||||
@ -24,6 +25,8 @@ async def async_setup(hass, config):
|
|||||||
text = text.replace("/static/icons/favicon.ico", favicon)
|
text = text.replace("/static/icons/favicon.ico", favicon)
|
||||||
if apple:
|
if apple:
|
||||||
text = text.replace("/static/icons/favicon-apple-180x180.png", apple)
|
text = text.replace("/static/icons/favicon-apple-180x180.png", apple)
|
||||||
|
if title:
|
||||||
|
text = text.replace("<title>Home Assistant</title>", f"<title>{title}</title>")
|
||||||
return text
|
return text
|
||||||
tpl.render = new_render
|
tpl.render = new_render
|
||||||
return tpl
|
return tpl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user