This commit is contained in:
xaoxuu 2022-10-29 23:14:28 +08:00
parent a8ca8a9a5b
commit 9a2101ebfc
3 changed files with 17 additions and 17 deletions

View File

@ -66,5 +66,5 @@ welcome:
timeline:
layout: timeline
title: 近期动态
api: https://api.github.com/repos/xaoxuu/hexo-theme-stellar/issues
api: # https://api.github.com/repos/xaoxuu/hexo-theme-stellar/issues
user:

View File

@ -2,28 +2,28 @@
* friends.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
* 格式与官方标签插件一致使用空格分隔中括号内的是可选参数中括号不需要写出来
*
* {% friends [group] [repo:owner/repo] [data:http] %}
* {% friends [group] [repo:owner/repo] [api:http] %}
*/
'use strict';
hexo.extend.tag.register('friends', function(args) {
args = hexo.args.map(args, ['repo', 'data'], ['group']);
args = hexo.args.map(args, ['repo', 'api'], ['group']);
var links = hexo.locals.get('data').links;
if (links == undefined) {
links = {};
}
var data;
if (args.data) {
data = args.data;
var api;
if (args.api) {
api = args.api;
} else if (args.repo) {
data = 'https://raw.github.xaoxuu.com/' + args.repo + '/output/v2/data.json';
api = 'https://raw.github.xaoxuu.com/' + args.repo + '/output/v2/data.json';
}
var el = '<div class="tag-plugin users-wrap">';
if (data) {
if (api) {
el += '<div class="stellar-friends-api"';
el += ' api="' + data + '"';
el += ' api="' + api + '"';
el += '>';
el += '<div class="group-body"></div>';
el += '</div>';

View File

@ -2,28 +2,28 @@
* sites.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
* 格式与官方标签插件一致使用空格分隔中括号内的是可选参数中括号不需要写出来
*
* {% sites [group] [repo:owner/repo] [data:http] %}
* {% sites [group] [repo:owner/repo] [api:http] %}
*/
'use strict';
hexo.extend.tag.register('sites', function(args) {
args = hexo.args.map(args, ['repo', 'data'], ['group']);
args = hexo.args.map(args, ['repo', 'api'], ['group']);
var links = hexo.locals.get('data').links;
if (links == undefined) {
links = {};
}
var data;
if (args.data) {
data = args.data;
var api;
if (args.api) {
api = args.api;
} else if (args.repo) {
data = 'https://raw.github.xaoxuu.com/' + args.repo + '/output/v2/data.json';
api = 'https://raw.github.xaoxuu.com/' + args.repo + '/output/v2/data.json';
}
var el = '<div class="tag-plugin sites-wrap">';
if (data) {
if (api) {
el += '<div class="stellar-sites-api"';
el += ' api="' + data + '"';
el += ' api="' + api + '"';
el += '>';
el += '<div class="group-body"></div>';
el += '</div>';