typecho怎么引入js ?
发表于 : 2018年 11月 23日 16:42
我想把这个jshttps://github.com/audiocogs/flac.js/releases
引入到我的typecho博客。我不知道怎么做。我对编程一窍不通。
有人能把它做成一个插件吗? 这样最好了
引入到我的typecho博客。我不知道怎么做。我对编程一窍不通。
有人能把它做成一个插件吗? 这样最好了
weing104 写了:script src
代码: 全选
<?php
/**
* 在网页的顶部或者底部添加 HTML
*
* @package ResourceQuote
* @author zgcwkj
* @version 1.0.0
* @link http://blog.zgcwkj.top
*/
class ResourceQuote_Plugin implements Typecho_Plugin_Interface
{
/**
* 激活插件方法,如果激活失败,直接抛出异常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
//顶部引用
Typecho_Plugin::factory('Widget_Archive')->header = array('ResourceQuote_Plugin', 'header');
//底部引用
Typecho_Plugin::factory('Widget_Archive')->footer = array('ResourceQuote_Plugin', 'footer');
}
/**
* 禁用插件方法,如果禁用失败,直接抛出异常
*
* @static
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function deactivate(){}
/**
* 获取插件配置面板
*
* @access public
* @param Typecho_Widget_Helper_Form $form 配置面板
* @return void
*/
public static function config(Typecho_Widget_Helper_Form $form)
{
$header_html = new Typecho_Widget_Helper_Form_Element_Textarea('header_html', NULL, NULL, '顶部引用', '顶部资源引用');
$form->addInput($header_html);
$footer_html = new Typecho_Widget_Helper_Form_Element_Textarea('footer_html', NULL, NULL, '底部引用', '底部资源引用');
$form->addInput($footer_html);
}
/**
* 个人用户的配置面板
*
* @access public
* @param Typecho_Widget_Helper_Form $form
* @return void
*/
public static function personalConfig(Typecho_Widget_Helper_Form $form){}
/**
* 输出头部css
*
* @access public
* @return void
*/
public static function header()
{
$options = Typecho_Widget::widget('Widget_Options')->plugin('ResourceQuote');
$header_html = !empty($options->header_html) ? $options->header_html : '';
echo <<<EOF
{$header_html}
EOF;
}
/**
* 输出底部
*
* @access public
* @return void
*/
public static function footer()
{
$options = Typecho_Widget::widget('Widget_Options')->plugin('ResourceQuote');
$footer_html = !empty($options->footer_html) ? $options->footer_html : '';
echo <<<EOF
{$footer_html}
EOF;
}
}
代码: 全选
<link rel="stylesheet" href="index.css">
代码: 全选
<script src="index.js">
asleep 写了:我想把这个jshttps://github.com/audiocogs/flac.js/releases
引入到我的typecho博客。我不知道怎么做。我对编程一窍不通。
有人能把它做成一个插件吗? 这样最好了
asleep 写了:我想把这个jshttps://github.com/audiocogs/flac.js/releases
引入到我的typecho博客。我不知道怎么做。我对编程一窍不通。
有人能把它做成一个插件吗? 这样最好了