diff --git a/rebuild.php b/rebuild.php index b980b8c..09753e1 100644 --- a/rebuild.php +++ b/rebuild.php @@ -124,6 +124,7 @@ class CProject { private $longdesc = ''; private $images = array(); private $downloads = array(); + public $tags = array(); public $homeimage = null; @@ -144,6 +145,10 @@ class CProject { $this->subtag = rtrim($matches[1], ' .'); } + if (preg_match('~Tags: ([^\\r\\n]+)~', $this->longdesc, $matches)) { + $this->tags = array_map('trim', explode(',', $matches[1])); + } + $this->shortdesc = array_shift(explode("\n", $this->longdesc)); $this->shortdesc[0] = strtolower($this->shortdesc[0]); // cosmetic lowercase continue; @@ -190,6 +195,14 @@ class CProject { file_put_contents(BASEDIR.'wwwroot/'.$this->projname.'.html', $idxfile); } + public function getClassAttr() { + if (count($this->tags)) { + return 'taggedWith-'.implode(' taggedWith-', $this->tags); + } else { + return ''; + } + } + public function index() { ?>
=(is_null($handle_lookup[$pr->projname]) ? '' : '')?> | @@ -330,9 +343,17 @@ function buildall() { =hesc($pr->projname)?>, =hesc($pr->shortdesc)?> more... - subtag)) { ?> + subtag) || count($pr->tags)) { ?>