Skip to content

Commit

Permalink
fix: support cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
annProg committed Apr 5, 2020
1 parent 65efa36 commit d257ba7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions conf/default.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php

$conf['api'] = 'https://api.annhe.net/api.php';
$conf['cdn'] = 'https://api.annhe.net';
1 change: 1 addition & 0 deletions conf/metadata.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

$meta['api'] = array('string');
$meta['cdn'] = array('string');

2 changes: 1 addition & 1 deletion syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function handle($match, $state, $pos, Doku_Handler $handler) {
}

function cal_file_name($data) {
$path = substr($this->getConf('api'),0,-7) . "cache/images/";
$path = rtrim($this->getConf('cdn'),"/") . "/" . "cache/images/";
$flag = str_replace(":", "_", $data['layout']);
return $path . md5(str_replace("\n", "\r\n", $data['input'])) . "-" . $flag . "-" . $data['width'] . "x" . $date['height'] . "." . $data['chof'];
}
Expand Down

0 comments on commit d257ba7

Please sign in to comment.