Added default doc seeding for new servers
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
775
app/private/docs/defaultDocs.json
Normal file
775
app/private/docs/defaultDocs.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user