LogoNavigate back to the homepage

VuePress integrates into Laravel

November 20th, 2019 · 1 min read

I assume you can build VuePress standalone, so you know VuePress is compiled by node.js and it generated .html file in dist by default. We can use this feature to integrate into Laravel.


* You have been installed VuePress in your Laravel project.

1$ yarn add -D vuepress

First of all, you have to set .vuepress/config.js, docs , the meaning is your compiled files where do you want to put it, and set your base uri.

1dest: 'public/docs',
2base: '/docs/',

Secondly, you need to tell Laravel where can you get its path in config/view.php

1'paths' => [
2 resource_path('views'),
3 base_path('public'), // for docs.

Thirdly, you can writing closure or controller putting the code.

1Route::get('/docs', 'DocumentController@render');
3public function render()
5 // Extending view can recognize `html` file.
6 View::addExtension('html', 'php');
8 // public/docs/index.html.
9 return view('docs.index');

More articles from Yish

A day in the life of an engineer and what tooling do I use for my work?

This article is showing my schedule daily, my job is programming for web services and data structure, also I’m going to show you about my tooling and service to assist my work.

May 2nd, 2020 · 1 min read

Notion 與 Bear 的完美協作

去年年初,我寫了一篇從 notion 又回到 bear 的文章 ,經過一年使用情境與準確定位兩個優秀產品,現在我完美的把兩個工具整合並融入到工作和生活中,以下是我的分析與使用情境。

April 28th, 2020 · 1 min read
© 2019–2020 Yish
Link to $https://twitter.com/yishlaiLink to $https://github.com/Mombuyish