From 634155448f17cdddbbafbe8b008e9396dfc2319f Mon Sep 17 00:00:00 2001 From: Montagu Adrien Date: Sun, 29 Mar 2020 16:36:46 +0200 Subject: [PATCH 01/12] add presentation listing --- package.json | 4 +- .../components/PresentationInfoLine.vue | 34 +++++++++++ src/.vuepress/components/PresentationItem.vue | 61 +++++++++++++++++++ src/.vuepress/components/PresentationList.vue | 36 +++++++++++ src/.vuepress/config.js | 18 +++++- src/.vuepress/data/index.js | 22 +++++++ .../Example/2020/My Example Presentation.json | 19 ++++++ src/presentations/README.md | 21 +++++++ 8 files changed, 212 insertions(+), 3 deletions(-) create mode 100644 src/.vuepress/components/PresentationInfoLine.vue create mode 100644 src/.vuepress/components/PresentationItem.vue create mode 100644 src/.vuepress/components/PresentationList.vue create mode 100644 src/.vuepress/data/presentations/Example/2020/My Example Presentation.json create mode 100644 src/presentations/README.md diff --git a/package.json b/package.json index 8fcf5cf..2aa7d34 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "Source code for events.vuejs.org", "main": "index.js", "scripts": { - "dev": "vuepress dev src", - "build": "vuepress build src" + "dev": "NODE_ENV=development vuepress dev src", + "build": "NODE_ENV=production vuepress build src" }, "repository": { "type": "git", diff --git a/src/.vuepress/components/PresentationInfoLine.vue b/src/.vuepress/components/PresentationInfoLine.vue new file mode 100644 index 0000000..30a0d27 --- /dev/null +++ b/src/.vuepress/components/PresentationInfoLine.vue @@ -0,0 +1,34 @@ + + + + + \ No newline at end of file diff --git a/src/.vuepress/components/PresentationItem.vue b/src/.vuepress/components/PresentationItem.vue new file mode 100644 index 0000000..56cf46c --- /dev/null +++ b/src/.vuepress/components/PresentationItem.vue @@ -0,0 +1,61 @@ + + + + + \ No newline at end of file diff --git a/src/.vuepress/components/PresentationList.vue b/src/.vuepress/components/PresentationList.vue new file mode 100644 index 0000000..d02fc36 --- /dev/null +++ b/src/.vuepress/components/PresentationList.vue @@ -0,0 +1,36 @@ + + + + + \ No newline at end of file diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index 3fa0ef9..74d295b 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -46,6 +46,19 @@ module.exports = { } ] }, + { + text: 'Presentation', + items: [ + { + text: 'Discover', + link: '/presentations/#discover' + }, + { + text: "Submit your", + link: '/presentations/#submit' + }, + ] + }, { text: 'Contact', items: [ @@ -179,5 +192,8 @@ module.exports = { ga: 'UA-46852172-1' } ] - ] + ], + define: { + NODE_ENV: process.env.NODE_ENV, + } } diff --git a/src/.vuepress/data/index.js b/src/.vuepress/data/index.js index dc36fe3..ecbde68 100644 --- a/src/.vuepress/data/index.js +++ b/src/.vuepress/data/index.js @@ -1,6 +1,8 @@ const dataFiles = require.context(".", false, /\.json$/); +const presentationDataFiles = require.context("./presentations", true, /\.json$/); const data = {}; +const presentationData = {}; dataFiles.keys().forEach((fileName) => { const fileData = dataFiles(fileName); @@ -8,4 +10,24 @@ dataFiles.keys().forEach((fileName) => { data[year] = fileData.default || fileData; }); +presentationDataFiles.keys().forEach((fileName) => { + console.log(NODE_ENV) + let fileData = presentationDataFiles(fileName); + fileName = fileName.replace(/\.\//, '').replace(/\.json/, '') + const [theme, year, title] = fileName.split("/", 3) + if (theme === "example" && NODE_ENV !== "development") { + return; + } + if (!presentationData[theme]) { + presentationData[theme] = {} + } + if (!presentationData[theme][year]) { + presentationData[theme][year] = [] + } + fileData = fileData.default || fileData; + fileData = {...fileData, title} + presentationData[theme][year].push(fileData.default || fileData) +}); + export default data; +export { data, presentationData}; diff --git a/src/.vuepress/data/presentations/Example/2020/My Example Presentation.json b/src/.vuepress/data/presentations/Example/2020/My Example Presentation.json new file mode 100644 index 0000000..24223f1 --- /dev/null +++ b/src/.vuepress/data/presentations/Example/2020/My Example Presentation.json @@ -0,0 +1,19 @@ +{ + "author": "Adrien Montagu", + "sourceLanguage": "English", + "city": "Lyon", + "country": "France", + "event": { + "name": null, + "link": null + }, + "gitRepository": null, + "videoLink": null, + "reachSpeaker": { + "twitter": null, + "github": "https://github.com/amontagu", + "vueDiscord": "Adrien Montagu#0597", + "email": null + }, + "description": "This presentation is only an example on how a speaker can share his presentation on this github." +} \ No newline at end of file diff --git a/src/presentations/README.md b/src/presentations/README.md new file mode 100644 index 0000000..4c6d2a7 --- /dev/null +++ b/src/presentations/README.md @@ -0,0 +1,21 @@ +--- +sidebar: auto +--- + +# Introduction + +## Introduction + +Vue.js Events is an effort to centralize all public presentation about Vue.js and associated library and framework. It allow to quiclky find a presentation by theme and year. It also allow event organizer to reuse presentation to share knowledge at local area without recreating presentation each time. + +// TODO more introduction ? Wording ? + +To submit your go to the end of the page or [click here](/presentations/#submit) + +# Discover + + + + + +# Submit \ No newline at end of file From c29fc95c5573232facabba96a984e6a22f337872 Mon Sep 17 00:00:00 2001 From: Montagu Adrien Date: Sun, 29 Mar 2020 18:15:52 +0200 Subject: [PATCH 02/12] filter working --- .../components/PresentationFilters.vue | 81 ++++++++++++++++++ src/.vuepress/components/PresentationList.vue | 83 ++++++++++++++++++- src/.vuepress/data/index.js | 4 +- .../Example/2020/My Example Presentation.json | 2 +- .../2019/My Example Presentation2.json | 19 +++++ 5 files changed, 183 insertions(+), 6 deletions(-) create mode 100644 src/.vuepress/components/PresentationFilters.vue create mode 100644 src/.vuepress/data/presentations/Example2/2019/My Example Presentation2.json diff --git a/src/.vuepress/components/PresentationFilters.vue b/src/.vuepress/components/PresentationFilters.vue new file mode 100644 index 0000000..4d57ce8 --- /dev/null +++ b/src/.vuepress/components/PresentationFilters.vue @@ -0,0 +1,81 @@ + + + + + \ No newline at end of file diff --git a/src/.vuepress/components/PresentationList.vue b/src/.vuepress/components/PresentationList.vue index d02fc36..ac725a9 100644 --- a/src/.vuepress/components/PresentationList.vue +++ b/src/.vuepress/components/PresentationList.vue @@ -1,10 +1,11 @@ @@ -87,7 +90,7 @@ export default { diff --git a/src/.vuepress/components/PresentationList.vue b/src/.vuepress/components/PresentationList.vue index 11c92b8..a21edd8 100644 --- a/src/.vuepress/components/PresentationList.vue +++ b/src/.vuepress/components/PresentationList.vue @@ -1,16 +1,26 @@ @@ -48,6 +58,12 @@ export default { // no -> remove all the presentation of this year // no -> remove all presentation of this theme return this.filterByTheme(presentationData, this.filters); + }, + filteredPresentationsCount() { + // This computed count all the presentation filtered + return Object.keys(this.presentationFiltered).reduce((count, theme) => { + return count + this.filteredPresentationsCountByTheme(theme); + }, 0); } }, methods: { @@ -109,7 +125,22 @@ export default { return false; } return true; + }, + filteredPresentationsCountByTheme(theme) { + // This methode count all the presentation filtered by theme + return Object.keys(this.presentationFiltered[theme]).reduce((count, year) => { + return count + this.presentationFiltered[theme][year].length; + }, 0); + }, + pluralize(text, number){ + return number > 1 ? text + "s" : text } } }; + + diff --git a/src/.vuepress/data/presentations/components/2018/Create your own component library.json b/src/.vuepress/data/presentations/Components/2018/Create your own component library.json similarity index 100% rename from src/.vuepress/data/presentations/components/2018/Create your own component library.json rename to src/.vuepress/data/presentations/Components/2018/Create your own component library.json diff --git a/src/.vuepress/data/presentations/pattern/2018/Setup a complex vue project.json b/src/.vuepress/data/presentations/Pattern/2018/Setup a complex vue project.json similarity index 100% rename from src/.vuepress/data/presentations/pattern/2018/Setup a complex vue project.json rename to src/.vuepress/data/presentations/Pattern/2018/Setup a complex vue project.json From b7e099df7959ad8c65f592f2f2d0a48103622a6a Mon Sep 17 00:00:00 2001 From: Montagu Adrien Date: Sat, 4 Apr 2020 15:32:30 +0200 Subject: [PATCH 08/12] add new line at the end of json files --- .../Components/2018/Create your own component library.json | 2 +- .../presentations/Pattern/2018/Setup a complex vue project.json | 2 +- .../data/presentations/Webpack/2020/The Vue on Webpack.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/.vuepress/data/presentations/Components/2018/Create your own component library.json b/src/.vuepress/data/presentations/Components/2018/Create your own component library.json index 755b0e7..74c29aa 100644 --- a/src/.vuepress/data/presentations/Components/2018/Create your own component library.json +++ b/src/.vuepress/data/presentations/Components/2018/Create your own component library.json @@ -18,4 +18,4 @@ "email": "adrienmontagu@gmail.com" }, "description": "Discover how to create your own component library." -} \ No newline at end of file +} diff --git a/src/.vuepress/data/presentations/Pattern/2018/Setup a complex vue project.json b/src/.vuepress/data/presentations/Pattern/2018/Setup a complex vue project.json index e0b8e7f..649218e 100644 --- a/src/.vuepress/data/presentations/Pattern/2018/Setup a complex vue project.json +++ b/src/.vuepress/data/presentations/Pattern/2018/Setup a complex vue project.json @@ -18,4 +18,4 @@ "email": "adrienmontagu@gmail.com" }, "description": "How create a good base for a complex project in Vue ? See how integrate vue-i18n, code splitting, automatic component registration, vuex namespace, with a bonus or login reusable logic (on the separate branch withLogin)" -} \ No newline at end of file +} diff --git a/src/.vuepress/data/presentations/Webpack/2020/The Vue on Webpack.json b/src/.vuepress/data/presentations/Webpack/2020/The Vue on Webpack.json index a22d371..0d129ba 100644 --- a/src/.vuepress/data/presentations/Webpack/2020/The Vue on Webpack.json +++ b/src/.vuepress/data/presentations/Webpack/2020/The Vue on Webpack.json @@ -18,4 +18,4 @@ "email": "adrienmontagu@gmail.com" }, "description": "Let discover how Vue and Webpack work together: Create complex dev server, adding custom plugin, understanding the vue webpack config and more. The slide are coming soon." -} \ No newline at end of file +} From 50adbb4657862ec112701d0063058a79423ba9c5 Mon Sep 17 00:00:00 2001 From: Montagu Adrien Date: Sat, 4 Apr 2020 15:45:03 +0200 Subject: [PATCH 09/12] change html comment --- src/.vuepress/components/PresentationList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.vuepress/components/PresentationList.vue b/src/.vuepress/components/PresentationList.vue index a21edd8..dd353f6 100644 --- a/src/.vuepress/components/PresentationList.vue +++ b/src/.vuepress/components/PresentationList.vue @@ -6,10 +6,10 @@
+

{{ theme }} ({{filteredPresentationsCountByTheme(theme)}} {{pluralize("presentation", filteredPresentationsCountByTheme(theme))}})

-

From 48ce0ddefcd119b864679638cd3bda89b9f27eeb Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Thu, 9 Apr 2020 09:55:56 -0400 Subject: [PATCH 10/12] Update src/.vuepress/config.js --- src/.vuepress/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index 9d94f27..5300b5b 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -54,7 +54,7 @@ module.exports = { link: '/presentations/#discover' }, { - text: "Submit your", + text: "Submit", link: '/presentations/#submit' }, ] From 25bc09ef7239a63ee3ef797af88642c66602514c Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Thu, 9 Apr 2020 09:56:58 -0400 Subject: [PATCH 11/12] Update src/presentations/README.md --- src/presentations/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/presentations/README.md b/src/presentations/README.md index 834e079..7ebd196 100644 --- a/src/presentations/README.md +++ b/src/presentations/README.md @@ -18,7 +18,7 @@ To submit your go to the end of the page or [click here](/presentations/#submit) ## Submit -This page is only interresting if YOU share your presentation with the community. +Sharing your presentation with the community is entirely voluntary. Adding your is really simple. You just have to create a pull request with a json file containing all the data about the presentation you want to share. From c18b262a20ad85e7b88f5fc7ff9de248902fa9ca Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Thu, 9 Apr 2020 09:57:53 -0400 Subject: [PATCH 12/12] Update language --- src/presentations/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/presentations/README.md b/src/presentations/README.md index 7ebd196..067bc72 100644 --- a/src/presentations/README.md +++ b/src/presentations/README.md @@ -20,7 +20,7 @@ To submit your go to the end of the page or [click here](/presentations/#submit) Sharing your presentation with the community is entirely voluntary. -Adding your is really simple. You just have to create a pull request with a json file containing all the data about the presentation you want to share. +To add your presentation, you need to create a pull request with a JSON file containing all the data about the presentation you want to share. Click here to see examples