diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index a1f75dd..0000000 --- a/.eslintrc +++ /dev/null @@ -1,70 +0,0 @@ -{ - "parserOptions": { - "ecmaVersion": 7, - "sourceType": "module", - "ecmaFeatures": {} - }, - "rules": { - "constructor-super": 2, - "for-direction": 2, - "getter-return": 2, - "no-case-declarations": 2, - "no-class-assign": 2, - "no-compare-neg-zero": 2, - "no-cond-assign": 2, - "no-console": 1, - "no-const-assign": 2, - "no-constant-condition": 2, - "no-control-regex": 1, - "no-debugger": 2, - "no-delete-var": 2, - "no-dupe-args": 2, - "no-dupe-class-members": 2, - "no-dupe-keys": 2, - "no-duplicate-case": 2, - "no-empty": 2, - "no-empty-character-class": 2, - "no-empty-pattern": 2, - "no-ex-assign": 2, - "no-extra-boolean-cast": 2, - "no-extra-semi": 2, - "no-fallthrough": 2, - "no-func-assign": 2, - "no-global-assign": 2, - "no-inner-declarations": 2, - "no-invalid-regexp": 2, - "no-irregular-whitespace": 2, - "no-mixed-spaces-and-tabs": 2, - "no-new-symbol": 2, - "no-obj-calls": 2, - "no-octal": 2, - "no-redeclare": 2, - "no-regex-spaces": 2, - "no-self-assign": 2, - "no-sparse-arrays": 2, - "no-this-before-super": 2, - "no-undef": 2, - "no-unexpected-multiline": 2, - "no-unreachable": 2, - "no-unsafe-finally": 2, - "no-unsafe-negation": 2, - "no-unused-labels": 2, - "no-unused-vars": 2, - "no-useless-escape": 1, - "require-yield": 2, - "use-isnan": 2, - "valid-typeof": 2, - "no-duplicate-imports": 2 - }, - "env": { - "node": true, - "browser": true, - "es6": true - }, - "globals": { - "_": false, - "hljs": false, - "Sortable": false, - "Prism": false - } -} \ No newline at end of file diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 5f65a20..0000000 --- a/.prettierignore +++ /dev/null @@ -1,7 +0,0 @@ -.babelrc -README.md -*.pug -*.sass -*.json -*.php - diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 747edfe..0000000 --- a/.prettierrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "arrowParens": "avoid", - "bracketSpacing": true, - "htmlWhitespaceSensitivity": "css", - "insertPragma": false, - "jsxBracketSameLine": false, - "jsxSingleQuote": true, - "proseWrap": "preserve", - "requirePragma": false, - "semi": true, - "singleQuote": true, - "trailingComma": "none", - "useTabs": true, - "tabWidth": 4, - "printWidth": 100 -} \ No newline at end of file diff --git a/brain/controller/DashControl.inc.php b/brain/controller/DashControl.inc.php new file mode 100644 index 0000000..db89ec5 --- /dev/null +++ b/brain/controller/DashControl.inc.php @@ -0,0 +1,18 @@ +getContents(); + break; + } + } +} diff --git a/brain/data/Book.inc.php b/brain/data/Book.inc.php new file mode 100644 index 0000000..ca62c1f --- /dev/null +++ b/brain/data/Book.inc.php @@ -0,0 +1,67 @@ +read($folder); + } + public function read($folder) + { + $folders = glob("$folder/*", GLOB_ONLYDIR); + foreach ($folders as $folder) { + //$this->files[] = $folder . "/"; + $this->read($folder); + } + $files = array_filter(glob("$folder/*md"), "is_file"); + foreach ($files as $file) { + $this->files[] = $file; + } + } + public function getContents() + { + $parser = new Parser(); + $contents = []; + foreach ($this->files as $file) { + $doc = $parser->parse(file_get_contents($file), false); + $meta = $doc->getYAML(); + $page = [ + "id" => $meta["id"], + "uuid" => $meta["uuid"], + "title" => $meta["title"], + "feature" => $meta["feature"], + "path" => $meta["path"], + "layout" => $meta["layout"], + "tags" => $meta["tags"], + "author" => $meta["author"], + "created" => $meta["created"], + "deleted" => $meta["deleted"], + "menu" => $meta["menu"], + "featured" => $meta["featured"], + "published" => $meta["published"], + "slug" => $meta["slug"], + "filePath" => $file, + "content" => $doc->getContent(), + ]; + + //checks for duplicates + $uuid = $meta["uuid"]; + $found = current( + array_filter($contents, function ($item) use ($uuid) { + return isset($item["uuid"]) && $uuid == $item["uuid"]; + }) + ); + + // if uuid is not present, add it + if (!$found) { + array_push($contents, $page); + } + } + + return $contents; + } +} diff --git a/brain/views/default/dash-index.twig b/brain/views/default/dash-index.twig new file mode 100644 index 0000000..7fe2d86 --- /dev/null +++ b/brain/views/default/dash-index.twig @@ -0,0 +1,25 @@ + + + +
+ + +- {{ name }} - is a - {{ occupation }} -
-