upgrade vuepress and evertythin else to latest version

apart from tailwind
This commit is contained in:
Jakob Schrettenbrunner 2020-04-13 22:44:55 +02:00
parent ccebf9cd6c
commit 0d99fbae04
9 changed files with 5511 additions and 4207 deletions

View File

@ -2,7 +2,14 @@ module.exports = {
base: '/',
title: 'Pterodactyl',
description: 'The open-source server management solution.',
ga: 'UA-87324178-1',
plugins: [
['@vuepress/google-analytics', {
ga: 'UA-12345678-9'
},],
['@vuepress/search', {
searchMaxSuggestions: 10
}]
],
configureWebpack: {
serve: {
hot: {

View File

@ -1,8 +1,10 @@
<template>
<div class="theme-container"
<div
class="theme-container"
:class="pageClasses"
@touchstart="onTouchStart"
@touchend="onTouchEnd">
@touchend="onTouchEnd"
>
<Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar" />
<div class="sidebar-mask" @click="toggleSidebar(false)"></div>
<Sidebar :items="sidebarItems" @toggle-sidebar="toggleSidebar">
@ -21,13 +23,13 @@
</template>
<script>
import Vue from 'vue';
import nprogress from 'nprogress';
import Home from './Home.vue';
import Navbar from './Navbar.vue';
import Page from './Page.vue';
import Sidebar from './Sidebar.vue';
import { resolveSidebarItems } from './util';
import Vue from "vue";
import nprogress from "nprogress";
import Home from "./Home.vue";
import Navbar from "./Navbar.vue";
import Page from "./Page.vue";
import Sidebar from "./Sidebar.vue";
import { resolveSidebarItems } from "./util";
export default {
components: { Home, Page, Sidebar, Navbar },
@ -41,9 +43,7 @@
shouldShowNavbar() {
const { themeConfig } = this.$site;
const { frontmatter } = this.$page;
if (
frontmatter.navbar === false ||
themeConfig.navbar === false) {
if (frontmatter.navbar === false || themeConfig.navbar === false) {
return false;
}
return (
@ -75,9 +75,9 @@
const userPageClass = this.$page.frontmatter.pageClass;
return [
{
'no-navbar': ! this.shouldShowNavbar,
'sidebar-open': this.isSidebarOpen,
'no-sidebar': ! this.shouldShowSidebar
"no-navbar": !this.shouldShowNavbar,
"sidebar-open": this.isSidebarOpen,
"no-sidebar": !this.shouldShowSidebar
},
userPageClass
];
@ -85,7 +85,7 @@
},
mounted() {
window.addEventListener('scroll', this.onScroll);
window.addEventListener("scroll", this.onScroll);
// configure progress bar
nprogress.configure({ showSpinner: false });
@ -105,7 +105,7 @@
methods: {
toggleSidebar(to) {
this.isSidebarOpen = typeof to === 'boolean' ? to : ! this.isSidebarOpen;
this.isSidebarOpen = typeof to === "boolean" ? to : !this.isSidebarOpen;
},
// side swipe
onTouchStart(e) {
@ -130,4 +130,6 @@
</script>
<style src="prismjs/themes/prism-tomorrow.css"></style>
<style src="./styles/main.css" lang="postcss"></style>
<style lang="postcss">
@import "./styles/main.css";
</style>

View File

@ -1,16 +1,17 @@
<template>
<header class="nav">
<SidebarButton class="block md:hidden flex-no-shrink" @toggle-sidebar="$emit('toggle-sidebar')"/>
<SidebarButton
class="block md:hidden flex-no-shrink"
@toggle-sidebar="$emit('toggle-sidebar')"
/>
<div class="logo-container">
<router-link :to="$localePath" class="home-link">
<img class="logo"
v-if="$site.themeConfig.logo"
:src="$withBase($site.themeConfig.logo)">
<span class="site-name hidden md:inline"
<img class="logo" v-if="$site.themeConfig.logo" :src="$withBase($site.themeConfig.logo)" />
<span
class="site-name hidden md:inline"
v-if="$siteTitle"
:class="{ 'can-hide': $site.themeConfig.logo }">
{{ $siteTitle }}
</span>
:class="{ 'can-hide': $site.themeConfig.logo }"
>{{ $siteTitle }}</span>
</router-link>
</div>
<div class="w-full">
@ -23,20 +24,12 @@
</template>
<script>
import SidebarButton from './SidebarButton.vue';
import AlgoliaSearchBox from '@AlgoliaSearchBox';
import SearchBox from './SearchBox.vue';
import NavLinks from './NavLinks.vue';
import SidebarButton from "./SidebarButton.vue";
import SearchBox from "./SearchBox.vue";
import NavLinks from "./NavLinks.vue";
export default {
components: { SidebarButton, NavLinks, SearchBox, AlgoliaSearchBox },
computed: {
algolia() {
return this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {};
},
isAlgoliaSearch() {
return this.algolia && this.algolia.apiKey && this.algolia.indexName;
}
}
components: { SidebarButton, NavLinks, SearchBox },
computed: {}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div class="page">
<slot name="top" />
<Content :custom="false"/>
<Content class="content" :custom="false" />
<div class="page-edit">
<div class="edit-link" v-if="editLink">
<a :href="editLink" target="_blank" rel="noopener noreferrer">{{ editLinkText }}</a>
@ -16,7 +16,8 @@
<p class="inner"></p>
<div class="prev">
<span v-if="prev">
<router-link v-if="prev" :to="prev.path">{{ prev.title || prev.path }}</router-link>
<router-link v-if="prev" :to="prev.path">{{ prev.title || prev.path }}</router-link>
</span>
</div>
<div class="next">
@ -30,10 +31,10 @@
</template>
<script>
import { resolvePage, normalize, outboundRE, endingSlashRE } from './util';
import { resolvePage, normalize, outboundRE, endingSlashRE } from "./util";
export default {
props: ['sidebarItems'],
props: ["sidebarItems"],
computed: {
lastUpdated() {
if (this.$page.lastUpdated) {
@ -41,13 +42,13 @@
}
},
lastUpdatedText() {
if (typeof this.$themeLocaleConfig.lastUpdated === 'string') {
if (typeof this.$themeLocaleConfig.lastUpdated === "string") {
return this.$themeLocaleConfig.lastUpdated;
}
if (typeof this.$site.themeConfig.lastUpdated === 'string') {
if (typeof this.$site.themeConfig.lastUpdated === "string") {
return this.$site.themeConfig.lastUpdated;
}
return 'Last Updated';
return "Last Updated";
},
prev() {
const prev = this.$page.frontmatter.prev;
@ -76,16 +77,16 @@
const {
repo,
editLinks,
docsDir = '',
docsBranch = 'master',
docsDir = "",
docsBranch = "master",
docsRepo = repo
} = this.$site.themeConfig;
let path = normalize(this.$page.path);
if (endingSlashRE.test(path)) {
path += 'README.md';
path += "README.md";
} else {
path += '.md';
path += ".md";
}
if (docsRepo && editLinks) {
return this.createEditLink(repo, docsRepo, docsDir, docsBranch, path);
@ -103,13 +104,11 @@
createEditLink(repo, docsRepo, docsDir, docsBranch, path) {
const bitbucket = /bitbucket.org/;
if (bitbucket.test(repo)) {
const base = outboundRE.test(docsRepo)
? docsRepo
: repo;
const base = outboundRE.test(docsRepo) ? docsRepo : repo;
return (
base.replace(endingSlashRE, '') +
base.replace(endingSlashRE, "") +
`/${docsBranch}` +
(docsDir ? '/' + docsDir.replace(endingSlashRE, '') : '') +
(docsDir ? "/" + docsDir.replace(endingSlashRE, "") : "") +
path +
`?mode=edit&spa=0&at=${docsBranch}&fileviewer=file-view-default`
);
@ -120,9 +119,9 @@
: `https://github.com/${docsRepo}`;
return (
base.replace(endingSlashRE, '') +
base.replace(endingSlashRE, "") +
`/edit/${docsBranch}` +
(docsDir ? '/' + docsDir.replace(endingSlashRE, '') : '') +
(docsDir ? "/" + docsDir.replace(endingSlashRE, "") : "") +
path
);
}
@ -140,15 +139,15 @@
function find(page, items, offset) {
const res = [];
items.forEach(item => {
if (item.type === 'group') {
res.push(...item.children || []);
if (item.type === "group") {
res.push(...(item.children || []));
} else {
res.push(item);
}
});
for (let i = 0; i < res.length; i++) {
const cur = res[i];
if (cur.type === 'page' && cur.path === page.path) {
if (cur.type === "page" && cur.path === page.path) {
return res[i + offset];
}
}

View File

@ -11,14 +11,18 @@
@blur="focused = false"
@keyup.enter="go(focusIndex)"
@keyup.up="onUp"
@keyup.down="onDown">
@keyup.down="onDown"
/>
<div class="suggestion-container" v-if="showSuggestions" @mouseleave="unfocus">
<div class="suggestion-padding"></div>
<ul class="suggestions" :class="{ 'align-right': alignRight }">
<li class="suggestion" v-for="(s, i) in suggestions"
<li
class="suggestion"
v-for="(s, i) in suggestions"
:class="{ focused: i === focusIndex }"
@mousedown="go(i)"
@mouseenter="focus(i)">
@mouseenter="focus(i)"
>
<a :href="s.path" @click.prevent>
<span class="page-title">{{ s.title || s.path }}</span>
<span v-if="s.header" class="header">&gt; {{ s.header.title }}</span>
@ -33,18 +37,14 @@
export default {
data() {
return {
query: '',
query: "",
focused: false,
focusIndex: 0
};
},
computed: {
showSuggestions() {
return (
this.focused &&
this.suggestions &&
this.suggestions.length
);
return this.focused && this.suggestions && this.suggestions.length;
},
suggestions() {
const query = this.query.trim().toLowerCase();
@ -55,10 +55,8 @@
const { pages, themeConfig } = this.$site;
const max = themeConfig.searchMaxSuggestions || 5;
const localePath = this.$localePath;
const matches = item => (
item.title &&
item.title.toLowerCase().indexOf(query) > - 1
);
const matches = item =>
item.title && item.title.toLowerCase().indexOf(query) > -1;
const res = [];
for (let i = 0; i < pages.length; i++) {
if (res.length >= max) break;
@ -74,10 +72,12 @@
if (res.length >= max) break;
const h = p.headers[j];
if (matches(h)) {
res.push(Object.assign({}, p, {
path: p.path + '#' + h.slug,
res.push(
Object.assign({}, p, {
path: p.path + "#" + h.slug,
header: h
}));
})
);
}
}
}
@ -94,11 +94,11 @@
methods: {
getPageLocalePath(page) {
for (const localePath in this.$site.locales || {}) {
if (localePath !== '/' && page.path.indexOf(localePath) === 0) {
if (localePath !== "/" && page.path.indexOf(localePath) === 0) {
return localePath;
}
}
return '/';
return "/";
},
onUp() {
if (this.showSuggestions) {
@ -123,7 +123,7 @@
return;
}
this.$router.push(this.suggestions[i].path);
this.query = '';
this.query = "";
this.focusIndex = 0;
},
focus(i) {

View File

@ -1,10 +1,10 @@
@font-face {
font-family: 'et-line';
src:url('../fonts/et-line/et-line.eot');
src:url('../fonts/et-line/et-line.eot?#iefix') format('embedded-opentype'),
url('../fonts/et-line/et-line.woff') format('woff'),
url('../fonts/et-line/et-line.ttf') format('truetype'),
url('../fonts/et-line/et-line.svg#et-line') format('svg');
src:url('./fonts/et-line/et-line.eot');
src:url('./fonts/et-line/et-line.eot?#iefix') format('embedded-opentype'),
url('./fonts/et-line/et-line.woff') format('woff'),
url('./fonts/et-line/et-line.ttf') format('truetype'),
url('./fonts/et-line/et-line.svg#et-line') format('svg');
font-weight: normal;
font-style: normal;
}

View File

@ -118,7 +118,7 @@
@charset 'UTF-8';
/* Slider */
.slick-loading .slick-list {
background: #fff url('../../public/frontpage/loading.svg') center center no-repeat;
background: #fff url('../public/frontpage/loading.svg') center center no-repeat;
}
/* Icons */
@ -127,8 +127,8 @@
font-weight: normal;
font-style: normal;
src: url('../fonts/slick/slick.eot');
src: url('../fonts/slick/slick.eot?#iefix') format('embedded-opentype'), url('../fonts/slick/slick.woff') format('woff'), url('../fonts/slick/slick.ttf') format('truetype'), url('../fonts/slick/slick.svg#slick') format('svg');
src: url('./fonts/slick/slick.eot');
src: url('./fonts/slick/slick.eot?#iefix') format('embedded-opentype'), url('./fonts/slick/slick.woff') format('woff'), url('./fonts/slick/slick.ttf') format('truetype'), url('./fonts/slick/slick.svg#slick') format('svg');
}
/* Arrows */

View File

@ -1,19 +1,20 @@
{
"dependencies": {
"@vuepress/plugin-google-analytics": "^1.0.0-rc.1",
"jquery": "^3.3.1",
"slick-carousel": "^1.8.1",
"vuepress": "^0.14.8"
"vuepress": "^1.4.0"
},
"scripts": {
"build": "./node_modules/vuepress/bin/vuepress.js build",
"watch": "./node_modules/vuepress/bin/vuepress.js dev"
"build": "vuepress build",
"watch": "vuepress dev"
},
"devDependencies": {
"autoprefixer": "^9.0.1",
"cssnano": "^4.0.3",
"lodash": "^4.17.13",
"postcss-import": "^11.1.0",
"precss": "^3.1.2",
"postcss-import": "^12.0.0",
"precss": "^4.0.0",
"tailwindcss": "^0.6.4"
}
}

8822
yarn.lock

File diff suppressed because it is too large Load Diff