From edb78651681cdb57f2638c4911a1288e91306f5f Mon Sep 17 00:00:00 2001 From: Stefan Neuhaus Date: Sun, 27 May 2018 23:14:34 +0200 Subject: [PATCH] Add a BlackFriday option for rel="nofollow" on external links Add a configuration option "nofollowLinks". When set to "true" the "HTML_NOFOLLOW_LINKS" flag is being passed to Blackfriday. Thereby all *absolute* links will get a "nofollow" value for the "rel" attribute. Fixes #4722 --- content/en/readfiles/bfconfig.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content/en/readfiles/bfconfig.md b/content/en/readfiles/bfconfig.md index 2d62c310d..a7e74566a 100644 --- a/content/en/readfiles/bfconfig.md +++ b/content/en/readfiles/bfconfig.md @@ -43,6 +43,11 @@ Blackfriday flag: **`HTML_HREF_TARGET_BLANK`**
Purpose: `true` opens external links **absolute** links in a new window or tab. While the `target="_blank"` attribute is typically used for external links, Blackfriday does that for _all_ absolute links ([ref](https://discourse.gohugo.io/t/internal-links-in-same-tab-external-links-in-new-tab/11048/8)). One needs to make note of this if they use absolute links throughout, for internal links too (for example, by setting `canonifyURLs` to `true` or via `absURL`). +`nofollowLinks` +: default: **`false`**
+ Blackfriday flag: **`HTML_NOFOLLOW_LINKS`**
+ Purpose: `true` creates external links **absolute** links with `nofollow` being added to their `rel` attribute. Thereby crawlers are advised to not follow the link. While the `rel="nofollow"` attribute is typically used for external links, Blackfriday does that for _all_ absolute links. One needs to make note of this if they use absolute links throughout, for internal links too (for example, by setting `canonifyURLs` to `true` or via `absURL`). + `plainIDAnchors` : default **`true`**
Blackfriday flag: **`FootnoteAnchorPrefix` and `HeaderIDSuffix`**