diff options
Diffstat (limited to 'resources/views')
-rw-r--r-- | resources/views/components/codeblock.blade.php | 14 | ||||
-rw-r--r-- | resources/views/includes/head-hljs.blade.php | 15 | ||||
-rw-r--r-- | resources/views/layouts/default-hljs.blade.php | 23 |
3 files changed, 52 insertions, 0 deletions
diff --git a/resources/views/components/codeblock.blade.php b/resources/views/components/codeblock.blade.php new file mode 100644 index 0000000..8dcebda --- /dev/null +++ b/resources/views/components/codeblock.blade.php @@ -0,0 +1,14 @@ +@php +$file_path = "code/".$file; +$file_name = basename($file_path); + +$hl = new \Highlight\Highlighter(); + +$highlighted = $hl->highlight($lang, Storage::disk('local')->get($file_path)); +$file_size = Storage::disk('local')->size($file_path); +@endphp +<div class="codeblock"><pre> + <h1>{{ $file_name }} <small>{{ $file_size}} bytes</small></h1> + <hr> + <code class="hljs {{$highlighted->language}}">{!! $highlighted->value !!}</code> +</pre></div> diff --git a/resources/views/includes/head-hljs.blade.php b/resources/views/includes/head-hljs.blade.php new file mode 100644 index 0000000..5011b6e --- /dev/null +++ b/resources/views/includes/head-hljs.blade.php @@ -0,0 +1,15 @@ + <!-- Global --> + <meta charset="utf-8"> + <meta property="og:type" content="website"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="theme-color" content="#333333"> + <link rel="stylesheet" href="{{ URL::asset ('css/master.css') }}"/> + <link rel="stylesheet" href="{{ URL::asset ('css/highlight.js/tomorrow-night-bright.css') }}"/> + <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"/> + <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"/> + + <!-- Page-specific --> + <title>~floppydisk / @yield('title')</title> + <meta property="og:title" content="~floppydisk / @yield('title')"> + <meta property="og:description" content="@yield('description')"> + <meta property="og:image" content="/favicon.png"> diff --git a/resources/views/layouts/default-hljs.blade.php b/resources/views/layouts/default-hljs.blade.php new file mode 100644 index 0000000..a9380b0 --- /dev/null +++ b/resources/views/layouts/default-hljs.blade.php @@ -0,0 +1,23 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> + @include('includes.head-hljs') +</head> + +<body> +<div class="page"> +<div class="header"> + @include('includes.header') +</div> <!-- header --> + +<div id="pagebody"> + <div id="content"> +@yield('content') + </div> <!-- content --> + <div id="footer" class="pagefooter"> + @include('includes.footer') + </div> <!-- footer --> +</div> <!-- pagebody --> +</div> <!-- page --> +</body> +</html> |