Skip to content

Commit

Permalink
version-based css url
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed Feb 18, 2020
1 parent d242080 commit 26834be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion php/Controller/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Admin
{
public function index(Filesystem $fs)
{
include $fs->getPath('index.html');
include $fs->getPath('index.php');
}

public function api(Runner $runner)
Expand Down
2 changes: 1 addition & 1 deletion public/admin/index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

include '../index.html';
include '../index.php';
12 changes: 10 additions & 2 deletions public/index.html → public/index.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<?php
$version = null;
$filename = __DIR__.'/version.php';
if (file_exists($filename)) {
$version = include $filename;
$version = $version['tag'] ?: $version['short_sha'];
}
?>
<!DOCTYPE html>
<html>
<head>
<title>tarantool admin</title>
<title>tarantool admin <?php echo $version; ?></title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<link rel="stylesheet" href="/admin/ext-6.2.0/classic/theme-crisp/resources/theme-crisp-all.css" />
<link rel="stylesheet" href="/admin/fontawesome-free-5.0.6/css/fontawesome-all.css" />
<link rel="stylesheet" href="/admin/style.css" />
<link rel="stylesheet" href="/admin/style.css<?php echo '?', $version; ?>" />
<link rel="icon" type="image/png" sizes="48x48" href="/admin/39156475-8b873e18-4756-11e8-89d0-6ffca592f664.png">

</head>
Expand Down

0 comments on commit 26834be

Please sign in to comment.