From b4a52ac3bc844a725db2b2b67c18773daece6d6c Mon Sep 17 00:00:00 2001 From: mistic100 Date: Wed, 10 Nov 2021 02:20:10 +0100 Subject: [PATCH 01/12] Show announcements on documentation home page --- .gitignore | 1 + docs/.netlify/functions/announcements.js | 39 ++++++++++++++ docs/.netlify/functions/package.json | 9 ++++ docs/.vuepress/components/Announcements.vue | 57 +++++++++++++++++++++ docs/README.md | 17 +----- 5 files changed, 107 insertions(+), 16 deletions(-) create mode 100644 docs/.netlify/functions/announcements.js create mode 100644 docs/.netlify/functions/package.json create mode 100644 docs/.vuepress/components/Announcements.vue diff --git a/.gitignore b/.gitignore index 94f81056a..ab053da42 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ package-lock.json yarn.lock yarn-error.log /three-examples +/.netlify diff --git a/docs/.netlify/functions/announcements.js b/docs/.netlify/functions/announcements.js new file mode 100644 index 000000000..49c583292 --- /dev/null +++ b/docs/.netlify/functions/announcements.js @@ -0,0 +1,39 @@ +const axios = require('axios'); + +exports.handler = async function(event, context) { + if (event.httpMethod !== 'GET') { + return { statusCode: 405, body: 'Method Not Allowed' }; + } + + return await axios({ + url : 'https://api.github.com/graphql', + method : 'POST', + headers: { + 'Authorization': `bearer ${process.env.GH_TOKEN}`, + }, + data : { + query: ` + query { + repository(owner: "mistic100", name: "photo-sphere-viewer") { + pinnedDiscussions(first: 2) { + nodes { + discussion { + title + createdAt + url + body + } + } + } + } + }`, + }, + }) + .then(result => { + const announcements = result.data.data.repository.pinnedDiscussions.nodes.map(n => n.discussion); + return { + statusCode: 200, + body: JSON.stringify(announcements) + }; + }); +}; diff --git a/docs/.netlify/functions/package.json b/docs/.netlify/functions/package.json new file mode 100644 index 000000000..9a8d696ce --- /dev/null +++ b/docs/.netlify/functions/package.json @@ -0,0 +1,9 @@ +{ + "name": "psv-netlify-functions", + "version": "1.0.0", + "license": "MIT", + "private": true, + "dependencies": { + "axios": "^0.24.0" + } +} diff --git a/docs/.vuepress/components/Announcements.vue b/docs/.vuepress/components/Announcements.vue new file mode 100644 index 000000000..7925cf6ab --- /dev/null +++ b/docs/.vuepress/components/Announcements.vue @@ -0,0 +1,57 @@ + + + diff --git a/docs/README.md b/docs/README.md index b45a84436..5b8f393e4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,22 +20,7 @@ features: footer: Licensed under MIT License, documentation under CC BY 3.0 --- -
-
- -::: tip New tiles support -Improve the loading time of big panoramas with the the [Tiles adapter](guide/adapters/tiles.md). -::: - -
-
- -::: tip Typescript support -Photo Sphere Viewer is now shipped with its own typings. -::: - -
-
+ From fc5106599d907b22cdd5c666dedbf5fb479651fa Mon Sep 17 00:00:00 2001 From: Damien Sorel Date: Tue, 16 Nov 2021 13:36:37 +0100 Subject: [PATCH 02/12] fix: virtual tour plugin startNodeId --- docs/.vuepress/components/Announcements.vue | 18 +++++++++++++++--- src/plugins/virtual-tour/index.js | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/.vuepress/components/Announcements.vue b/docs/.vuepress/components/Announcements.vue index 7925cf6ab..3a07a4b8e 100644 --- a/docs/.vuepress/components/Announcements.vue +++ b/docs/.vuepress/components/Announcements.vue @@ -1,7 +1,7 @@