Skip to content

Commit

Permalink
html title
Browse files Browse the repository at this point in the history
  • Loading branch information
cbl committed Aug 25, 2020
1 parent f53d8b0 commit 4a6f0d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/DocdressController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ public function show(Request $request, $version, $page = null, $subPage = null)

$title = (new Crawler($content))->filterXPath('//h1');

$config = config("docdress.repos.{$repo}");

return view('docdress::docs', [
'index' => $index,
'title' => $title,
'title' => count($title) ? $title->text() : null,
'content' => $content,
'versions' => config("docdress.repos.{$repo}.versions"),
'currentVersion' => $version,
'theme' => $theme,
'config' => (object) config("docdress.repos.{$repo}"),
'config' => (object) $config,
'repo' => $repo,
]);
}
Expand Down
2 changes: 1 addition & 1 deletion views/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{{ $config['title'] ?? 'Docdress' }}</title>
<title>{{ isset($title) ? $title . ' - ' : null }}{{ $config->title ?? 'Docs' }}</title>

<style>
:root {
Expand Down

0 comments on commit 4a6f0d8

Please sign in to comment.