- commit
- c08fe08bd5106e8cb6da39dab050af40d8c0a751
- parent
- 7f6ed770e59138235b9abc5262a9e1f5588be185
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2018-10-21 09:15
refactor: pull pathIsFile into Pupupu class
Diffstat
| M | index.php | 14 | +++++++------- |
1 files changed, 7 insertions, 7 deletions
diff --git a/index.php b/index.php
@@ -67,11 +67,6 @@ function shiftHeadings($html, $offset) 67 67 }, $html); 68 68 } 69 6970 -1 function pathIsFile($path)71 -1 {72 -1 return $path === '/_site' || $path === '/_users' || strpos($path, '.') !== false;73 -1 }74 -175 70 function pathDirname($path) 76 71 { 77 72 return implode('/', array_slice(explode('/', $path), 0, -1)); @@ -108,9 +103,14 @@ class Pupupu 108 103 $this->cache = array(); 109 104 } 110 105 -1 106 protected function pathIsFile($path) -1 107 { -1 108 return $path === '/_site' || $path === '/_users' || strpos($path, '.') !== false; -1 109 } -1 110 111 111 protected function getSrc($path, $ext) 112 112 {113 -1 if (pathIsFile($path)) {-1 113 if ($this->pathIsFile($path)) { 114 114 return $this->srcDir . '/_content' . $path . '.' . $ext; 115 115 } else { 116 116 return $this->srcDir . '/_content' . $path . '/index' . '.' . $ext; @@ -119,7 +119,7 @@ class Pupupu 119 119 120 120 protected function getTarget($path) 121 121 {122 -1 if (pathIsFile($path)) {-1 122 if ($this->pathIsFile($path)) { 123 123 return $this->targetDir . $path; 124 124 } else { 125 125 return $this->targetDir . $path . '/index.html';