From ad76f6fb7a58e5a08f99edff3e64d3254ce7d86c Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 7 Nov 2015 18:20:17 +1300 Subject: [PATCH] config flag "shields_prefix" to add a "build:success" shield to everything --- rebuild.php | 10 ++++++++-- sites/code.ivysaur.me/config.ini | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rebuild.php b/rebuild.php index aed5874..56518be 100644 --- a/rebuild.php +++ b/rebuild.php @@ -209,7 +209,12 @@ class CProject { // Filter longdesc $this->longdesc = preg_replace_callback('~Written in ([^\\r\\n]+)~', function($matches) { - return ''.mkshield('written in', $matches[1], 'blue').''; + return ( + ''. + (SHIELDS_PREFIX ? mkshield('build', 'success', 'brightgreen').' ' : ''). + mkshield('written in', $matches[1], 'blue'). + '' + ); }, $this->longdesc); continue; @@ -539,7 +544,8 @@ function main($args) { define('INDEX_THUMB_W', intval($config['codesite']['index_thumb_w'])); define('INDEX_THUMB_H', intval($config['codesite']['index_thumb_h'])); define('SHOW_BLURBS', !(isset($config['codesite']['blurbs']) && $config['codesite']['blurbs'] === 'off') ); - define('ARTICLE_HEADER', (isset($config['codesite']['article_header']) ? $config['codesite']['article_header'] : 'ABOUT') ); + define('ARTICLE_HEADER', (isset($config['codesite']['article_header']) ? $config['codesite']['article_header'] : 'ABOUT') ); + define('SHIELDS_PREFIX', isset($config['codesite']['shields_prefix'])); // Perform build tasks diff --git a/sites/code.ivysaur.me/config.ini b/sites/code.ivysaur.me/config.ini index 9be1605..f0d7d34 100644 --- a/sites/code.ivysaur.me/config.ini +++ b/sites/code.ivysaur.me/config.ini @@ -5,6 +5,8 @@ page_thumb_h=60 index_thumb_w=90 index_thumb_h=32 +shields_prefix=true + ; n.b. Recommend a multiple of the JPEG iDCT block size for index_thumb_h [redirect]