Skip to content

Commit

Permalink
@mecha-cms/genome/engine/kernel/genome.php
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Dec 2, 2017
1 parent 3ed5335 commit c8cb7cf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tag/about.page
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ description: Page tags.
author: Taufik Nurrohman
type: Markdown
version: 1.5.0
dependency: {"extension":["page"]}

dependency:
extension:
- page
...

This extension enables tags feature on any pages by utilizing the `kind` property value as the tag ID. This extension also adds a new route definition like `http://localhost/blog/tag/slug` on every pages to make it possible to list all pages in the current folder by tags.
Expand Down
2 changes: 1 addition & 1 deletion tag/engine/plug/from.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

From::plug('tag', function($slug, $fail = false) {
From::_('tag', function($slug, $fail = false) {
if (!is_string($slug)) return $fail;
$f = TAG . DS . $slug . DS . 'id.data';
if (!file_exists($f)) return $fail;
Expand Down
2 changes: 1 addition & 1 deletion tag/engine/plug/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ function fn_get_tags($folder = TAG, $state = 'page', $sort = [1, 'id'], $key = n
return call_user_func('fn_get_pages', $folder, $state, $sort, $key);
}

Get::plug('tags', 'fn_get_tags');
Get::_('tags', 'fn_get_tags');
2 changes: 1 addition & 1 deletion tag/engine/plug/to.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

To::plug('tag', function($id, $fail = false) {
To::_('tag', function($id, $fail = false) {
if (!is_int($id)) return $fail;
foreach (glob(TAG . DS . '*' . DS . 'id.data') as $v) {
if ((int) file_get_contents($v) === $id) {
Expand Down

0 comments on commit c8cb7cf

Please sign in to comment.