Added default doc seeding for new servers

This commit is contained in:
Stefan Zermatten
2022-11-22 02:34:34 +02:00
parent 063d4288ef
commit 254390e1c1
3 changed files with 793 additions and 1 deletions

View File

@@ -112,6 +112,22 @@ function getDocLink(doc, urlName) {
return address.join('/');
}
// Add a means of seeding new servers with documentation
if (Meteor.isClient) {
Docs.getJsonDocs = function () {
return JSON.stringify(Docs.find({}).fetch(), null, 2);
}
} else if (Meteor.isServer) {
Meteor.startup(() => {
if (!Docs.findOne()) {
Assets.getText('docs/defaultDocs.json', (string) => {
const docs = JSON.parse(string)
docs.forEach(doc => Docs.insert(doc));
});
}
});
}
const insertDoc = new ValidatedMethod({
name: 'docs.insert',
validate: null,

View File

@@ -5,12 +5,13 @@
lg="8"
>
<v-card
style="float: right; z-index: 5;"
style="float: right; z-index: 4;"
class="ma-4"
>
<v-fade-transition mode="out-in">
<v-list
v-if="siblingDocs.length > 1"
:dense="siblingDocs.length > 5"
>
<doc-list-item
v-for="sibling in siblingDocs"

File diff suppressed because one or more lines are too long