Added DocSearch for documentation
This commit is contained in:
1 parent
193e7533c7
commit
1fbb9cf2fd
7 files changed
+39
-11
No files matched your search
@@ -0,0 +1,3 @@
|
||||
VITE_APP_ALGOLIA_APP_ID=
|
||||
VITE_APP_ALGOLIA_API_KEY=
|
||||
VITE_APP_ALGOLIA_INDEX_NAME=
|
||||
@@ -8,6 +8,7 @@ docs/ export-ignore
|
||||
excludes/ export-ignore
|
||||
|
||||
.editorconfig export-ignore
|
||||
.env.example export-ignore
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ name: docs
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- generate-docs
|
||||
types:
|
||||
- generate-docs
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
handle-dispatch:
|
||||
@@ -35,11 +35,14 @@ jobs:
|
||||
${{ runner.os }}-npm-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.npm-cache.outputs.cache-hit != 'true'
|
||||
run: npm i
|
||||
|
||||
- name: Build VuePress site
|
||||
run: npm run build
|
||||
env:
|
||||
VITE_APP_ALGOLIA_APP_ID: ${{ secrets.VITE_APP_ALGOLIA_APP_ID }}
|
||||
VITE_APP_ALGOLIA_API_KEY: ${{ secrets.VITE_APP_ALGOLIA_API_KEY }}
|
||||
VITE_APP_ALGOLIA_INDEX_NAME: ${{ secrets.VITE_APP_ALGOLIA_INDEX_NAME }}
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: crazy-max/ghaction-github-pages@v2
|
||||
|
||||
@@ -6,6 +6,7 @@ vendor/
|
||||
|
||||
.cache
|
||||
.DS_Store
|
||||
.env
|
||||
.php_cs.cache
|
||||
.phpintel
|
||||
.temp
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
.cache/
|
||||
.temp/
|
||||
|
||||
dist/
|
||||
@@ -1,6 +1,10 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
require('dotenv').config();
|
||||
|
||||
const hostname = 'laravel-lang.com';
|
||||
|
||||
module.exports = {
|
||||
lang: 'en-US',
|
||||
title: 'Laravel Lang',
|
||||
@@ -8,11 +12,12 @@ module.exports = {
|
||||
|
||||
head: [
|
||||
['link', { rel: 'icon', href: '/images/logo.svg' }],
|
||||
['meta', { name: 'twitter:image', content: 'https://laravel-lang.com/images/social-logo.png' }]
|
||||
['meta', { name: 'twitter:image', content: `https://${ hostname }/images/social-logo.png` }]
|
||||
],
|
||||
|
||||
theme: '@vuepress/theme-default',
|
||||
themeConfig: {
|
||||
hostname,
|
||||
base: '/',
|
||||
|
||||
logo: '/images/logo.svg',
|
||||
@@ -88,7 +93,15 @@ module.exports = {
|
||||
description: $page => $page.frontmatter.description,
|
||||
type: _ => 'website',
|
||||
image: (_, $site) => $site.domain + '/images/social-logo.png'
|
||||
}
|
||||
},
|
||||
[
|
||||
'@vuepress/docsearch',
|
||||
{
|
||||
appId: process.env.VITE_APP_ALGOLIA_APP_ID,
|
||||
apiKey: process.env.VITE_APP_ALGOLIA_API_KEY,
|
||||
indexName: process.env.VITE_APP_ALGOLIA_INDEX_NAME
|
||||
}
|
||||
]
|
||||
]
|
||||
]
|
||||
};
|
||||
@@ -118,7 +131,7 @@ function getChildren(folder, sort = 'asc') {
|
||||
}
|
||||
|
||||
function resolveNumeric(value) {
|
||||
const sub = value.substr(0, value.indexOf('.'));
|
||||
const sub = value.substring(0, value.indexOf('.'));
|
||||
|
||||
const num = Number(sub);
|
||||
|
||||
|
||||
+6
-3
@@ -9,7 +9,7 @@
|
||||
"url": "https://github.com/Laravel-Lang/lang/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vuepress dev docs",
|
||||
"dev": "vuepress dev docs --debug",
|
||||
"build": "vuepress build docs"
|
||||
},
|
||||
"repository": {
|
||||
@@ -20,8 +20,11 @@
|
||||
"docs"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@vuepress/plugin-theme-data": "^2.0.0-beta.33",
|
||||
"vuepress": "^2.0.0-beta.33",
|
||||
"@vuepress/plugin-docsearch": "^2.0.0-beta.35",
|
||||
"@vuepress/plugin-theme-data": "^2.0.0-beta.35",
|
||||
"@vueuse/core": "^7.5.5",
|
||||
"dotenv": "^15.0.0",
|
||||
"vuepress": "^2.0.0-beta.35",
|
||||
"vuepress-plugin-seo": "^0.2.0"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user