Skip to content

Commit

Permalink
Merge pull request #25 from dniccum/bugfix/documentation-files-not-found
Browse files Browse the repository at this point in the history
Bugfix/documentation files not found
  • Loading branch information
dniccum authored Feb 21, 2023
2 parents b655e9a + 26fa4cc commit 2fc7044
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dist/css/tool.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/github.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/githubDark.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/gradient.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/tool.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"/js/tool.js": "/js/tool.js",
"/atomDark.js": "/atomDark.js?id=691d942a29545fff8a97",
"/atom.js": "/atom.js?id=478b410e73c131bb6882",
"/monokai.js": "/monokai.js?id=de008b5d91ac38a7a957",
"/gradientDark.js": "/gradientDark.js?id=68668026d76345a4018f",
"/gradient.js": "/gradient.js?id=84c1abec9a0f03437b7b",
"/githubDark.js": "/githubDark.js?id=49e50a33a7fd19ada5be",
"/github.js": "/github.js?id=1fc0f2645c38c947e3df",
"/atomDark.js": "/atomDark.js?id=8e8e9a36d05f057438a5",
"/atom.js": "/atom.js?id=c31a1ac1955d918e9e95",
"/monokai.js": "/monokai.js?id=d7bb0d9d0aa3421604fa",
"/gradientDark.js": "/gradientDark.js?id=f87d1ae84d66987c4ebd",
"/gradient.js": "/gradient.js?id=e9c462f8f4175b882c55",
"/githubDark.js": "/githubDark.js?id=099190303503e8a8787a",
"/github.js": "/github.js?id=b3821e587eab01a8ac70",
"/css/tool.css": "/css/tool.css"
}
7 changes: 4 additions & 3 deletions resources/js/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
methods: {
textClass(item) {
if (this.$page.url.endsWith(item.route) || item.isHome && this.$page.url.endsWith('documentation')) {
if ((item.route.length > 0 && this.$page.url.endsWith(item.route)) || item.isHome && this.$page.url.endsWith('documentation')) {
return 'doc-text-primary-500 hover:doc-text-primary-700';
} else {
return 'doc-text-gray-300 dark:doc-text-gray-100 hover:doc-text-primary-200';
Expand All @@ -35,10 +35,11 @@
const { route, isHome } = item;
const basePath = Nova.config('base');
const urlPrfix = Nova.config('urlPrefix');
const root = `${basePath}/${urlPrfix}`;
if (isHome) {
return `${basePath}/${urlPrfix}`;
return root;
}
return `${basePath}/${urlPrfix}/${route}`;
return `${root}${route}`;
}
}
}
Expand Down
11 changes: 8 additions & 3 deletions src/Library/Contracts/DocumentationPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,21 @@ public function __construct($file, string $route, PageContent $content, bool $is
$this->content = $this->replaceLinks($content->content);
$this->isHome = $isHome;

if ($content->path) {
$this->route = $content->path;
if ($this->isHome) {
$this->route = "";
} else {
$this->route = "/documentation/$route";
if ($content->path) {
$this->route = $content->path;
} else {
$this->route = "/$route";
}
}
if ($content->title) {
$this->title = $content->title;
$this->pageTitle = $content->title;
} else {
$this->pageTitle = $this->getPageTitle($file);
$this->title = $this->pageTitle;
}
if ($content->order) {
$this->order = $content->order;
Expand Down
2 changes: 1 addition & 1 deletion src/Library/RouteUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function buildDocumentRoute(mixed $fileToParse, array $pageRoutes)
$utility = new MarkdownUtility();
$file = \File::get($fileToParse);
$content = $utility->parse($file);
$content = new DocumentationPage($file, '', $content);
$content = new DocumentationPage($fileToParse, '', $content);

return inertia('Documentation',
array_merge([
Expand Down
2 changes: 1 addition & 1 deletion src/ToolServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function routes()
}

Route::middleware(['nova', Authorize::class])
->prefix('nova-vendor/nova-documentation')
->prefix('nova/'.$this->prefix)
->group(__DIR__.'/../routes/inertia.php');
}

Expand Down

0 comments on commit 2fc7044

Please sign in to comment.