Skip to content

Commit

Permalink
Add <link rel="canonical"> for the latest API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Apr 22, 2018
1 parent 2f2c04f commit daf1ac7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compiler/crystal/tools/doc/html/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<meta id="repository-name" content="<%= repository_name %>">
<title>README - <%= repository_name %></title>
<script type="text/javascript">
CrystalDoc.base_path = "";
CrystalDoc.base_path = "";
</script>
<link rel="canonical" href="<%= LATEST_API_URL %>" />
</head>
<body>

Expand Down
1 change: 1 addition & 0 deletions src/compiler/crystal/tools/doc/html/type.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<script type="text/javascript">
CrystalDoc.base_path = "<%= type.path_to "" %>";
</script>
<link rel="canonical" href="<%= "#{LATEST_API_URL}/#{type.path}" %>" />
</head>
<body>

Expand Down
2 changes: 2 additions & 0 deletions src/compiler/crystal/tools/doc/main.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Crystal::Doc
LATEST_API_URL = "https://crystal-lang.org/api/latest"

record Main, body : String, program : Type, repository_name : String do
def to_s(io : IO)
to_json(io)
Expand Down

0 comments on commit daf1ac7

Please sign in to comment.