add rel="noopener" when target="_blank"
This commit is contained in:
parent
1494aed01a
commit
a48b5e80d5
@ -1 +1 @@
|
||||
<figure>{% if {{include.url}} %}<a class="no_icon" target="_blank" href="{{include.url}}">{% endif %}<img class="docimage" src="images/{{include.file}}" alt="{{include.alt}}" {% if {{include.max-width}} %}style="max-width: {{include.max-width}}px"{% endif %} />{% if {{include.url}} %}</a>{% endif %}{% if {{include.caption}} %}<figcaption>{{include.caption}}</figcaption>{% endif %}</figure>
|
||||
<figure>{% if {{include.url}} %}<a class="no_icon" target="_blank" rel="noopener" href="{{include.url}}">{% endif %}<img class="docimage" src="images/{{include.file}}" alt="{{include.alt}}" {% if {{include.max-width}} %}style="max-width: {{include.max-width}}px"{% endif %} />{% if {{include.url}} %}</a>{% endif %}{% if {{include.caption}} %}<figcaption>{{include.caption}}</figcaption>{% endif %}</figure>
|
||||
|
@ -11,7 +11,7 @@
|
||||
{% for folderitem in folder.folderitems %}
|
||||
{% if folderitem.output contains "web" %}
|
||||
{% if folderitem.external_url %}
|
||||
<li><a href="{{folderitem.external_url}}" target="_blank">{{folderitem.title}}</a></li>
|
||||
<li><a href="{{folderitem.external_url}}" target="_blank" rel="noopener">{{folderitem.title}}</a></li>
|
||||
{% elsif page.url == folderitem.url %}
|
||||
<li class="active"><a href="{{folderitem.url | remove: "/"}}">{{folderitem.title}}</a></li>
|
||||
{% elsif folderitem.type == "empty" %}
|
||||
@ -28,7 +28,7 @@
|
||||
{% for subfolderitem in subfolders.subfolderitems %}
|
||||
{% if subfolderitem.output contains "web" %}
|
||||
{% if subfolderitem.external_url %}
|
||||
<li><a href="{{subfolderitem.external_url}}" target="_blank">{{subfolderitem.title}}</a></li>
|
||||
<li><a href="{{subfolderitem.external_url}}" target="_blank" rel="noopener">{{subfolderitem.title}}</a></li>
|
||||
{% elsif page.url == subfolderitem.url %}
|
||||
<li class="active"><a href="{{subfolderitem.url | remove: "/"}}">{{subfolderitem.title}}</a></li>
|
||||
{% else %}
|
||||
|
@ -22,7 +22,7 @@
|
||||
{% for entry in topnav.topnav %}
|
||||
{% for item in entry.items %}
|
||||
{% if item.external_url %}
|
||||
<li><a href="{{item.external_url}}" target="_blank">{{item.title}}</a></li>
|
||||
<li><a href="{{item.external_url}}" target="_blank" rel="noopener">{{item.title}}</a></li>
|
||||
{% elsif page.url contains item.url %}
|
||||
<li class="active"><a href="{{item.url | remove: "/"}}">{{item.title}}</a></li>
|
||||
{% else %}
|
||||
@ -39,7 +39,7 @@
|
||||
<ul class="dropdown-menu">
|
||||
{% for folderitem in folder.folderitems %}
|
||||
{% if folderitem.external_url %}
|
||||
<li><a href="{{folderitem.external_url}}" target="_blank">{{folderitem.title}}</a></li>
|
||||
<li><a href="{{folderitem.external_url}}" target="_blank" rel="noopener">{{folderitem.title}}</a></li>
|
||||
{% elsif page.url contains folderitem.url %}
|
||||
<li class="dropdownActive"><a href="{{folderitem.url | remove: "/"}}">{{folderitem.title}}</a></li>
|
||||
{% else %}
|
||||
|
@ -41,7 +41,7 @@ layout: default
|
||||
|
||||
{% if site.github_editme_path %}
|
||||
|
||||
<a target="_blank" href="https://github.com/{{site.github_editme_path}}{{page.path}}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
|
||||
<a target="_blank" rel="noopener" href="https://github.com/{{site.github_editme_path}}{{page.path}}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
@ -22,7 +22,7 @@ Here's the code for that button on the page.html layout for GitHub:
|
||||
```
|
||||
{% raw %}{% if site.github_editme_path %}
|
||||
|
||||
<a target="_blank" href="https://github.com/{{site.github_editme_path}}/{{page.folder}}{{page.url | append: ".md"}}{% endif %}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
|
||||
<a target="_blank" rel="noopener" href="https://github.com/{{site.github_editme_path}}/{{page.folder}}{{page.url | append: ".md"}}{% endif %}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
|
||||
|
||||
{% endif %}{% endraw %}
|
||||
```
|
||||
@ -33,7 +33,7 @@ and here for GitLab:
|
||||
```
|
||||
{% raw %}{% if site.gitlab_editme_path %}
|
||||
|
||||
<a target="_blank" href="https://github.com/{{site.gitlab_editme_path}}/{{page.folder}}{{page.url | append: ".md"}}{% endif %}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-gitlab fa-lg"></i> Edit me</a>
|
||||
<a target="_blank" rel="noopener" href="https://github.com/{{site.gitlab_editme_path}}/{{page.folder}}{{page.url | append: ".md"}}{% endif %}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-gitlab fa-lg"></i> Edit me</a>
|
||||
|
||||
{% endif %}{% endraw %}
|
||||
```
|
||||
|
@ -378,7 +378,7 @@ What this does is allow the prince-list.txt and toc.html files to iterate throug
|
||||
You can add a download button for your PDF using some Bootstrap button code:
|
||||
|
||||
```html
|
||||
<a target="_blank" class="noCrossRef" href="/pdf/mydoc.pdf"><button type="button" class="btn btn-default" aria-label="Left Align"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> PDF Download</button></a>
|
||||
<a target="_blank" rel="noopener" class="noCrossRef" href="/pdf/mydoc.pdf"><button type="button" class="btn btn-default" aria-label="Left Align"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> PDF Download</button></a>
|
||||
```
|
||||
|
||||
Here's what that looks like:
|
||||
|
@ -15,7 +15,7 @@ You can create a help API that developers can use to pull in content.
|
||||
|
||||
For the full code demo, see the notes in the [Tooltips file](tooltips.html).
|
||||
|
||||
In this demo, the popovers pull in and display content from the information in a <a target="_blank" href="tooltips.json">tooltips.json</a> file located in the same directory.
|
||||
In this demo, the popovers pull in and display content from the information in a <a target="_blank" rel="noopener" href="tooltips.json">tooltips.json</a> file located in the same directory.
|
||||
|
||||
Instead of placing the JSON source in the same directory, you could also host the JSON file on another site.
|
||||
|
||||
@ -134,7 +134,7 @@ This code will loop through all pages in the tooltips collection and insert the
|
||||
}
|
||||
```
|
||||
|
||||
You can also view the same JSON file here: <a target="_blank" href="tooltips.json">tooltips.json</a>.
|
||||
You can also view the same JSON file here: <a target="_blank" rel="noopener" href="tooltips.json">tooltips.json</a>.
|
||||
|
||||
You can add different fields depending on how you want the JSON to be structured. Here we just have to fields: `doc_id` and `body`. And the JSON is looking just in the tooltips collection that we created.
|
||||
|
||||
@ -236,7 +236,7 @@ Developers can access the help using the `.get` method from jQuery, among other
|
||||
});{% endraw %}
|
||||
```
|
||||
|
||||
View the <a target="_blank" href="tooltips.html" class="noCrossRef">tooltip demo</a> for a demonstration. See the source code for full code details.
|
||||
View the <a target="_blank" rel="noopener" href="tooltips.html" class="noCrossRef">tooltip demo</a> for a demonstration. See the source code for full code details.
|
||||
|
||||
The `url` in the demo is relative, but you could equally point it to an absolute path on a remote host assuming CORS is enabled on the host.
|
||||
|
||||
@ -275,7 +275,7 @@ Again, see the <a class="noCrossRef" href="tooltips.html">Tooltip Demo</a> for a
|
||||
|
||||
Note that even though you reference a Bootstrap JS script, Bootstrap's popovers require you to initialize them using the above code as well — they aren't turned on by default.
|
||||
|
||||
View the source code of the <a target="_blank" href="tooltips.html" class="noCrossRef">tooltip demo</a> for the full comments.
|
||||
View the source code of the <a target="_blank" rel="noopener" href="tooltips.html" class="noCrossRef">tooltip demo</a> for the full comments.
|
||||
|
||||
## 8. Create easy links to embed the help in your help site
|
||||
|
||||
|
@ -46,7 +46,7 @@ For example, the sidebar.html file contains the following code:
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% if folderitem.external_url %}
|
||||
<li><a href="{{folderitem.external_url}}" target="_blank">{{folderitem.title}}</a></li>
|
||||
<li><a href="{{folderitem.external_url}}" target="_blank" rel="noopener">{{folderitem.title}}</a></li>
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
|
@ -43,7 +43,7 @@ search: exclude
|
||||
{% for folderitem in folder.folderitems %}
|
||||
{% if folderitem.output contains "web" %}
|
||||
{% if folderitem.external_url %}
|
||||
<li><a href="{{folderitem.external_url}}" target="_blank">{{folderitem.title}}</a></li>
|
||||
<li><a href="{{folderitem.external_url}}" target="_blank" rel="noopener">{{folderitem.title}}</a></li>
|
||||
{% elsif page.url == folderitem.url %}
|
||||
<li class="active"><a href="{{folderitem.url | remove: "/"}}">{{folderitem.title}}</a></li>
|
||||
{% elsif folderitem.type == "empty" %}
|
||||
@ -60,7 +60,7 @@ search: exclude
|
||||
{% for subfolderitem in subfolders.subfolderitems %}
|
||||
{% if subfolderitem.output contains "web" %}
|
||||
{% if subfolderitem.external_url %}
|
||||
<li><a href="{{subfolderitem.external_url}}" target="_blank">{{subfolderitem.title}}</a></li>
|
||||
<li><a href="{{subfolderitem.external_url}}" target="_blank" rel="noopener">{{subfolderitem.title}}</a></li>
|
||||
{% elsif page.url == subfolderitem.url %}
|
||||
<li class="active"><a href="{{subfolderitem.url | remove: "/"}}">{{subfolderitem.title}}</a></li>
|
||||
{% else %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user