Skip to content

Commit

Permalink
✨ 支持添加主题颜色.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoharWang committed Apr 3, 2018
1 parent 92d4052 commit a89af7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ function themeConfig($form) {
$avatarUrl = new Typecho_Widget_Helper_Form_Element_Text('avatarUrl', NULL, NULL, _t('头像 URL 地址'), _t('在这里填入一个图片 URL 地址, 留空则返回 Gravatar, 不建议留空.'));
$form->addInput($avatarUrl);

$themeColor = new Typecho_Widget_Helper_Form_Element_Text('themeColor', NULL, '#000000', _t('主题颜色'), _t('在这里填入一个主题颜色, 默认为 #000000, 留空则不启用.'));
$form->addInput($themeColor);

$icpNumber = new Typecho_Widget_Helper_Form_Element_Text('icpNumber', NULL, NULL, _t('ICP 备案许可证号'), _t('在这里填入一个 ICP 备案许可证号, 留空则不显示.'));
$form->addInput($icpNumber);

Expand Down
3 changes: 3 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
), '', ' - '); ?><?php $this->options->title(); ?></title>
<?php if ($this->options->themeColor) : ?>
<meta name="theme-color" content="<?php $this->options->themeColor(); ?>" />
<?php endif; ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('style.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('highlight.css'); ?>">
<?php $this->header(); ?>
Expand Down

0 comments on commit a89af7e

Please sign in to comment.