Skip to content

Commit

Permalink
Restore special files (timeline, sitemap, ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
cavo789 committed Sep 12, 2017
1 parent aa1892f commit 3204e95
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/marknotes/plugins/markdown/clean_code.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
* ------ ----------
* “ `
* ” `
* ‘ `
* ’ `
*
* 2. replace non breaking spaces introduced by Pandoc when the .md file
* is the result of a conversion from .docx to .md
Expand Down Expand Up @@ -52,8 +50,6 @@ public static function readMD(&$params = null)
// 1. Replace characters
$tmp=str_replace('', '`', $tmp);
$tmp=str_replace('', '`', $tmp);
$tmp=str_replace('', '`', $tmp);
$tmp=str_replace('', '`', $tmp);

/*<!-- build:debug -->*/
if ($aeSettings->getDevMode()) {
Expand Down
2 changes: 1 addition & 1 deletion src/marknotes/plugins/task/sitemap/sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private static function getFiles() : array
// Be carefull, folders / filenames perhaps contains accentuated characters
$arrFiles = array_map('utf8_encode', $arrFiles);

if ($bOptimize)) {
if ($bOptimize) {
$aeSession->set('Sitemap', json_encode($arrFiles));
}
} // if (count($arrFiles)==0)
Expand Down
9 changes: 6 additions & 3 deletions src/marknotes/plugins/task/tags/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,14 @@ public static function run(&$params = null)
if ($aeFiles->fileExists($fname = $aeSettings->getFolderWebRoot().'tags.json')) {
$aeJSON = \MarkNotes\JSON::getInstance();
if (filesize($fname) > 0) {

$arrTags = $aeJSON->json_decode($fname, true);

foreach ($arrTags as $tag) {
$arr[] = $tag;
}
if (count($arrTags)>0) {
foreach ($arrTags as $tag) {
$arr[] = $tag;
}
}
}
}

Expand Down
9 changes: 7 additions & 2 deletions src/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@
$filename = substr($filename, strlen($docRoot));
}

$filename=$aeFiles->removeExtension($filename).'.md';
// Very special files
$arrSpecialFiles=array('tag.json', 'timeline.html', 'timeline.json', 'sitemap.xml');

if (!in_array($filename, $arrSpecialFiles)) {
$filename=$aeFiles->removeExtension($filename).'.md';
}

$full=$aeSettings->getFolderDocs(true).$filename;

Expand All @@ -93,7 +98,7 @@
$format = 'index';
$fileMD = $filename;

} elseif (in_array($filename, array('tag.json', 'timeline.html', 'timeline.json', 'sitemap.xml'))) {
} elseif (in_array($filename, $arrSpecialFiles)) {
// Specific files
$aeFiles = \MarkNotes\Files::getInstance();

Expand Down

0 comments on commit 3204e95

Please sign in to comment.