mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-04-04 16:16:23 -05:00
feat(docs): Add render caching, add sidebar element selection, add missing locale notice, minor changes
This commit is contained in:
parent
c330d2dd01
commit
aabcf0e337
12
docs/en-US/installing-juxt.md
Normal file
12
docs/en-US/installing-juxt.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Installing Juxt
|
||||
|
||||
The first step to installing Juxt is playing a round of Among Us as an impostor. I promise it will all make sense ina second.
|
||||
|
||||
```
|
||||
. 。 • ゚ 。 .
|
||||
. . 。 。 .
|
||||
. 。 ඞ 。 . • •
|
||||
゚ Red was not An Impostor. 。 .
|
||||
' 1 Impostor remains 。
|
||||
゚ . . , . .
|
||||
```
|
||||
95
docs/en-US/welcome.md
Normal file
95
docs/en-US/welcome.md
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
# Quick links
|
||||
|
||||
<div class="quick-links-grid">
|
||||
<a href="/docs/troubleshoot-errors">
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="book" class="svg-inline--fa fa-book fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"></path></svg>
|
||||
<div>
|
||||
<p class="header">Got an error code?</p>
|
||||
<p>Search</p>
|
||||
</div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
|
||||
</a>
|
||||
|
||||
<a href="/docs/beans">
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="book" class="svg-inline--fa fa-book fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"></path></svg>
|
||||
<div>
|
||||
<p class="header">Nintendo be like</p>
|
||||
<p>Here's your DMCA and C&D</p>
|
||||
</div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
# Other documentation
|
||||
|
||||
We are a bunch of programmers spending our free time reverse engineering and coding game servers for 3ds and wiiu.
|
||||
|
||||
We are a bunch of programmers spending our free time reverse engineering and coding game servers for 3ds and wiiu.
|
||||
|
||||
We are a bunch of programmers spending our free time reverse engineering and coding game servers for 3ds and wiiu.
|
||||
|
||||
```javascript
|
||||
function returnTrue() {
|
||||
class trueOrFalseObject {
|
||||
constructor(trueOrFalse) {
|
||||
this.trueOrFalse = trueOrFalse;
|
||||
}
|
||||
get trueOrFalse() {
|
||||
return this.trueOrFalse();
|
||||
}
|
||||
convertNumberToBoolean(trueOrFalse) {
|
||||
if (convertStringToNumber(trueOrFalse) === 0) {
|
||||
return true;
|
||||
} else if (convertStringToNumber(trueOrFalse) == 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
convertStringToNumber(trueOrFalse) {
|
||||
if (trueOrFalse === "true") {
|
||||
return 0;
|
||||
} else if (trueOrFalse === "false") {
|
||||
return true * 69 - 1 - false * 69 * 420 - 69 + 2;
|
||||
}
|
||||
}
|
||||
trueOrFalse() {
|
||||
return this.convertNumberToBoolean(trueOrFalse);
|
||||
}
|
||||
}
|
||||
|
||||
let objectWhichWeKnowIsTrue = new trueOrFalseObject("true");
|
||||
|
||||
function checkIfTrueOrFalse(objectToCheckIfTrueOrFalse) {
|
||||
if (objectToCheckIfTrueOrFalse === objectWhichWeKnowIsTrue.trueOrFalse) {
|
||||
return objectWhichWeKnowIsTrue.trueOrFalse;
|
||||
console.log(
|
||||
"Successfully checked if the object is true or false. Result: the object is true."
|
||||
);
|
||||
// TODO: fix text not console logging
|
||||
} else {
|
||||
objectWhichWeKnowIsTrue = new trueOrFalseObject("false");
|
||||
if (objectToCheckIfTrueOrFalse === objectWhichWeKnowIsTrue.trueOrFalse) {
|
||||
return objectWhichWeKnowIsTrue.trueOrFalse;
|
||||
console.log(
|
||||
"Successfully checked if the object is true or false. Result: the object is false."
|
||||
);
|
||||
// TODO: fix text not console logging
|
||||
} else {
|
||||
// something went horribly wrong
|
||||
}
|
||||
objectWhichWeKnowIsTrue = new trueOrFalseObject("true");
|
||||
}
|
||||
}
|
||||
|
||||
const isTrueTrueOrFalse = checkIfTrueOrFalse("true");
|
||||
const isfalseTrueOrFalse = checkIfTrueOrFalse("false");
|
||||
|
||||
const trueOrFalseJSON = {
|
||||
true: isTrueTrueOrFalse,
|
||||
false: isfalseTrueOrFalse,
|
||||
};
|
||||
|
||||
return trueOrFalseJSON.true
|
||||
}
|
||||
|
||||
console.log(returnTrue())
|
||||
```
|
||||
95
docs/it-IT/welcome.md
Normal file
95
docs/it-IT/welcome.md
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
# Link rapidi
|
||||
|
||||
<div class="quick-links-grid">
|
||||
<a href="/docs/troubleshoot-errors">
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="book" class="svg-inline--fa fa-book fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"></path></svg>
|
||||
<div>
|
||||
<p class="header">Non trovi qualcosa?</p>
|
||||
<p>Cerca gli errori</p>
|
||||
</div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
|
||||
</a>
|
||||
|
||||
<a href="/docs/beans">
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="book" class="svg-inline--fa fa-book fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"></path></svg>
|
||||
<div>
|
||||
<p class="header">Nintendo tipo:</p>
|
||||
<p>Ecco il tuo DMCA e la tua C&D</p>
|
||||
</div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
# Altra documentazione
|
||||
|
||||
Siamo un gruppo di programmer che spendono il loro tempo libero a sviluppare e fare reverse-engineering per i server online per la 3DS e Wii U.
|
||||
|
||||
Siamo un gruppo di programmer che spendono il loro tempo libero a sviluppare e fare reverse-engineering per i server online per la 3DS e Wii U.
|
||||
|
||||
Siamo un gruppo di programmer che spendono il loro tempo libero a sviluppare e fare reverse-engineering per i server online per la 3DS e Wii U.
|
||||
|
||||
```javascript
|
||||
function returnTrue() {
|
||||
class trueOrFalseObject {
|
||||
constructor(trueOrFalse) {
|
||||
this.trueOrFalse = trueOrFalse;
|
||||
}
|
||||
get trueOrFalse() {
|
||||
return this.trueOrFalse();
|
||||
}
|
||||
convertNumberToBoolean(trueOrFalse) {
|
||||
if (convertStringToNumber(trueOrFalse) === 0) {
|
||||
return true;
|
||||
} else if (convertStringToNumber(trueOrFalse) == 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
convertStringToNumber(trueOrFalse) {
|
||||
if (trueOrFalse === "true") {
|
||||
return 0;
|
||||
} else if (trueOrFalse === "false") {
|
||||
return true * 69 - 1 - false * 69 * 420 - 69 + 2;
|
||||
}
|
||||
}
|
||||
trueOrFalse() {
|
||||
return this.convertNumberToBoolean(trueOrFalse);
|
||||
}
|
||||
}
|
||||
|
||||
let objectWhichWeKnowIsTrue = new trueOrFalseObject("true");
|
||||
|
||||
function checkIfTrueOrFalse(objectToCheckIfTrueOrFalse) {
|
||||
if (objectToCheckIfTrueOrFalse === objectWhichWeKnowIsTrue.trueOrFalse) {
|
||||
return objectWhichWeKnowIsTrue.trueOrFalse;
|
||||
console.log(
|
||||
"Successfully checked if the object is true or false. Result: the object is true."
|
||||
);
|
||||
// TODO: fix text not console logging
|
||||
} else {
|
||||
objectWhichWeKnowIsTrue = new trueOrFalseObject("false");
|
||||
if (objectToCheckIfTrueOrFalse === objectWhichWeKnowIsTrue.trueOrFalse) {
|
||||
return objectWhichWeKnowIsTrue.trueOrFalse;
|
||||
console.log(
|
||||
"Successfully checked if the object is true or false. Result: the object is false."
|
||||
);
|
||||
// TODO: fix text not console logging
|
||||
} else {
|
||||
// something went horribly wrong
|
||||
}
|
||||
objectWhichWeKnowIsTrue = new trueOrFalseObject("true");
|
||||
}
|
||||
}
|
||||
|
||||
const isTrueTrueOrFalse = checkIfTrueOrFalse("true");
|
||||
const isfalseTrueOrFalse = checkIfTrueOrFalse("false");
|
||||
|
||||
const trueOrFalseJSON = {
|
||||
true: isTrueTrueOrFalse,
|
||||
false: isfalseTrueOrFalse,
|
||||
};
|
||||
|
||||
return trueOrFalseJSON.true
|
||||
}
|
||||
|
||||
console.log(returnTrue())
|
||||
```
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
"nav": {
|
||||
"about": "Info",
|
||||
"faq": "FAQ",
|
||||
"docs": "Documentazione",
|
||||
"credits": "Riconoscimenti",
|
||||
"progress": "Progresso",
|
||||
"blog": "Blog"
|
||||
|
|
@ -173,5 +174,8 @@
|
|||
"fileInput": "File da testare",
|
||||
"filePlaceholder": "https://il.link.di/un_file.json",
|
||||
"button": "Testa file"
|
||||
},
|
||||
"docs": {
|
||||
"missingInLocale": "Questa pagina non è disponibile nella tua lingua. Per favore, controlla la versione in inglese sotto."
|
||||
}
|
||||
}
|
||||
|
|
@ -173,5 +173,8 @@
|
|||
"fileInput": "File to test",
|
||||
"filePlaceholder": "https://a.link.to/the_file.json",
|
||||
"button": "Test file"
|
||||
},
|
||||
"docs": {
|
||||
"missingInLocale": "This page is unavailable in your locale. Please check the English version below."
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
html, body {
|
||||
html,
|
||||
body {
|
||||
background: #131730;
|
||||
}
|
||||
a.logo-link {
|
||||
margin:auto;
|
||||
margin: auto;
|
||||
margin-left: 36px;
|
||||
height: 40px;
|
||||
text-decoration: none;
|
||||
}
|
||||
header {
|
||||
width: calc(100% - 72px);
|
||||
|
|
@ -15,7 +17,7 @@ header {
|
|||
header a.logo-link {
|
||||
display: none;
|
||||
}
|
||||
header nav a:first-child {
|
||||
header nav a:first-child {
|
||||
margin-left: -24px;
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +25,7 @@ header nav a:first-child {
|
|||
display: grid;
|
||||
grid-template-columns: repeat(2, fit-content(100%));
|
||||
grid-template-rows: repeat(2, fit-content(100%));
|
||||
min-height: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.docs-wrapper .sidebar {
|
||||
|
|
@ -34,12 +36,13 @@ header nav a:first-child {
|
|||
background: #161931;
|
||||
max-height: calc(100vh - 69px);
|
||||
overflow-y: scroll;
|
||||
min-height: 100%;
|
||||
}
|
||||
.docs-wrapper .sidebar .section {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
width: 200px;
|
||||
margin-left: 30px;
|
||||
margin-left: 138px;
|
||||
margin-bottom: 72px;
|
||||
}
|
||||
.docs-wrapper .sidebar .section:first-child {
|
||||
|
|
@ -146,7 +149,7 @@ header nav a:first-child {
|
|||
border: 3px solid var(--background);
|
||||
}
|
||||
.docs-wrapper .content pre code::-webkit-scrollbar-thumb {
|
||||
border: 3px solid #0D0F20;
|
||||
border: 3px solid #0d0f20;
|
||||
}
|
||||
.docs-wrapper .sidebar {
|
||||
scrollbar-width: thin;
|
||||
|
|
@ -158,5 +161,61 @@ header nav a:first-child {
|
|||
}
|
||||
.docs-wrapper .content pre codear {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--text-secondary-2) #0D0F20;
|
||||
scrollbar-color: var(--text-secondary-2) #0d0f20;
|
||||
}
|
||||
.docs-wrapper .content .missing-in-locale-notice {
|
||||
background: #252a51;
|
||||
padding: 24px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
|
||||
.input-wrapper {
|
||||
display: flex;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.localization-form input {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
border: 0;
|
||||
font-family: Poppins, Arial, Helvetica, sans-serif;
|
||||
font-size: 1rem;
|
||||
background-color: var(--btn-secondary);
|
||||
border: none;
|
||||
border-radius: 4px 0 0 4px;
|
||||
padding: 12px 24px;
|
||||
color: var(--text-secondary);
|
||||
width: 20px;
|
||||
flex: 2 10%;
|
||||
}
|
||||
|
||||
.search input::placeholder {
|
||||
color: var(--text-secondary-2);
|
||||
}
|
||||
|
||||
.search input:focus {
|
||||
background-color: #fff;
|
||||
color: var(--btn-secondary);
|
||||
transition: 200ms;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.search button {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
border: 0;
|
||||
font-family: Poppins, Arial, Helvetica, sans-serif;
|
||||
font-size: 1rem;
|
||||
color: var(--text);
|
||||
padding: 12px 36px;
|
||||
background: var(--btn);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1080px) {
|
||||
.docs-wrapper .sidebar .section {
|
||||
margin-left: 60px;
|
||||
width: 184px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
pre code.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 12px 36px;
|
||||
padding: 36px;
|
||||
border-radius: 10px;
|
||||
font-family: Poppins, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,92 +1,85 @@
|
|||
const { Router } = require('express');
|
||||
const util = require('../util');
|
||||
const logger = require('../logger');
|
||||
const router = new Router();
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const marked = require('marked');
|
||||
const matter = require('gray-matter');
|
||||
/*
|
||||
const postList = () => {
|
||||
const files = fs.readdirSync('blogposts');
|
||||
|
||||
// We get the info for each blogpost, ignoring the ones starting with _
|
||||
const posts = files
|
||||
.filter(filename => !filename.startsWith('_'))
|
||||
.filter(filename => filename.endsWith('.md')) // Ignores other files/folders
|
||||
.map((filename) => {
|
||||
const slug = filename.replace('.md', '');
|
||||
const rawPost = fs.readFileSync(
|
||||
path.join('blogposts', `${filename}`),
|
||||
'utf-8'
|
||||
);
|
||||
const { data: postInfo } = matter(rawPost);
|
||||
return {
|
||||
slug,
|
||||
postInfo,
|
||||
};
|
||||
});
|
||||
// Here we'll store the rendered markdown files for future requests
|
||||
const cachedPages = {};
|
||||
|
||||
posts.sort((a, b) => {
|
||||
return new Date(b.postInfo.date) - new Date(a.postInfo.date);
|
||||
});
|
||||
|
||||
return posts;
|
||||
};
|
||||
*/
|
||||
router.get('/', async (request, response) => {
|
||||
response.redirect('/docs/welcome');
|
||||
});
|
||||
|
||||
router.get('/search', async (request, response) => {
|
||||
const reqLocale = request.locale;
|
||||
const locale = util.getLocale(reqLocale.region, reqLocale.language);
|
||||
|
||||
const localeString = reqLocale.toString();
|
||||
|
||||
response.render('docs', {
|
||||
response.render('docs/search', {
|
||||
layout: 'main',
|
||||
locale,
|
||||
localeString,
|
||||
currentPage: request.params.slug,
|
||||
});
|
||||
});
|
||||
/*
|
||||
router.get('/:slug', async (request, response, next) => {
|
||||
|
||||
router.get('/:slug', async (request, response, next) => {
|
||||
const reqLocale = request.locale;
|
||||
const locale = util.getLocale(reqLocale.region, reqLocale.language);
|
||||
|
||||
const localeString = reqLocale.toString();
|
||||
|
||||
// Get the name of the post from the URL
|
||||
const postName = request.params.slug;
|
||||
// Get the name of the page from the URL
|
||||
const pageName = request.params.slug;
|
||||
|
||||
// Get the markdown file corresponding to the post
|
||||
let rawPost;
|
||||
try {
|
||||
rawPost = fs.readFileSync(path.join('blogposts', `${postName}.md`), 'utf-8');
|
||||
} catch(err) {
|
||||
logger.error(err);
|
||||
let markdownLocale = localeString;
|
||||
let missingInLocale = false;
|
||||
// Check if the MD file exists in the user's locale, if not try en-US and show notice, or finally log error and show 404.
|
||||
if (fs.existsSync(path.join('docs', localeString, `${pageName}.md`))) {
|
||||
null;
|
||||
} else if (fs.existsSync(path.join('docs', 'en-US', `${pageName}.md`))) {
|
||||
markdownLocale = 'en-US';
|
||||
missingInLocale = true;
|
||||
} else {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
// Convert the post info into JSON and separate it and the content
|
||||
// eslint-disable-next-line prefer-const
|
||||
let { data: postInfo, content } = matter(rawPost);
|
||||
|
||||
// Replace [yt-iframe](videoID) with the full <iframe />
|
||||
content = content
|
||||
.replace(/(?<!`)\[yt-iframe]\(/g, '<div class="aspectratio-fallback"><iframe src="https://www.youtube-nocookie.com/embed/')
|
||||
.replace(/(?<=<iframe src="https:\/\/www\.youtube-nocookie\.com\/embed\/.{11})\)/g, '" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>');
|
||||
let content;
|
||||
// If the page has already been rendered, use the cached version
|
||||
if (cachedPages[markdownLocale]?.[pageName]) {
|
||||
content = cachedPages[markdownLocale]?.[pageName];
|
||||
} else {
|
||||
// Get the markdown file corresponding to the page.
|
||||
content = fs.readFileSync(path.join('docs', markdownLocale, `${pageName}.md`), 'utf-8');
|
||||
|
||||
// Convert the content into HTML
|
||||
const htmlPost = marked(content);
|
||||
// Replace [yt-iframe](videoID) with the full <iframe />
|
||||
content = content
|
||||
.replace(/(?<!`)\[yt-iframe]\(/g, '<div class="aspectratio-fallback"><iframe src="https://www.youtube-nocookie.com/embed/')
|
||||
.replace(/(?<=<iframe src="https:\/\/www\.youtube-nocookie\.com\/embed\/.{11})\)/g, '" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>');
|
||||
|
||||
response.render('blog/blogpost', {
|
||||
layout: 'blog-opengraph',
|
||||
// Convert the content into HTML
|
||||
content = marked(content);
|
||||
|
||||
// Push the content into the cache
|
||||
if (!cachedPages[markdownLocale]) {
|
||||
cachedPages[markdownLocale] = {};
|
||||
}
|
||||
cachedPages[markdownLocale][pageName] = content;
|
||||
}
|
||||
|
||||
response.render('docs/docs', {
|
||||
layout: 'main',
|
||||
locale,
|
||||
localeString,
|
||||
postInfo,
|
||||
htmlPost,
|
||||
content,
|
||||
currentPage: request.params.slug,
|
||||
missingInLocale,
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
|||
|
|
@ -1,136 +0,0 @@
|
|||
<link rel="stylesheet" href="/assets/css/documentation.css" />
|
||||
|
||||
<div class="docs-wrapper">
|
||||
|
||||
<a href="/" class="logo-link">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="39.876">
|
||||
<g id="logo_type" data-name="logo type" transform="translate(-553 -467)">
|
||||
<g id="logo" transform="translate(553 467)">
|
||||
<rect id="XMLID_158_" width="39.876" height="39.876" fill="#9d6ff3" opacity="0" />
|
||||
<g id="XMLID_6_" transform="translate(8.222 1.418)">
|
||||
<path id="XMLID_15_"
|
||||
d="M69.149,28.312c-1.051.553-.129,2.139.922,1.585a12.365,12.365,0,0,1,8.794-.571,10.829,10.829,0,0,1,6.342,4.166c.645,1,2.231.074,1.585-.922C83.308,27.169,74.7,25.436,69.149,28.312Z"
|
||||
transform="translate(-64.246 -23.389)" fill="#9d6ff3" />
|
||||
<path id="XMLID_14_"
|
||||
d="M82.64,14.608A15.565,15.565,0,0,0,73.5,8.45a17.535,17.535,0,0,0-12.647.9c-1.051.553-.129,2.139.922,1.585,3.411-1.788,7.6-1.714,11.209-.719,3.1.848,6.268,2.544,8.038,5.309C81.681,16.543,83.267,15.622,82.64,14.608Z"
|
||||
transform="translate(-57.476 -7.693)" fill="#9d6ff3" />
|
||||
<path id="XMLID_9_"
|
||||
d="M55.68,47.8a10.719,10.719,0,0,0-6.71,2.3H45.983A1.336,1.336,0,0,0,44.6,51.376V75.84a1.431,1.431,0,0,0,1.383,1.383h3.023a1.367,1.367,0,0,0,1.309-1.383V68.392A10.993,10.993,0,1,0,55.68,47.8Zm0,17.182a6.213,6.213,0,1,1,6.213-6.213A6.216,6.216,0,0,1,55.68,64.982Z"
|
||||
transform="translate(-44.6 -40.406)" fill="#9d6ff3" />
|
||||
</g>
|
||||
</g>
|
||||
<text id="Pretendo" transform="translate(593 492)" fill="#fff" font-size="17"
|
||||
font-family="Poppins-Bold, Poppins" font-weight="700">
|
||||
<tspan x="0" y="0">Pretendo</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
{{> header}}
|
||||
|
||||
{{> docs-sidebar}}
|
||||
|
||||
<div class="content">
|
||||
<div class="content-inner">
|
||||
<h1>Quick links</h1>
|
||||
<div class="quick-links-grid">
|
||||
<a href="/docs/troubleshoot-errors">
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="book" class="svg-inline--fa fa-book fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"></path></svg>
|
||||
<!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->
|
||||
<div>
|
||||
<p class="header">Can't find something?</p>
|
||||
<p>Troubleshoot errors</p>
|
||||
</div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
|
||||
</a>
|
||||
<a href="/docs/beans">
|
||||
<!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="book" class="svg-inline--fa fa-book fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"></path></svg>
|
||||
<div>
|
||||
<p class="header">Nintendo be like</p>
|
||||
<p>Here's your DMCA and C&D</p>
|
||||
</div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<h1>Other documentation</h1>
|
||||
<p>We are a bunch of programmers spending our free time reverse engineering and coding game servers for 3ds and wiiu.</p>
|
||||
<p>We are a bunch of programmers spending our free time reverse engineering and coding game servers for 3ds and wiiu.</p>
|
||||
<p>We are a bunch of programmers spending our free time reverse engineering and coding game servers for 3ds and wiiu.</p>
|
||||
<pre>
|
||||
<code class="language-javascript">
|
||||
function returnTrue() {
|
||||
class trueOrFalseObject {
|
||||
constructor(trueOrFalse) {
|
||||
this.trueOrFalse = trueOrFalse;
|
||||
}
|
||||
get trueOrFalse() {
|
||||
return this.trueOrFalse();
|
||||
}
|
||||
convertNumberToBoolean(trueOrFalse) {
|
||||
if (convertStringToNumber(trueOrFalse) === 0) {
|
||||
return true;
|
||||
} else if (convertStringToNumber(trueOrFalse) == 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
convertStringToNumber(trueOrFalse) {
|
||||
if (trueOrFalse === "true") {
|
||||
return 0;
|
||||
} else if (trueOrFalse === "false") {
|
||||
return true * 69 - 1 - false * 69 * 420 - 69 + 2;
|
||||
}
|
||||
}
|
||||
trueOrFalse() {
|
||||
return this.convertNumberToBoolean(trueOrFalse);
|
||||
}
|
||||
}
|
||||
|
||||
let objectWhichWeKnowIsTrue = new trueOrFalseObject("true");
|
||||
|
||||
function checkIfTrueOrFalse(objectToCheckIfTrueOrFalse) {
|
||||
if (objectToCheckIfTrueOrFalse === objectWhichWeKnowIsTrue.trueOrFalse) {
|
||||
return objectWhichWeKnowIsTrue.trueOrFalse;
|
||||
console.log(
|
||||
"Successfully checked if the object is true or false. Result: the object is true."
|
||||
);
|
||||
// TODO: fix text not console logging
|
||||
} else {
|
||||
objectWhichWeKnowIsTrue = new trueOrFalseObject("false");
|
||||
if (objectToCheckIfTrueOrFalse === objectWhichWeKnowIsTrue.trueOrFalse) {
|
||||
return objectWhichWeKnowIsTrue.trueOrFalse;
|
||||
console.log(
|
||||
"Successfully checked if the object is true or false. Result: the object is false."
|
||||
);
|
||||
// TODO: fix text not console logging
|
||||
} else {
|
||||
// something went horribly wrong
|
||||
}
|
||||
objectWhichWeKnowIsTrue = new trueOrFalseObject("true");
|
||||
}
|
||||
}
|
||||
|
||||
const isTrueTrueOrFalse = checkIfTrueOrFalse("true");
|
||||
const isfalseTrueOrFalse = checkIfTrueOrFalse("false");
|
||||
|
||||
const trueOrFalseJSON = {
|
||||
true: isTrueTrueOrFalse,
|
||||
false: isfalseTrueOrFalse,
|
||||
};
|
||||
|
||||
return trueOrFalseJSON.true
|
||||
}
|
||||
|
||||
console.log(returnTrue())
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script>
|
||||
<link rel="stylesheet" href="/assets/css/highlightjs.css">
|
||||
<script>hljs.highlightAll();</script>
|
||||
49
views/docs/docs.handlebars
Normal file
49
views/docs/docs.handlebars
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<link rel="stylesheet" href="/assets/css/documentation.css" />
|
||||
|
||||
<div class="docs-wrapper">
|
||||
|
||||
<a href="/" class="logo-link">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="39.876">
|
||||
<g id="logo_type" data-name="logo type" transform="translate(-553 -467)">
|
||||
<g id="logo" transform="translate(553 467)">
|
||||
<rect id="XMLID_158_" width="39.876" height="39.876" fill="#9d6ff3" opacity="0" />
|
||||
<g id="XMLID_6_" transform="translate(8.222 1.418)">
|
||||
<path id="XMLID_15_"
|
||||
d="M69.149,28.312c-1.051.553-.129,2.139.922,1.585a12.365,12.365,0,0,1,8.794-.571,10.829,10.829,0,0,1,6.342,4.166c.645,1,2.231.074,1.585-.922C83.308,27.169,74.7,25.436,69.149,28.312Z"
|
||||
transform="translate(-64.246 -23.389)" fill="#9d6ff3" />
|
||||
<path id="XMLID_14_"
|
||||
d="M82.64,14.608A15.565,15.565,0,0,0,73.5,8.45a17.535,17.535,0,0,0-12.647.9c-1.051.553-.129,2.139.922,1.585,3.411-1.788,7.6-1.714,11.209-.719,3.1.848,6.268,2.544,8.038,5.309C81.681,16.543,83.267,15.622,82.64,14.608Z"
|
||||
transform="translate(-57.476 -7.693)" fill="#9d6ff3" />
|
||||
<path id="XMLID_9_"
|
||||
d="M55.68,47.8a10.719,10.719,0,0,0-6.71,2.3H45.983A1.336,1.336,0,0,0,44.6,51.376V75.84a1.431,1.431,0,0,0,1.383,1.383h3.023a1.367,1.367,0,0,0,1.309-1.383V68.392A10.993,10.993,0,1,0,55.68,47.8Zm0,17.182a6.213,6.213,0,1,1,6.213-6.213A6.216,6.216,0,0,1,55.68,64.982Z"
|
||||
transform="translate(-44.6 -40.406)" fill="#9d6ff3" />
|
||||
</g>
|
||||
</g>
|
||||
<text id="Pretendo" transform="translate(593 492)" fill="#fff" font-size="17"
|
||||
font-family="Poppins-Bold, Poppins" font-weight="700">
|
||||
<tspan x="0" y="0">Pretendo</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
{{> header}}
|
||||
|
||||
{{> docs-sidebar}}
|
||||
|
||||
<div class="content">
|
||||
<div class="content-inner">
|
||||
{{#if missingInLocale}}
|
||||
<p class="missing-in-locale-notice">{{locale.docs.missingInLocale}}</p>
|
||||
{{/if}}
|
||||
|
||||
{{{ content }}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script>
|
||||
<link rel="stylesheet" href="/assets/css/highlightjs.css">
|
||||
<script>hljs.highlightAll();</script>
|
||||
|
||||
40
views/docs/search.handlebars
Normal file
40
views/docs/search.handlebars
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<link rel="stylesheet" href="/assets/css/documentation.css" />
|
||||
|
||||
<div class="docs-wrapper">
|
||||
|
||||
<a href="/" class="logo-link">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="39.876">
|
||||
<g id="logo_type" data-name="logo type" transform="translate(-553 -467)">
|
||||
<g id="logo" transform="translate(553 467)">
|
||||
<rect id="XMLID_158_" width="39.876" height="39.876" fill="#9d6ff3" opacity="0" />
|
||||
<g id="XMLID_6_" transform="translate(8.222 1.418)">
|
||||
<path id="XMLID_15_"
|
||||
d="M69.149,28.312c-1.051.553-.129,2.139.922,1.585a12.365,12.365,0,0,1,8.794-.571,10.829,10.829,0,0,1,6.342,4.166c.645,1,2.231.074,1.585-.922C83.308,27.169,74.7,25.436,69.149,28.312Z"
|
||||
transform="translate(-64.246 -23.389)" fill="#9d6ff3" />
|
||||
<path id="XMLID_14_"
|
||||
d="M82.64,14.608A15.565,15.565,0,0,0,73.5,8.45a17.535,17.535,0,0,0-12.647.9c-1.051.553-.129,2.139.922,1.585,3.411-1.788,7.6-1.714,11.209-.719,3.1.848,6.268,2.544,8.038,5.309C81.681,16.543,83.267,15.622,82.64,14.608Z"
|
||||
transform="translate(-57.476 -7.693)" fill="#9d6ff3" />
|
||||
<path id="XMLID_9_"
|
||||
d="M55.68,47.8a10.719,10.719,0,0,0-6.71,2.3H45.983A1.336,1.336,0,0,0,44.6,51.376V75.84a1.431,1.431,0,0,0,1.383,1.383h3.023a1.367,1.367,0,0,0,1.309-1.383V68.392A10.993,10.993,0,1,0,55.68,47.8Zm0,17.182a6.213,6.213,0,1,1,6.213-6.213A6.216,6.216,0,0,1,55.68,64.982Z"
|
||||
transform="translate(-44.6 -40.406)" fill="#9d6ff3" />
|
||||
</g>
|
||||
</g>
|
||||
<text id="Pretendo" transform="translate(593 492)" fill="#fff" font-size="17"
|
||||
font-family="Poppins-Bold, Poppins" font-weight="700">
|
||||
<tspan x="0" y="0">Pretendo</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
{{> header}}
|
||||
|
||||
{{> docs-sidebar}}
|
||||
|
||||
<div class="content">
|
||||
<div class="content-inner">
|
||||
<div class="card"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -1,40 +1,50 @@
|
|||
<div class="sidebar">
|
||||
<div class="section">
|
||||
<h5>Getting started</h5>
|
||||
<a href="/docs/welcome" class="active">Welcome</a>
|
||||
<a href="/docs/installing-juxt">Installing Juxt</a>
|
||||
<a href="/docs/troubleshoot-errors">Troubleshoot errors</a>
|
||||
<a href="/docs/welcome">Welcome</a>
|
||||
<a href="/docs/installing-juxt" >Installing Juxt</a>
|
||||
<a href="/docs/search">Search</a>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h5>Error codes - Juxt</h5>
|
||||
<a href="/docs/error/JXT-598-0000">JXT-598-0000</a>
|
||||
<a href="/docs/error/JXT-598-0001">JXT-598-0001</a>
|
||||
<a href="/docs/error/JXT-598-0002">JXT-598-0002</a>
|
||||
<a href="/docs/error/JXT-598-0003">JXT-598-0003</a>
|
||||
<a href="/docs/error/JXT-598-0009">JXT-598-0009</a>
|
||||
<a href="/docs/error/JXT-598-0010">JXT-598-0010</a>
|
||||
<a href="/docs/error/JXT-598-0011">JXT-598-0011</a>
|
||||
<a href="/docs/error/JXT-598-0015">JXT-598-0015</a>
|
||||
<a href="/docs/error/JXT-598-0020">JXT-598-0020</a>
|
||||
<a href="/docs/error/JXT-598-1XXX">JXT-598-1XXX</a>
|
||||
<a href="/docs/error/JXT-598-2XXX">JXT-598-2XXX</a>
|
||||
<a href="/docs/error/JXT-598-3XXX">JXT-598-3XXX</a>
|
||||
<a href="/docs/error/JXT-598-4XXX">JXT-598-4XXX</a>
|
||||
<a href="/docs/error/JXT-598-5XXX">JXT-598-5XXX</a>
|
||||
<a href="/docs/JXT-598-0000">JXT-598-0000</a>
|
||||
<a href="/docs/JXT-598-0001">JXT-598-0001</a>
|
||||
<a href="/docs/JXT-598-0002">JXT-598-0002</a>
|
||||
<a href="/docs/JXT-598-0003">JXT-598-0003</a>
|
||||
<a href="/docs/JXT-598-0009">JXT-598-0009</a>
|
||||
<a href="/docs/JXT-598-0010">JXT-598-0010</a>
|
||||
<a href="/docs/JXT-598-0011">JXT-598-0011</a>
|
||||
<a href="/docs/JXT-598-0015">JXT-598-0015</a>
|
||||
<a href="/docs/JXT-598-0020">JXT-598-0020</a>
|
||||
<a href="/docs/JXT-598-1XXX">JXT-598-1XXX</a>
|
||||
<a href="/docs/JXT-598-2XXX">JXT-598-2XXX</a>
|
||||
<a href="/docs/JXT-598-3XXX">JXT-598-3XXX</a>
|
||||
<a href="/docs/JXT-598-4XXX">JXT-598-4XXX</a>
|
||||
<a href="/docs/JXT-598-5XXX">JXT-598-5XXX</a>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h5>Error codes - Beans</h5>
|
||||
<a href="/docs/error/JXT-598-0000">Black Beans</a>
|
||||
<a href="/docs/error/JXT-598-0001">Black-Eyed Peas</a>
|
||||
<a href="/docs/error/JXT-598-0002">Cannellini Beans</a>
|
||||
<a href="/docs/error/JXT-598-0003">Chickpeas (Garbanzo Beans)</a>
|
||||
<a href="/docs/error/JXT-598-0009">Great Northern Beans</a>
|
||||
<a href="/docs/error/JXT-598-0010">Kidney Beans</a>
|
||||
<a href="/docs/error/JXT-598-0011">Lima Beans</a>
|
||||
<a href="/docs/error/JXT-598-0015">Pinto Beans</a>
|
||||
<a href="/docs/error/JXT-598-0020">Fava Beans</a>
|
||||
<a href="/docs/error/JXT-598-1XXX">Navy Beans</a>
|
||||
<a href="/docs/Black Beans">Black Beans</a>
|
||||
<a href="/docs/black-eyed-peas">Black-Eyed Peas</a>
|
||||
<a href="/docs/Cannellini Beans">Cannellini Beans</a>
|
||||
<a href="/docs/Chickpeas (Garbanzo Beans)">Chickpeas (Garbanzo Beans)</a>
|
||||
<a href="/docs/Great Northern Beans">Great Northern Beans</a>
|
||||
<a href="/docs/Kidney Beans">Kidney Beans</a>
|
||||
<a href="/docs/Lima Beans">Lima Beans</a>
|
||||
<a href="/docs/Pinto Beans">Pinto Beans</a>
|
||||
<a href="/docs/Fava Beans">Fava Beans</a>
|
||||
<a href="/docs/Navy Beans">Navy Beans</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function selectSidebarElement(element) {
|
||||
element.scrollIntoView({ block: "center" });
|
||||
element.classList.add('active');
|
||||
}
|
||||
|
||||
selectSidebarElement(document.querySelector("div.sidebar a[href='/docs/{{currentPage}}']"));
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user