Skip to content

Commit

Permalink
Add canonical urls
Browse files Browse the repository at this point in the history
  • Loading branch information
leongersen committed May 4, 2019
1 parent 52eca93 commit 9e386c5
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions documentation/_run/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<link href="<?php echo $distribute; ?>/nouislider.css?v=<?php echo $plain_version; ?>" rel="stylesheet">
<script src="<?php echo $distribute; ?>/nouislider.js?v=<?php echo $plain_version; ?>"></script>

<link rel="canonical" href="<?php echo $canonical; ?>">

</head>

<body class="language-javascript">
Expand Down
7 changes: 6 additions & 1 deletion documentation/_run/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
$file = '_run/404.php';
}

// Defaults for title and description.
// Defaults
$title = "";
$description = "";
$canonical = "";

$package = json_decode(file_get_contents('./../package.json'));
$version = $package->version;
Expand All @@ -40,5 +41,9 @@

ob_end_clean();

if ($canonical) {
$canonical = 'https://refreshless.com'.$canonical;
}

$distribute = '/nouislider/distribute';
include '_run/index.php';
1 change: 1 addition & 0 deletions documentation/behaviour-option.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - User Interaction Settings";
$description = "noUiSlider supports a ton of features, such as dragging the range, or setting fixed handle distances.";
$canonical = "/nouislider/behaviour-option/";
?>

<h1>Slider behaviour</h1>
Expand Down
1 change: 1 addition & 0 deletions documentation/contact.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - Help and Contact";
$description = "";
$canonical = "/nouislider/contact/"
?>

<h1>Contact</h1>
Expand Down
1 change: 1 addition & 0 deletions documentation/download.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - Download noUiSlider for free!";
$description = "Download the latest version of noUiSlider safely from gitHub. For free!";
$canonical = "/nouislider/download/"
?>

<h1>Download noUiSlider</h1>
Expand Down
1 change: 1 addition & 0 deletions documentation/events-callbacks.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - Events and callbacks";
$description = "Listen to everything that happens, and run your code when you want too. noUiSlider has a bunch of events and callbacks. Read all about them!";
$canonical = "/nouislider/events-callbacks/"
?>

<h1>Events</h1>
Expand Down
1 change: 1 addition & 0 deletions documentation/examples.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - Examples and hints";
$description = "noUiSlider has a selection of examples you can use to implement a slider easily. Take a look!";
$canonical = "/nouislider/examples/"
?>

<section>
Expand Down
1 change: 1 addition & 0 deletions documentation/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - JavaScript Range Slider";
$description = "noUiSlider is a free and lightweight JavaScript range slider with multi-touch support (iOS, Android, Windows). Great for responsive designs, and no dependencies!";
$canonical = "/nouislider/"
?>

<section>
Expand Down
1 change: 1 addition & 0 deletions documentation/more.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - Disabling, Updating and Styling";
$description = "In-dept details on disabling slider handles, updating options and styling noUiSlider.";
$canonical = "/nouislider/more/"
?>

<section>
Expand Down
1 change: 1 addition & 0 deletions documentation/pips.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - Handles and Slider Values";
$description = "";
$canonical = "/nouislider/pips/"
?>

<h1>Adding a scale/pips to a slider</h1>
Expand Down
1 change: 1 addition & 0 deletions documentation/reference.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - Option Reference";
$description = "Full reference of all options, methods, properties and events in noUiSlider.";
$canonical = "/nouislider/reference/"
?>

<section>
Expand Down
1 change: 1 addition & 0 deletions documentation/slider-options.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - Options and settings";
$description = "There are many options to make noUiSlider do exactly what you need. Read all about these options and find the one you need.";
$canonical = "/nouislider/slider-options/"
?>

<h1>Options</h1>
Expand Down
4 changes: 1 addition & 3 deletions documentation/slider-read-write.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php
$title = "noUiSlider - Getting and setting slider values";
$description = "Reading and setting values from a slider is as easy as reading from any other form element.";

$title = "noUiSlider - Formatting numbers";
$description = "noUiSlider can read and display values formatting using a bunch of options. Read more here.";
$canonical = "/nouislider/slider-read-write/"
?>

<h1>Getting and setting slider values</h1>
Expand Down
1 change: 1 addition & 0 deletions documentation/slider-values.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$title = "noUiSlider - Handles and Slider Values";
$description = "";
$canonical = "/nouislider/slider-values/"
?>

<h1>Slider values</h1>
Expand Down

0 comments on commit 9e386c5

Please sign in to comment.