Skip to content

Commit

Permalink
Separate config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
khang-nd committed Sep 3, 2024
1 parent 9d1d207 commit 4d055eb
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 146 deletions.
2 changes: 1 addition & 1 deletion src/.vuepress/components/GFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</template>

<script>
import links from "../links";
import links from "../config/links";
export default {
data() {
Expand Down
148 changes: 3 additions & 145 deletions src/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,106 +1,13 @@
const links = require("./links");
const { defineConfig } = require("vuepress/config");

module.exports = defineConfig({
title: "Visnalize",

head: [
["link", { rel: "icon", href: "/assets/favicon.png" }],
[
"meta",
{ name: "viewport", content: "width=device-width, initial-scale=1.0" },
],
[
"script",
{
async: true,
"data-ad-client": "ca-pub-5904323684803247",
src: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
},
],
[
"script",
{
async: true,
src: "https://www.googletagmanager.com/gtag/js?id=G-TRC2SF4L67",
},
],
[
"script",
{},
"window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-TRC2SF4L67');",
],
[
"script",
{
async: true,
src: "https://fundingchoicesmessages.google.com/i/pub-5904323684803247?ers=1",
nonce: "3HRDcENAr3Egc7skT36mnQ",
},
],
[
"script",
{ nonce: "3HRDcENAr3Egc7skT36mnQ" },
"(function () { function signalGooglefcPresent() { if (!window.frames['googlefcPresent']) { if (document.body) { const iframe = document.createElement('iframe'); iframe.style = 'width: 0; height: 0; border: none; z-index: -1000; left: -1000px; top: -1000px;'; iframe.style.display = 'none'; iframe.name = 'googlefcPresent'; document.body.appendChild(iframe); } else { setTimeout(signalGooglefcPresent, 0); } } } signalGooglefcPresent(); })();",
],
],
head: require("./config/head"),

themeConfig: {
logo: "/assets/favicon.png",
nav: [
{
text: "💻 Win7 Simu",
items: [
{ text: "About", link: "/win7simu/about" },
{ text: "Changelog", link: "/win7simu/changelog" },
{ text: "FAQs", link: "/win7simu/faq" },
{ text: "Privacy Policy", link: "/win7simu/privacy" },
{
text: "Guides",
items: [
{
text: "Simulated apps",
link: "/win7simu/simulated/",
},
{
text: "Theme Studio",
link: "/win7simu/themestudio/",
},
],
},
],
},
{
text: "📵 Brick 1100",
items: [
{ text: "About", link: "/brick1100/about" },
{ text: "Changelog", link: "/brick1100/changelog" },
{ text: "Privacy Policy", link: "/brick1100/privacy" },
{
text: "Guides",
items: [
{
text: "Games",
link: "/brick1100/games",
},
{
text: "Deep Links",
link: "/brick1100/deep-links",
},
],
},
],
},
{ text: "📝 Blog", link: "/blog/" },
{ text: "🙋‍♂️ About", link: "/about" },
{
text: "🌏 Social",
items: Object.values(links).map((link) => ({
text: link.alt,
link: link.href,
})),
},
],
nav: require("./config/navbar"),
sidebar: {
"/win7simu/themestudio/": [
["", "Introduction"],
Expand All @@ -115,56 +22,7 @@ module.exports = defineConfig({
lastUpdated: true,
},

plugins: [
[
"@vuepress/blog",
{
sitemap: {
hostname: "https://visnalize.com",
},
feed: {
canonical_base: "https://visnalize.com",
},
frontmatters: [
{
id: "tag",
keys: ["tag", "tags"],
path: "/blog/tag/",
layout: "BlogList",
scopeLayout: "BlogList",
},
],
},
],
[
"autometa",
{
canonical_base:
process.env.NODE_ENV === "development"
? "http://localhost:8080"
: "https://visnalize.com",
author: { name: "Visnalize" },
},
],
[
"canonical",
{
baseURL: "https://visnalize.com",
},
],
[
"social-share",
{
noGlobalSocialShare: true,
isPlain: true,
twitterUser: "visnalize",
networks: ["twitter", "facebook", "reddit", "telegram"],
},
],
["disqus", { shortname: "visnalize" }],
["text-to-speech"],
["first-created"],
],
plugins: require("./config/plugins"),

markdown: {
extendMarkdown: (md) => {
Expand Down
42 changes: 42 additions & 0 deletions src/.vuepress/config/head.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const head = [
["link", { rel: "icon", href: "/assets/favicon.png" }],
[
"meta",
{ name: "viewport", content: "width=device-width, initial-scale=1.0" },
],
[
"script",
{
async: true,
"data-ad-client": "ca-pub-5904323684803247",
src: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
},
],
[
"script",
{
async: true,
src: "https://www.googletagmanager.com/gtag/js?id=G-TRC2SF4L67",
},
],
[
"script",
{},
"window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-TRC2SF4L67');",
],
[
"script",
{
async: true,
src: "https://fundingchoicesmessages.google.com/i/pub-5904323684803247?ers=1",
nonce: "3HRDcENAr3Egc7skT36mnQ",
},
],
[
"script",
{ nonce: "3HRDcENAr3Egc7skT36mnQ" },
"(function () { function signalGooglefcPresent() { if (!window.frames['googlefcPresent']) { if (document.body) { const iframe = document.createElement('iframe'); iframe.style = 'width: 0; height: 0; border: none; z-index: -1000; left: -1000px; top: -1000px;'; iframe.style.display = 'none'; iframe.name = 'googlefcPresent'; document.body.appendChild(iframe); } else { setTimeout(signalGooglefcPresent, 0); } } } signalGooglefcPresent(); })();",
],
];

module.exports = head;
File renamed without changes.
58 changes: 58 additions & 0 deletions src/.vuepress/config/navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const links = require("./links");

const navbar = [
{
text: "💻 Win7 Simu",
items: [
{ text: "About", link: "/win7simu/about" },
{ text: "Changelog", link: "/win7simu/changelog" },
{ text: "FAQs", link: "/win7simu/faq" },
{ text: "Privacy Policy", link: "/win7simu/privacy" },
{
text: "Guides",
items: [
{
text: "Simulated apps",
link: "/win7simu/simulated/",
},
{
text: "Theme Studio",
link: "/win7simu/themestudio/",
},
],
},
],
},
{
text: "📵 Brick 1100",
items: [
{ text: "About", link: "/brick1100/about" },
{ text: "Changelog", link: "/brick1100/changelog" },
{ text: "Privacy Policy", link: "/brick1100/privacy" },
{
text: "Guides",
items: [
{
text: "Games",
link: "/brick1100/games",
},
{
text: "Deep Links",
link: "/brick1100/deep-links",
},
],
},
],
},
{ text: "📝 Blog", link: "/blog/" },
{ text: "🙋‍♂️ About", link: "/about" },
{
text: "🌏 Social",
items: Object.values(links).map((link) => ({
text: link.alt,
link: link.href,
})),
},
];

module.exports = navbar;
52 changes: 52 additions & 0 deletions src/.vuepress/config/plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const plugins = [
[
"@vuepress/blog",
{
sitemap: {
hostname: "https://visnalize.com",
},
feed: {
canonical_base: "https://visnalize.com",
},
frontmatters: [
{
id: "tag",
keys: ["tag", "tags"],
path: "/blog/tag/",
layout: "BlogList",
scopeLayout: "BlogList",
},
],
},
],
[
"autometa",
{
canonical_base:
process.env.NODE_ENV === "development"
? "http://localhost:8080"
: "https://visnalize.com",
author: { name: "Visnalize" },
},
],
[
"canonical",
{
baseURL: "https://visnalize.com",
},
],
[
"social-share",
{
noGlobalSocialShare: true,
isPlain: true,
twitterUser: "visnalize",
networks: ["twitter", "facebook", "reddit", "telegram"],
},
],
["disqus", { shortname: "visnalize" }],
["text-to-speech"],
["first-created"],
];

module.exports = plugins;

0 comments on commit 4d055eb

Please sign in to comment.