Skip to content

Commit

Permalink
feat: talks are linked by their title to the github file (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal authored Jan 5, 2022
1 parent 910a278 commit 9b23eeb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
24 changes: 12 additions & 12 deletions __tests__/__snapshots__/main.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ exports[`given a directory of markdown files a full document is rendered 1`] = `
| Date | Event | Title | Slides | Recording | Location | Language |
| ---- | ----- | ----- | ------ | --------- | -------- | -------- |
| 2021-7-21 | Cyber Week | Are We Forever Doomed By Software Supply Chain Risks? | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-6-13 | Cyber Week | Are We Forever Doomed By Software Supply Chain Risks? | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-1-1 | Cyber Week | Are We Forever Doomed By Software Supply Chain Risks? | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-7-21 | Cyber Week | [Are We Forever Doomed By Software Supply Chain Risks?](myapp/pages/2021/2021-07-21.md) | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-6-13 | Cyber Week | [Are We Forever Doomed By Software Supply Chain Risks?](myapp/pages/2021/2021-06-13.md) | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-1-1 | Cyber Week | [Are We Forever Doomed By Software Supply Chain Risks?](myapp/pages/2021/2021-01-01.md) | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
# 2019
Expand All @@ -31,9 +31,9 @@ exports[`given a directory of markdown files a full document is rendered 1`] = `
| Date | Event | Title | Slides | Recording | Location | Language |
| ---- | ----- | ----- | ------ | --------- | -------- | -------- |
| 2019-9-27 | JSConf Budapest | StrangerDanger: Finding Security Vulnerabilities Before They Find You! | | [Recording](https://www.youtube.com/watch?v=3H8pF6yoSgU&list=PL37ZVnwpeshEMCvdYDdZ09Sy-toTftWu0&index=15&ab_channel=JSConf) | HU | English |
| 2019-9-15 | JSConf Budapest | StrangerDanger: Finding Security Vulnerabilities Before They Find You! | | [Recording](https://www.youtube.com/watch?v=3H8pF6yoSgU&list=PL37ZVnwpeshEMCvdYDdZ09Sy-toTftWu0&index=15&ab_channel=JSConf) | HU | English |
| 2019-9-12 | APIdays Barcelona | Consumer-Driven Contracts: A better approach for API Testing | [Slides](https://slides.com/lirantal/consumer-driven-contracts) | [Recording](https://www.youtube.com/watch?v=zfGKX5iKSis&list=PLmEaqnTJ40Oqo9VlbcUakVmFZgx5weLrs&index=25&t=141s&ab_channel=apidays) | ES | English |
| 2019-9-27 | JSConf Budapest | [StrangerDanger: Finding Security Vulnerabilities Before They Find You!](myapp/pages/2019/2019-09-27.md) | | [Recording](https://www.youtube.com/watch?v=3H8pF6yoSgU&list=PL37ZVnwpeshEMCvdYDdZ09Sy-toTftWu0&index=15&ab_channel=JSConf) | HU | English |
| 2019-9-15 | JSConf Budapest | [StrangerDanger: Finding Security Vulnerabilities Before They Find You!](myapp/pages/2019/2019-09-15.md) | | [Recording](https://www.youtube.com/watch?v=3H8pF6yoSgU&list=PL37ZVnwpeshEMCvdYDdZ09Sy-toTftWu0&index=15&ab_channel=JSConf) | HU | English |
| 2019-9-12 | APIdays Barcelona | [Consumer-Driven Contracts: A better approach for API Testing](myapp/pages/2019/2019-09-12.md) | [Slides](https://slides.com/lirantal/consumer-driven-contracts) | [Recording](https://www.youtube.com/watch?v=zfGKX5iKSis&list=PLmEaqnTJ40Oqo9VlbcUakVmFZgx5weLrs&index=25&t=141s&ab_channel=apidays) | ES | English |
Expand Down Expand Up @@ -63,9 +63,9 @@ Liran Tal
| Date | Event | Title | Slides | Recording | Location | Language |
| ---- | ----- | ----- | ------ | --------- | -------- | -------- |
| 2021-7-21 | Cyber Week | Are We Forever Doomed By Software Supply Chain Risks? | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-6-13 | Cyber Week | Are We Forever Doomed By Software Supply Chain Risks? | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-1-1 | Cyber Week | Are We Forever Doomed By Software Supply Chain Risks? | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-7-21 | Cyber Week | [Are We Forever Doomed By Software Supply Chain Risks?](myapp/pages/2021/2021-07-21.md) | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-6-13 | Cyber Week | [Are We Forever Doomed By Software Supply Chain Risks?](myapp/pages/2021/2021-06-13.md) | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
| 2021-1-1 | Cyber Week | [Are We Forever Doomed By Software Supply Chain Risks?](myapp/pages/2021/2021-01-01.md) | | [Recording](https://www.youtube.com/watch?v=x74sMCaZKbg&ab_channel=Snyk) | IL | English |
# 2019
Expand All @@ -76,9 +76,9 @@ Liran Tal
| Date | Event | Title | Slides | Recording | Location | Language |
| ---- | ----- | ----- | ------ | --------- | -------- | -------- |
| 2019-9-27 | JSConf Budapest | StrangerDanger: Finding Security Vulnerabilities Before They Find You! | | [Recording](https://www.youtube.com/watch?v=3H8pF6yoSgU&list=PL37ZVnwpeshEMCvdYDdZ09Sy-toTftWu0&index=15&ab_channel=JSConf) | HU | English |
| 2019-9-15 | JSConf Budapest | StrangerDanger: Finding Security Vulnerabilities Before They Find You! | | [Recording](https://www.youtube.com/watch?v=3H8pF6yoSgU&list=PL37ZVnwpeshEMCvdYDdZ09Sy-toTftWu0&index=15&ab_channel=JSConf) | HU | English |
| 2019-9-12 | APIdays Barcelona | Consumer-Driven Contracts: A better approach for API Testing | [Slides](https://slides.com/lirantal/consumer-driven-contracts) | [Recording](https://www.youtube.com/watch?v=zfGKX5iKSis&list=PLmEaqnTJ40Oqo9VlbcUakVmFZgx5weLrs&index=25&t=141s&ab_channel=apidays) | ES | English |
| 2019-9-27 | JSConf Budapest | [StrangerDanger: Finding Security Vulnerabilities Before They Find You!](myapp/pages/2019/2019-09-27.md) | | [Recording](https://www.youtube.com/watch?v=3H8pF6yoSgU&list=PL37ZVnwpeshEMCvdYDdZ09Sy-toTftWu0&index=15&ab_channel=JSConf) | HU | English |
| 2019-9-15 | JSConf Budapest | [StrangerDanger: Finding Security Vulnerabilities Before They Find You!](myapp/pages/2019/2019-09-15.md) | | [Recording](https://www.youtube.com/watch?v=3H8pF6yoSgU&list=PL37ZVnwpeshEMCvdYDdZ09Sy-toTftWu0&index=15&ab_channel=JSConf) | HU | English |
| 2019-9-12 | APIdays Barcelona | [Consumer-Driven Contracts: A better approach for API Testing](myapp/pages/2019/2019-09-12.md) | [Slides](https://slides.com/lirantal/consumer-driven-contracts) | [Recording](https://www.youtube.com/watch?v=zfGKX5iKSis&list=PLmEaqnTJ40Oqo9VlbcUakVmFZgx5weLrs&index=25&t=141s&ab_channel=apidays) | ES | English |
Expand Down
3 changes: 3 additions & 0 deletions __tests__/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ test('given a directory of markdown files a full document is rendered', async ()

test('given a directory of markdown files a full document is rendered along with pre and post content', async () => {
const filePath = path.join(__dirname, './__fixtures__/main-datafiles')
console.log('---------------------------->')
console.log(filePath)
console.log('---------------------------->')
const jsonResult = await generateDocument({
sourceDirectory: filePath,
preContent: [
Expand Down
8 changes: 8 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ async function generateGigs({ sourceDirectory }) {
const entries = []
for (const filePath of allFilesFlatList) {
const json = await convertToJson(filePath)

// push the relative path to the file as part of the data object
let fileDirectoryPath = path.relative(directoryPath, filePath)
if (!path.isAbsolute(sourceDirectory)) {
fileDirectoryPath = path.join(sourceDirectory, fileDirectoryPath)
}
json.fileRelativePath = fileDirectoryPath

entries.push(json)
}

Expand Down
7 changes: 6 additions & 1 deletion src/utils/md-formatter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json2md from 'json2md'
import path from 'path'

export function formatToMarkdown(data) {
return json2md(data)
Expand Down Expand Up @@ -87,10 +88,14 @@ function eventsListForYear(eventsOfYear) {
event.attributes.date.getMonth() + 1
}-${event.attributes.date.getDate()}`

const pathToFileOnGitHub = encodeURI(event.fileRelativePath)

eventsTableEntries.push({
Date: eventDate,
Event: event.attributes.name,
Title: event.attributes.title,
Title: event.fileRelativePath
? `[${event.attributes.title}](${pathToFileOnGitHub})`
: event.attributes.title,
Slides: event.attributes.slides_url
? `[Slides](${event.attributes.slides_url})`
: '',
Expand Down

0 comments on commit 9b23eeb

Please sign in to comment.