Skip to content

Commit

Permalink
new feature: github cards
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Oct 24, 2019
1 parent a51ef90 commit a74e1c8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package Sakura
*/

define( 'SAKURA_VERSION', '3.2.6' );
define( 'SAKURA_VERSION', '3.2.7' );
define( 'BUILD_VERSION', '3' );
define( 'JSDELIVR_VERSION', '3.6.7' );

Expand Down Expand Up @@ -183,6 +183,7 @@ function sakura_scripts() {
wp_enqueue_style( 'saukra_css', 'https://cdn.jsdelivr.net/gh/mashirozx/Sakura@' . SAKURA_VERSION . '/style.min.css', array(), SAKURA_VERSION );
wp_enqueue_script( 'app', 'https://cdn.jsdelivr.net/gh/mashirozx/Sakura@' . SAKURA_VERSION . '/js/sakura-app.min.js', array(), SAKURA_VERSION, true );
}
wp_enqueue_script( 'github_card', 'https://cdn.jsdelivr.net/github-cards/latest/widget.js', array(), SAKURA_VERSION, true );

if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
Expand Down Expand Up @@ -1548,6 +1549,18 @@ class="fancybox"
title="$1"><img src="$2" target="_blank" rel="nofollow" class="fancybox"></a>',
$content
);

//Github cards
$content=preg_replace(
'/\[github repo=[\'"]([^\'"]+)[\'"]\]/i',
'
<iframe frameborder="0" scrolling="0" allowtransparency="true"
src="https://api.2heng.xin/github-card/?repo=$1"
width="400" height="153"
style="margin-left: 50%; transform: translateX(-50%);"></iframe>
',
$content
);
}
return $content;
}
Expand Down
2 changes: 1 addition & 1 deletion js/sakura-app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Sakura application bundle theme ver 3.2.0
* Sakura theme application bundle
* @author Mashiro
* @url https://2heng.xin
* @date 2019.8.3
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Theme URI: https://2heng.xin/theme-sakura/
Author: Mashiro, Louie, Fuzzz
Author URI: http://2heng.xin
Description: Akina主题分支(原版地址 http://www.akina.pw/themeakina)
Version: 3.2.4
Version: 3.2.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: akina
Expand Down

0 comments on commit a74e1c8

Please sign in to comment.