Skip to content

Commit ebca321

Browse files
authored
🔥Removes linkable_title everywhere (home-assistant#9772)
* Automatically create linkable headers * Visually improve position of linkable header chain icon * Do not auto link headers on homepage * Remove linkable_title everywhere * 🚑 Re-instante linkable_title plugin as NOOP
1 parent e6605e5 commit ebca321

File tree

1,002 files changed

+4820
-4801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,002 files changed

+4820
-4801
lines changed

plugins/linkable_title.rb

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
module Jekyll
2-
class LinkableTitleTag < Liquid::Tag
3-
def initialize(tag_name, text, token)
4-
super
5-
@title = text
6-
end
1+
module Jekyll
2+
class LinkableTitleTag < Liquid::Tag
3+
def initialize(tag_name, text, token)
4+
super
5+
@title = text
6+
end
77

8-
def render(context)
9-
title = Liquid::Template.parse(@title).render context
10-
slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
11-
"<a class='title-link' name='#{slug}' href='\##{slug}'></a> #{title}"
12-
end
13-
end
14-
end
8+
def render(context)
9+
title = Liquid::Template.parse(@title).render context
10+
"#{title}"
11+
end
12+
end
13+
end
1514

16-
Liquid::Template.register_tag('linkable_title', Jekyll::LinkableTitleTag)
15+
Liquid::Template.register_tag('linkable_title', Jekyll::LinkableTitleTag)

plugins/no_follow.rb

-33
This file was deleted.

plugins/output_modder.rb

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Jekyll Out Modder - Allows for mangling/modding the HTML output
2+
#
3+
# This is combined in a single plugin/filter to reduce the NokoGiri dom
4+
# parsing to just once per page/content.
5+
#
6+
# - Automatically adds rel='external nofollow' to outgoing links.
7+
# - Automatically make headers linkable
8+
#
9+
require 'jekyll'
10+
require 'nokogiri'
11+
12+
module Jekyll
13+
module OutputModder
14+
def output_modder(content)
15+
dom = Nokogiri::HTML.fragment(content)
16+
17+
# Find all links, make all external links rel='external nofollow'
18+
dom.css('a').each do |link|
19+
rel = ['external', 'nofollow']
20+
21+
# All external links start with 'http', skip when this one does not
22+
next unless link.get_attribute('href') =~ /\Ahttp/i
23+
24+
# Play nice with our own links
25+
next if link.get_attribute('href') =~ /\Ahttps?:\/\/\w*.?home-assistant.io/i
26+
27+
# Play nice with links that already have a rel attribute set
28+
rel.unshift(link.get_attribute('rel'))
29+
30+
# Add rel attribute to link
31+
link.set_attribute('rel', rel.join(' ').strip)
32+
end
33+
34+
# Find all headers, make them linkable
35+
dom.css('h2,h3,h4,h5,h6,h7,h8').each do |header|
36+
37+
# Skip linked headers
38+
next if header.at_css('a')
39+
40+
title = header.content
41+
slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
42+
header.children = "<a class='title-link' name='#{slug}' href='\##{slug}'></a> #{title}"
43+
end
44+
45+
dom.to_s
46+
end
47+
end
48+
end
49+
50+
Liquid::Template.register_filter(Jekyll::OutputModder)

sass/custom/_paulus.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ dt:hover a.title-link {
210210

211211
&::before {
212212
position: absolute;
213-
top: 2px;
213+
top: 5px;
214214
left: -25px;
215215
padding-right: 40px;
216216
font-family: "FontAwesome";

source/_addons/check_config.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ footer: true
1111

1212
You can use this add-on to check whether your configuration files are valid against the new version of Home Assistant before you actually update your Home Assistant installation. This add-on will help you avoid errors due to breaking changes, resulting in a smooth update.
1313

14-
### {% linkable_title How to use this add-on %}
14+
### How to use this add-on
1515

1616
1. Just start the add-on.
1717
2. Wait (On a Raspberry Pi it can take several minutes).
1818
3. If you see the following output then you are good to go to update Home Assistant: `[Info] Configuration check finished - no error found! :)`.
1919

2020
If you get errors, then you should look for **Breaking Changes** against the version you specified for this add-on and change your configuration accordingly.
2121

22-
### {% linkable_title Add-on configuration %}
22+
### Add-on configuration
2323

2424
```json
2525
{

source/_addons/configurator.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ More information and a standalone version for regular Home Assistant installatio
2020
Screenshot of the HASS Configurator.
2121
</p>
2222

23-
### {% linkable_title Feature list %}
23+
### Feature list
2424

2525
- Web-based editor to modify your files with syntax highlighting and YAML linting.
2626
- Upload and download files.
@@ -32,7 +32,7 @@ Screenshot of the HASS Configurator.
3232
- Editor settings are saved in your browser.
3333
- And much more...
3434

35-
### {% linkable_title Add-on Configuration %}
35+
### Add-on Configuration
3636

3737
```json
3838
{
@@ -54,6 +54,6 @@ enforce_basepath:
5454
default: false
5555
{% endconfiguration %}
5656

57-
### {% linkable_title Old port based Access %}
57+
### Old port based Access
5858

5959
You can set a network Port and the Add-on listens on that Port with Home Assistant user credential. That is as a backup if you are not able to connect to Home Assistant anymore. Today, you can restart Home Assistant with broken config, but maybe some times usefully.

source/_addons/duckdns.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ seconds:
4949
type: integer
5050
{% endconfiguration %}
5151

52-
## {% linkable_title Home Assistant configuration %}
52+
## Home Assistant configuration
5353

5454
Use the following configuration in Home Assistant to use the generated certificate:
5555

@@ -62,15 +62,15 @@ http:
6262
6363
If you use a port other than `8123` or an SSL proxy, change the port number accordingly.
6464

65-
## {% linkable_title Router configuration %}
65+
## Router configuration
6666

6767
You'll need to forward the port you listed in your configuration (8123 in the example above) on your router to your Home Assistant system. You can find guides on how to do this on [Port Forward](https://portforward.com/). Noting that you'll only need to forward the TCP port.
6868

6969
Ensure that you allocate the Home Assistant system a fixed IP on your network before you configure port forwarding. You can do this either on the computer itself (see the [install guide](/hassio/installation/) or via a static lease on your router.
7070

7171
Restart Home Assistant for the configured changes to take effect. When you access the Home Assistant frontend you will now need to use `https`, even when accessing local instances, for example at `https://192.168.0.1:8123`.
7272

73-
## {% linkable_title Generate Let's Encrypt certificate for Duck DNS sub sub domains %}
73+
## Generate Let's Encrypt certificate for Duck DNS sub sub domains
7474

7575
To generate certificates for nr.my-domain.duckdns.org update the domain JSON settings to:
7676

source/_addons/google_assistant.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ speaker:
7979
type: string
8080
{% endconfiguration %}
8181

82-
### {% linkable_title Home Assistant configuration %}
82+
### Home Assistant configuration
8383

8484
Use the Home Assistant [DialogFlow component][comp] to integrate the add-on into Home Assistant.
8585

source/_addons/homematic.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ hmip:
103103
type: string
104104
{% endconfiguration %}
105105

106-
## {% linkable_title Home Assistant configuration %}
106+
## Home Assistant configuration
107107

108108
Use the following configuration in Home Assistant to use it:
109109

@@ -121,14 +121,14 @@ homematic:
121121
port: 2010
122122
```
123123
124-
## {% linkable_title Raspberry Pi3 %}
124+
## Raspberry Pi3
125125
126126
With HM-MOD-RPI-PCB you need to add follow into your `config.txt` on boot partition:
127127

128128
```text
129129
dtoverlay=pi3-miniuart-bt
130130
```
131131

132-
## {% linkable_title HmIP-RFUSB %}
132+
## HmIP-RFUSB
133133

134134
HassOS > 1.11 support HmIP-RFUSB default and don't need any configuration. If you run a Linux, you need to follow the installation guide from documentation to set up the UART USB interface on your computer.

source/_addons/lets_encrypt.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ keyfile:
4545
default: privkey.pem
4646
{% endconfiguration %}
4747

48-
## {% linkable_title Home Assistant configuration %}
48+
## Home Assistant configuration
4949

5050
Use the following configuration in Home Assistant to use the generated certificate:
5151

@@ -58,7 +58,7 @@ http:
5858
5959
If you use another port such as `8123` or an SSL proxy, change the port number.
6060

61-
## {% linkable_title Enabling auto-renewals %}
61+
## Enabling auto-renewals
6262

6363
Out of the box, the add-on will not automatically renew your certificate. In fact, it only starts, tries to get/renew your certificate, and then stops. It's up to you to manually start it again whenever your certificate comes close to expiry.
6464

source/_addons/mariadb.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ rights:
7777
type: string
7878
{% endconfiguration %}
7979

80-
## {% linkable_title Home Assistant configuration %}
80+
## Home Assistant configuration
8181

8282
Use the following configuration in Home Assistant to use the database above:
8383

source/_addons/mosquitto.markdown

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ customize:
4747
type: [boolean, string]
4848
{% endconfiguration %}
4949

50-
### {% linkable_title Home Assistant user management %}
50+
### Home Assistant user management
5151

5252
This add-on is attached to the Home Assistant user system, so mqtt clients can make use of these credentials. Local users may also still be set independently within the configuration options for the add-on. For the internal Hass.io ecosystem we register `homeassistant` and `addons`, so these may not be used as user names.
5353

54-
### {% linkable_title Home Assistant configuration %}
54+
### Home Assistant configuration
5555

5656
To use the Mosquitto as [broker](/docs/mqtt/broker/#run-your-own), go to the integration page and install the configuration with one click. If you have old MQTT settings available, remove this old integration and restart Home Assistant to see the new one.
5757

58-
#### {% linkable_title Using Mosquitto with Hass.io %}
58+
#### Using Mosquitto with Hass.io
5959

6060
1. Install the [Mosquitto add-on](/addons/mosquitto/) with the default configuration via 'Hass.io > ADD-ON STORE'. (Don't forget to start the add-on & verify that 'Start on boot' is enabled.)
6161

@@ -73,11 +73,11 @@ To use the Mosquitto as [broker](/docs/mqtt/broker/#run-your-own), go to the int
7373
Note: .yaml modifications are not required.
7474
See [testing your setup](/docs/mqtt/testing/) to verify the steps above.
7575

76-
### {% linkable_title Disable listening on insecure (1883) ports %}
76+
### Disable listening on insecure (1883) ports
7777

7878
Remove the ports from the add-on page network card (set them as blank) to disable them.
7979

80-
### {% linkable_title Access Control Lists (ACLs) %}
80+
### Access Control Lists (ACLs)
8181

8282
It is possible to restrict access to topics based upon the user logged in to Mosquitto. In this scenario it is recommended to create individual users for each of your clients and create an appropriate ACL.
8383

source/_addons/rpc_shutdown.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Allows you to shut down a Windows computer with a service call from Home Assista
3333
- **computers/address** (*Required*): IP address or NetBIOS name of the computer for the shutdown.
3434
- **computers/credentials** (*Required*): Credentials for logging into computer. Use a `%` as the delimiter of username and password.
3535

36-
### {% linkable_title Home Assistant configuration %}
36+
### Home Assistant configuration
3737

3838
Use the following inside Home Assistant service call to use it:
3939

source/_addons/snips.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Now install and activate the [Samba](/addons/samba/) add-on so you can upload yo
3333

3434
Now it's time to start Snips for the first time. You can configure the microphone and sound card using the Add-on interface. Now start the add-on.
3535

36-
### {% linkable_title Add-On configuration %}
36+
### Add-On configuration
3737

3838
```json
3939
{
@@ -66,19 +66,19 @@ tts_platform:
6666
type: string
6767
{% endconfiguration %}
6868

69-
### {% linkable_title Home Assistant configuration %}
69+
### Home Assistant configuration
7070

7171
A simple configuration just requires this. Consult [Snips.ai integration](/components/snips/) for more options.
7272

7373
```yaml
7474
snips:
7575
```
7676
77-
### {% linkable_title Home Assistant configuration %}
77+
### Home Assistant configuration
7878
7979
There is an active [discord](https://discordapp.com/invite/3939Kqx) channel for further support.
8080
81-
### {% linkable_title Examples %}
81+
### Examples
8282
8383
So now you can turn lights on and off, let's check the weather. Log on to the [console](https://console.snips.ai/). If this is your first time, create a new assistant and add the Home Assistant skill, along with the Weather skill by snips. Download your assistant manually and copy it to the `/share` folder on your HassIO installation using the Samba add-on.
8484

source/_addons/tellstick.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ To add [lights](/components/light.tellstick/), [sensors](/components/sensor.tell
2929
3030
The add-on will also enable you to interact with the `tdtool` via a Home Assistant services call, see example below for self-learning device.
3131

32-
## {% linkable_title Examples %}
32+
## Examples
3333

3434
Example for adding more devices in the add-on configuration (note the comma separator between devices):
3535

@@ -93,7 +93,7 @@ code:
9393

9494
For more information about the configuration including protocols, see the [telldus documentation](https://developer.telldus.com/wiki/TellStick_conf).
9595

96-
## {% linkable_title Service calls %}
96+
## Service calls
9797

9898
If you wish to teach a self-learning device in your TellStick configuration:
9999

@@ -108,7 +108,7 @@ Replace `1` with the corresponding ID of the device in your TellStick configurat
108108
You can also use this to list devices or sensors and read the output in the add-on log:
109109
`{"addon":"core_tellstick","input":{"function":"list-sensors"}}`
110110

111-
### {% linkable_title Supported service commands %}
111+
### Supported service commands
112112

113113
- `"function":"list"`: List currently configured devices with name and device id and all discovered sensors.
114114

0 commit comments

Comments
 (0)