Skip to content

Commit 23c509f

Browse files
committed
Added localized posts support.
1 parent 4e363cd commit 23c509f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

helpers/index/content.php

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
<?php
22

3-
return function($post) {
3+
$pages = path(['PAGES'], true);
4+
5+
return function($post) use($pages) {
6+
if(defined('LOCALE')) {
7+
$path = substr($post['path'], strlen($pages));
8+
$locale = path(['LOCALES', LOCALE['LANGUAGE']], true);
9+
10+
if(is_file($path = "{$locale}{$path}")) {
11+
$post['path'] = $path;
12+
}
13+
}
14+
415
$post['content'] = file_get_contents($post['path']);
516
$token = strtok($post['content'], "\n");
617

0 commit comments

Comments
 (0)