Skip to content

Commit

Permalink
🔥Removes linkable_title everywhere (#9772)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
frenck committed Jul 4, 2019
1 parent e6605e5 commit ebca321
Show file tree
Hide file tree
Showing 1,002 changed files with 4,820 additions and 4,801 deletions.
27 changes: 13 additions & 14 deletions plugins/linkable_title.rb
@@ -1,16 +1,15 @@
module Jekyll
class LinkableTitleTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@title = text
end
module Jekyll
class LinkableTitleTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@title = text
end

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

Liquid::Template.register_tag('linkable_title', Jekyll::LinkableTitleTag)
Liquid::Template.register_tag('linkable_title', Jekyll::LinkableTitleTag)
33 changes: 0 additions & 33 deletions plugins/no_follow.rb

This file was deleted.

50 changes: 50 additions & 0 deletions plugins/output_modder.rb
@@ -0,0 +1,50 @@
# Jekyll Out Modder - Allows for mangling/modding the HTML output
#
# This is combined in a single plugin/filter to reduce the NokoGiri dom
# parsing to just once per page/content.
#
# - Automatically adds rel='external nofollow' to outgoing links.
# - Automatically make headers linkable
#
require 'jekyll'
require 'nokogiri'

module Jekyll
module OutputModder
def output_modder(content)
dom = Nokogiri::HTML.fragment(content)

# Find all links, make all external links rel='external nofollow'
dom.css('a').each do |link|
rel = ['external', 'nofollow']

# All external links start with 'http', skip when this one does not
next unless link.get_attribute('href') =~ /\Ahttp/i

# Play nice with our own links
next if link.get_attribute('href') =~ /\Ahttps?:\/\/\w*.?home-assistant.io/i

# Play nice with links that already have a rel attribute set
rel.unshift(link.get_attribute('rel'))

# Add rel attribute to link
link.set_attribute('rel', rel.join(' ').strip)
end

# Find all headers, make them linkable
dom.css('h2,h3,h4,h5,h6,h7,h8').each do |header|

# Skip linked headers
next if header.at_css('a')

title = header.content
slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
header.children = "<a class='title-link' name='#{slug}' href='\##{slug}'></a> #{title}"
end

dom.to_s
end
end
end

Liquid::Template.register_filter(Jekyll::OutputModder)
2 changes: 1 addition & 1 deletion sass/custom/_paulus.scss
Expand Up @@ -210,7 +210,7 @@ dt:hover a.title-link {

&::before {
position: absolute;
top: 2px;
top: 5px;
left: -25px;
padding-right: 40px;
font-family: "FontAwesome";
Expand Down
4 changes: 2 additions & 2 deletions source/_addons/check_config.markdown
Expand Up @@ -11,15 +11,15 @@ footer: true

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.

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

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

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.

### {% linkable_title Add-on configuration %}
### Add-on configuration

```json
{
Expand Down
6 changes: 3 additions & 3 deletions source/_addons/configurator.markdown
Expand Up @@ -20,7 +20,7 @@ More information and a standalone version for regular Home Assistant installatio
Screenshot of the HASS Configurator.
</p>

### {% linkable_title Feature list %}
### Feature list

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

### {% linkable_title Add-on Configuration %}
### Add-on Configuration

```json
{
Expand All @@ -54,6 +54,6 @@ enforce_basepath:
default: false
{% endconfiguration %}

### {% linkable_title Old port based Access %}
### Old port based Access

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.
6 changes: 3 additions & 3 deletions source/_addons/duckdns.markdown
Expand Up @@ -49,7 +49,7 @@ seconds:
type: integer
{% endconfiguration %}

## {% linkable_title Home Assistant configuration %}
## Home Assistant configuration

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

Expand All @@ -62,15 +62,15 @@ http:

If you use a port other than `8123` or an SSL proxy, change the port number accordingly.

## {% linkable_title Router configuration %}
## Router configuration

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.

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.

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`.

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

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

Expand Down
2 changes: 1 addition & 1 deletion source/_addons/google_assistant.markdown
Expand Up @@ -79,7 +79,7 @@ speaker:
type: string
{% endconfiguration %}

### {% linkable_title Home Assistant configuration %}
### Home Assistant configuration

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

Expand Down
6 changes: 3 additions & 3 deletions source/_addons/homematic.markdown
Expand Up @@ -103,7 +103,7 @@ hmip:
type: string
{% endconfiguration %}

## {% linkable_title Home Assistant configuration %}
## Home Assistant configuration

Use the following configuration in Home Assistant to use it:

Expand All @@ -121,14 +121,14 @@ homematic:
port: 2010
```

## {% linkable_title Raspberry Pi3 %}
## Raspberry Pi3

With HM-MOD-RPI-PCB you need to add follow into your `config.txt` on boot partition:

```text
dtoverlay=pi3-miniuart-bt
```

## {% linkable_title HmIP-RFUSB %}
## HmIP-RFUSB

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.
4 changes: 2 additions & 2 deletions source/_addons/lets_encrypt.markdown
Expand Up @@ -45,7 +45,7 @@ keyfile:
default: privkey.pem
{% endconfiguration %}

## {% linkable_title Home Assistant configuration %}
## Home Assistant configuration

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

Expand All @@ -58,7 +58,7 @@ http:

If you use another port such as `8123` or an SSL proxy, change the port number.

## {% linkable_title Enabling auto-renewals %}
## Enabling auto-renewals

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.

Expand Down
2 changes: 1 addition & 1 deletion source/_addons/mariadb.markdown
Expand Up @@ -77,7 +77,7 @@ rights:
type: string
{% endconfiguration %}

## {% linkable_title Home Assistant configuration %}
## Home Assistant configuration

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

Expand Down
10 changes: 5 additions & 5 deletions source/_addons/mosquitto.markdown
Expand Up @@ -47,15 +47,15 @@ customize:
type: [boolean, string]
{% endconfiguration %}

### {% linkable_title Home Assistant user management %}
### Home Assistant user management

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.

### {% linkable_title Home Assistant configuration %}
### Home Assistant configuration

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.

#### {% linkable_title Using Mosquitto with Hass.io %}
#### Using Mosquitto with Hass.io

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.)

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

### {% linkable_title Disable listening on insecure (1883) ports %}
### Disable listening on insecure (1883) ports

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

### {% linkable_title Access Control Lists (ACLs) %}
### Access Control Lists (ACLs)

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.

Expand Down
2 changes: 1 addition & 1 deletion source/_addons/rpc_shutdown.markdown
Expand Up @@ -33,7 +33,7 @@ Allows you to shut down a Windows computer with a service call from Home Assista
- **computers/address** (*Required*): IP address or NetBIOS name of the computer for the shutdown.
- **computers/credentials** (*Required*): Credentials for logging into computer. Use a `%` as the delimiter of username and password.

### {% linkable_title Home Assistant configuration %}
### Home Assistant configuration

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

Expand Down
8 changes: 4 additions & 4 deletions source/_addons/snips.markdown
Expand Up @@ -33,7 +33,7 @@ Now install and activate the [Samba](/addons/samba/) add-on so you can upload yo

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.

### {% linkable_title Add-On configuration %}
### Add-On configuration

```json
{
Expand Down Expand Up @@ -66,19 +66,19 @@ tts_platform:
type: string
{% endconfiguration %}

### {% linkable_title Home Assistant configuration %}
### Home Assistant configuration

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

```yaml
snips:
```

### {% linkable_title Home Assistant configuration %}
### Home Assistant configuration

There is an active [discord](https://discordapp.com/invite/3939Kqx) channel for further support.

### {% linkable_title Examples %}
### Examples

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.

Expand Down
6 changes: 3 additions & 3 deletions source/_addons/tellstick.markdown
Expand Up @@ -29,7 +29,7 @@ To add [lights](/components/light.tellstick/), [sensors](/components/sensor.tell

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.

## {% linkable_title Examples %}
## Examples

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

Expand Down Expand Up @@ -93,7 +93,7 @@ code:

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

## {% linkable_title Service calls %}
## Service calls

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

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

### {% linkable_title Supported service commands %}
### Supported service commands

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

Expand Down

0 comments on commit ebca321

Please sign in to comment.