Skip to content

Commit

Permalink
set canonical urls (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
oraNod authored Feb 15, 2024
1 parent 3931855 commit 8c3f53e
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 37 deletions.
1 change: 1 addition & 0 deletions data/base.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
site_title: Ansible Documentation
site_description: Ansible Documentation
site_author: Ansible Community
base_url: https://docs.ansible.com/
7 changes: 7 additions & 0 deletions data/links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ ecosystem: ecosystem.html
maintainers: maintainers.html
platform: platform.html
users: users.html
not_found: 404.html
ansible_community: ansible_community.html
ansible_archive: ansible-prior-versions.html
tower_zh: automation-tower-chinese-translations.html
tower_ja: automation-tower-japanese-translations.html
tower_ko: automation-tower-korean-translations.html
tower_archive: automation-tower-prior-versions.html
1 change: 1 addition & 0 deletions templates/404.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = "Not found" %}
{% set page_link = links.not_found %}
{% extends "_base.html" %} {% block body %}
<section class="container">
<div class="row-fluid-wrapper row-depth-1 row-number-3">
Expand Down
1 change: 1 addition & 0 deletions templates/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<title>{{ (page_title ~ " | " if page_title is defined else "") ~ base.site_title }}</title>
<meta name="description" content="{{ base.site_description }}" />
<meta name="author" content="{{ base.site_author }}" />
<link rel="canonical" href="{{ base.base_url }}{{ page_link if page_link is defined else "" }}"/>
<link rel="stylesheet"
href="https://static.redhat.com/libs/redhat/redhat-font/2.0.0/webfonts/red-hat-font.css"/>
<link rel="stylesheet"
Expand Down
39 changes: 7 additions & 32 deletions templates/_docbar.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
<nav class="navbar navbar-expand-md p-1 docbar">
<div class="container">
<!--span class="docbar d-flex justify-content-center">
<ul class="navbar-nav mx-auto p-0">
<li class="nav-item">
<a class="nav-link" href="{{ links.community }}">Join the community</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.users }}">Ansible users</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.developers }}">Ansible developers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.maintainers }}">Community maintainers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.core }}">Ansible core</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.ecosystem }}">Ansible ecosystem</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.platform }}">Red Hat Ansible Automation Platform</a>
</li>
</ul>
</span-->
<button
class="navbar-toggler collapsed"
type="button"
Expand All @@ -42,25 +17,25 @@
<div class="collapse navbar-collapse" id="sub-menu">
<ul class="navbar-nav mx-auto p-0">
<li class="nav-item">
<a class="nav-link" href="{{ links.community }}">Join the community</a>
<a class="nav-link" href="{{ base.base_url }}{{ links.community }}">Join the community</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.users }}">Users</a>
<a class="nav-link" href="{{ base.base_url }}{{ links.users }}">Users</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.developers }}">Developers</a>
<a class="nav-link" href="{{ base.base_url }}{{ links.developers }}">Developers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.maintainers }}">Maintainers</a>
<a class="nav-link" href="{{ base.base_url }}{{ links.maintainers }}">Maintainers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.core }}">Ansible core</a>
<a class="nav-link" href="{{ base.base_url }}{{ links.core }}">Ansible core</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.ecosystem }}">Ansible ecosystem</a>
<a class="nav-link" href="{{ base.base_url }}{{ links.ecosystem }}">Ansible ecosystem</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ links.platform }}">Red Hat Ansible Automation Platform</a>
<a class="nav-link" href="{{ base.base_url }}{{ links.platform }}">Red Hat Ansible Automation Platform</a>
</li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/_nav.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-md p-1">
<div class="container">
<a href="{{ links.index }}">
<a href="{{ base.base_url }}">
<span class="navbar-brand d-flex justify-content-center">
<svg version="1.1"
id="Layer_1"
Expand Down
2 changes: 1 addition & 1 deletion templates/_scripts.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script src="static/js/iframeResizer.min.js" type="javascript"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" crossorigin="anonymous"></script>
<script src="https://www.ansible.com/hubfs/js/scripts.min.js"></script>
<script src="//www.redhat.com/dtm.js"></script>
<script src="https://www.redhat.com/dtm.js"></script>
1 change: 1 addition & 0 deletions templates/ansible-prior-versions.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.community.archive.title %}
{% set page_link = links.ansible_archive %}
{% extends "_base.html" %} {% block body %}
<div class="container">
<div class="full-width-bg component">
Expand Down
1 change: 1 addition & 0 deletions templates/ansible_community.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.community_docs.title %}
{% set page_link = links.ansible_community %}
{% extends "_base.html" %} {% block body %}
<div class="container">
<div class="full-width-bg component">
Expand Down
1 change: 1 addition & 0 deletions templates/automation-tower-chinese-translations.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.controller.tower_zh.title %}
{% set page_link = links.tower_zh %}
{% extends "_base.html" %}
{% block body %}
<div class="container">
Expand Down
1 change: 1 addition & 0 deletions templates/automation-tower-japanese-translations.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.controller.tower_ja.title %}
{% set page_link = links.tower_ja %}
{% extends "_base.html" %}
{% block body %}
<div class="container">
Expand Down
1 change: 1 addition & 0 deletions templates/automation-tower-korean-translations.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.controller.tower_ko.title %}
{% set page_link = links.tower_ko %}
{% extends "_base.html" %}
{% block body %}
<div class="container">
Expand Down
1 change: 1 addition & 0 deletions templates/automation-tower-prior-versions.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.controller.archive.title %}
{% set page_link = links.tower_archive %}
{% extends "_base.html" %} {% block body %}
<div class="container">
<div class="full-width-bg component">
Expand Down
1 change: 1 addition & 0 deletions templates/community.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.community.title %}
{% set page_link = links.community %}
{% extends "_base.html" %} {% block body %}
<div class="container">
<div class="full-width-bg component">
Expand Down
1 change: 1 addition & 0 deletions templates/core-translated-ja.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.core.core_ja.title %}
{% set page_link = links.core_ja %}
{% extends "_base.html" %}
{% block body %}
<div class="container">
Expand Down
1 change: 1 addition & 0 deletions templates/core.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.core.title %}
{% set page_link = links.core %}
{% extends "_base.html" %}
{% block body %}
<div class="container">
Expand Down
1 change: 1 addition & 0 deletions templates/developers.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.developers.title %}
{% set page_link = links.developers %}
{% extends "_base.html" %} {% block body %}
<div class="container">
<div class="full-width-bg component">
Expand Down
1 change: 1 addition & 0 deletions templates/ecosystem.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.ecosystem.title %}
{% set page_link = links.ecosystem %}
{% extends "_base.html" %}
{% block body %}
<div class="container">
Expand Down
6 changes: 3 additions & 3 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h4>{{ index.persona.users }} <i class="fas fa-cogs"></i></h4>
{%- endfor %}
</div>
<p>
<a class="btn" href="{{ links.users }}" role="button"><i class="fas fa-angle-double-right"></i>&nbsp;{{ index.continue.users }}</a>
<a class="btn" href="{{ base.base_url }}{{ links.users }}" role="button"><i class="fas fa-angle-double-right"></i>&nbsp;{{ index.continue.users }}</a>
</p>
</div>
<!-- End Ansible users section -->
Expand All @@ -57,7 +57,7 @@ <h4>{{ index.persona.developers }} <i class="fas fa-code"></i></h4>
{%- endfor %}
</div>
<p>
<a class="btn" href="{{ links.developers }}" role="button"><i class="fas fa-angle-double-right"></i>&nbsp;{{ index.continue.developers }}</a>
<a class="btn" href="{{ base.base_url }}{{ links.developers }}" role="button"><i class="fas fa-angle-double-right"></i>&nbsp;{{ index.continue.developers }}</a>
</p>
</div>
<!-- End Ansible developers section -->
Expand All @@ -70,7 +70,7 @@ <h4>{{ index.persona.maintainers }} <i class="fas fa-project-diagram"></i></h4>
{%- endfor %}
</div>
<p>
<a class="btn" href="{{ links.maintainers }}" role="button"><i class="fas fa-angle-double-right"></i>&nbsp;{{ index.continue.maintainers }}</a>
<a class="btn" href="{{ base.base_url }}{{ links.maintainers }}" role="button"><i class="fas fa-angle-double-right"></i>&nbsp;{{ index.continue.maintainers }}</a>
</p>
</div>
<!-- End Ansible community maintainers section -->
Expand Down
1 change: 1 addition & 0 deletions templates/maintainers.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.maintainers.title %}
{% set page_link = links.maintainers %}
{% extends "_base.html" %} {% block body %}
<div class="container">
<div class="full-width-bg component">
Expand Down
1 change: 1 addition & 0 deletions templates/platform.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.platform.title %}
{% set page_link = links.platform %}
{% extends "_base.html" %} {% block body %}
<div class="container">
<div class="full-width-bg component">
Expand Down
1 change: 1 addition & 0 deletions templates/users.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set page_title = pages.users.title %}
{% set page_link = links.users %}
{% extends "_base.html" %} {% block body %}
<div class="container">
<div class="full-width-bg component">
Expand Down

0 comments on commit 8c3f53e

Please sign in to comment.