This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
69 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* Castle highLight Class | ||
* Last Update: 2020/02/29 | ||
*/ | ||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; | ||
|
||
class Castle_highLight { | ||
|
||
/** | ||
* 获取高亮样式 | ||
* | ||
* @return $file 高亮文件路径 | ||
*/ | ||
public static function getFile() { | ||
$loaclUrl = Helper::options()->themeUrl.'/core/highlight/'; | ||
$hl = (Helper::options()->highLight) ? $loaclUrl.Helper::options()->highLight : 'https://cdn.jsdelivr.net/gh/ohmyga233/castle-Typecho-Theme@'.CASTLE_VERSION.'/core/highlight/default.min.css'; | ||
return $hl; | ||
} | ||
|
||
/** | ||
* 获取样式路径 | ||
* | ||
* @return array | ||
*/ | ||
public static function getHighLightConfig() { | ||
$hltd = Helper::options()->themeFile(Castle_Libs::getTheme(), "core/highlight/default.min.css"); | ||
if (file_exists($hltd)) { | ||
$hlts = array_map('basename', glob(__DIR__ . '/../highlight/*.css')); | ||
$hlts = array_combine($hlts, $hlts); | ||
$texts = ''; | ||
}else{ | ||
$hlts = array('jsdelivr' => '默认'); | ||
$texts = '<small style="color: red;">找不到 \'others/css/highlight/default.min.css\' 故将使用 JSdelivr 上的默认样式</small>'; | ||
} | ||
|
||
return [$hlts, $texts]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.