diff --git a/content/ui/navbar/social.json b/content/ui/navbar/social.json new file mode 100644 index 0000000..0ec85e9 --- /dev/null +++ b/content/ui/navbar/social.json @@ -0,0 +1,27 @@ +[ + { + "title": "Patreon", + "color": "red", + "href": "https://patreon.com/Ryujinx", + "icon": "fa-patreon" + }, + { + "title": "GitHub", + "color": "green", + "href": "https://github.com/Ryujinx/Ryujinx", + "icon": "fa-github" + }, + { + "title": "Twitter", + "color": "blue", + "href": "https://twitter.com/RyujinxEmu", + "icon": "fa-twitter" + + }, + { + "title": "Discord", + "color": "#7289DA", + "href": "https://discord.gg/VkQYXAZ", + "icon": "fa-discord" + } +] \ No newline at end of file diff --git a/gridsome.server.js b/gridsome.server.js index 02bf054..d9403ce 100644 --- a/gridsome.server.js +++ b/gridsome.server.js @@ -1,6 +1,17 @@ const nodeExternals = require('webpack-node-externals') const fs = require('fs') +function addJSONCollection(actions,typeName, path) { + const list = JSON.parse(fs.readFileSync(path)); + const collection = actions.addCollection({ + typeName: typeName + }) + + for (const element of list) { + collection.addNode(element) + } +} + module.exports = function (api) { api.chainWebpack((config, { isServer }) => { if (isServer) { @@ -13,15 +24,7 @@ module.exports = function (api) { }) api.loadSource(async actions => { - const teamList = JSON.parse(fs.readFileSync("./content/team.json")) - const teamCollection = actions.addCollection({ - typeName: 'Team' - }) - - for (const teamMember of teamList) { - - teamMember.description = teamMember.description | "" - teamCollection.addNode(teamMember) - } + addJSONCollection(actions, "Team", "./content/team.json") + addJSONCollection(actions, "SocialNavbarElements", "./content/ui/navbar/social.json") }) } diff --git a/src/layouts/Default.vue b/src/layouts/Default.vue index 7cc7e6c..f2e9b31 100644 --- a/src/layouts/Default.vue +++ b/src/layouts/Default.vue @@ -29,17 +29,8 @@ fas fa-gamepad - - fab fa-patreon - - - fab fa-github - - - fab fa-twitter - - - fab fa-discord + + fab {{ element.node.icon }} @@ -54,17 +45,8 @@ target="_blank" >Compatibility - - fab fa-patreon - - - fab fa-github - - - fab fa-twitter - - - fab fa-discord + + fab {{ element.node.icon }} @@ -125,36 +107,11 @@ - - + - fab fa-patreon + fab {{ element.node.icon }} - Patreon - - - - - - fab fa-github - - GitHub - - - - - - fab fa-twitter - - Twitter - - - - - - fab fa-discord - - Discord + {{element.node.title}} @@ -178,6 +135,22 @@ query { } + + +query { + socialNavbarElements: allSocialNavbarElements(order: ASC) { + edges { + node { + title + color + href + icon + } + } + } +} + +