Update add-speaker-to-data.md

This commit is contained in:
niclaz 2024-10-09 18:00:41 +02:00 committed by GitHub
parent 01aa3383be
commit 2f372802da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,14 +8,14 @@ The main project website is [web3privacy.info](https://web3privacy.info) and is
Therefore to add a speaker to any of our websites you need to edit the code in the Data repository of Web3privacy Now, so that it auto-deploys a json output that is visible at [data.web3privacy.info](https://data.web3privacy.info), from where data and images for speakers are scrapped and presented elsewhere.
For example the main project website uses a web framework called Astro, which scrapes data.web3privacy.info and presents it with all the pretty HTML/CSS/JS elements needed for modern websites. This means that if you update a person's `caption:` field because they changed thier job title this edit will be displayed the same way throughout the whole website where that person is a speaker or otherwise listed. This is the power of Astro but as a result it requires a different approach to editing website contents, the majority of content is contained within the Data repository of Web3Privacy Now
For example the main project website uses a web framework called Astro, which scrapes data.web3privacy.info and presents it with all the pretty HTML/CSS/JS elements needed for modern websites. This means that if you update a person's `caption` field because they changed thier job title this edit will be displayed the same way throughout the whole website where that person is a speaker or otherwise listed. This is the power of Astro but as a result it requires a different approach to editing website contents, the majority of content is contained within the Data repository of Web3Privacy Now
#### Quick-reference:
[https://github.com/web3privacy/data](https://github.com/web3privacy/data)
## Pre-requisites
- Have a Github account to create a fork of this repository[https://github.com/web3privacy/data](https://github.com/web3privacy/data)
- Have a Github account to create a fork of this repository: [https://github.com/web3privacy/data](https://github.com/web3privacy/data)
- Have the person's information on hand (name, caption information, social media handles)
- Have a picture or image for the person to upload to the database (.png or .img format)
@ -44,8 +44,8 @@ refs:
- [ ] There is only one required data field for a valid person yaml:
```
- name:
```
- [ ] the following are optional data fields, which you should try to fill in to make the person profile look nice online
```
- nickname:
@ -55,13 +55,14 @@ refs:
- imageUrl: (only to be used if the image is not within the _images folder)
```
- [ ] For the full schema and what each of these data fields are requesting see [data/schema/index.yaml between lines 104 - 142](https://github.com/web3privacy/data/blob/main/schema/index.yaml) - Please note that some data fields such as `id:` and `thumbs` are not meant to listed in the person yaml file.
- [ ] For the `refs` data field
- [ ] For the full schema and what each of these data fields are requesting see [data/schema/index.yaml between lines 104 - 142](https://github.com/web3privacy/data/blob/main/schema/index.yaml)
- [ ] Please note that some data fields such as `id` and `thumbs` are not meant to listed in the person yaml file.
- [ ] For the `refs` data field it is very important to list only the handles and that each 'sub-category' is indented by two spaces after the `refs` field
- [ ] To see a full example of what this looks like scroll to the bottom of this guide.
### Part 3: Upload the person image
- [ ] Once you added the new yaml file, navigate to the _images folder within /people: [https://github.com/web3privacy/data/tree/main/src/people/_images](https://github.com/web3privacy/data/tree/main/src/people/_images)
- [ ] Here is where you will be uploading an image for the person using the same name for the image as the yaml file. This is important for the database to assign the right image to the right person, please check the file name is correct prior to uploading your files to your forked code.
- **Using the example code** the satoshi-nakamoto.yaml will have an associated image file named satoshi-nakamoto.png within the /_images folder
- [ ] Here is where you will be uploading an image for the person using the same name for the image as the yaml file. This is important for the database to assign the right image to the right person, please check the file name is correct prior to uploading your files to your forked code. **Using the example code** satoshi-nakamoto.yaml will have an associated image file named satoshi-nakamoto.png
- [ ] If you want to person image to reference some external source, you can use the `imageUrl:` field to paste in the full URL of the image.
- [ ] At this point you should try to run the Github Pages deployment script from you fork using Github Actions to test if nothing is breaking. This leverages the [test.js script of the code](https://github.com/web3privacy/data/blob/main/utils/test.js)and will flag any issues and show you which yaml file has an error in it. Allowing you to fix any error prior to merging your Pull Request with the main branch of the codebase.
- [ ] If all looks good, all new persons added and their respective images, then push the Pull Request to the maintainers.
@ -73,12 +74,12 @@ refs:
- [ ] Check the event listed in visible on data.web3privacy.info and that images and thumbs have been properly generated by scripts
### Tips & Tooling
- [ ] One good practice would be to first copy a person entry and then replacing the relevant information within with the new person data and renaming the yaml file (or use the example satoshi enty in this guide)
- [ ] CAUTION: respect the indentation of the data entries in the yaml files - this is especially relevant for the `refs:` field which has sub-categories which each need to have two spaces outwards from where the `refs:` field is (see above for example)
- [ ] CAUTION: if the `country` data field does not follow the [ISO-3166-1 Alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) the tests will fail - [see events.js within the web codebase for full list of countries](https://github.com/web3privacy/web/blob/main/src/lib/events.js)
- [ ] CAUTION: if the `country` data field is two CAPITALISED letters the tests will fail - **only use lowercase for country codes**
- [ ] CAUTION: data within `refs` data field does not need the http://domain.com/ section, only the handle or username of the person (exception to this is the `email` sub-category)
- [ ] KNOWN BUG: within the `caption` field you can add URL hyperlinks using markdown, but due to an issue with YAML parsing the url cannot contain certain characters such as `-` - this bug has been [reported in the following issue in the repository](https://github.com/web3privacy/data/issues/12)
- One good practice would be to first copy a person entry and then replacing the relevant information within with the new person data and renaming the yaml file (or use the example satoshi enty in this guide)
- CAUTION: respect the indentation of the data entries in the yaml files - this is especially relevant for the `refs` field which has sub-categories which each need to have two spaces outwards from where the `refs` field is (see example below)
- CAUTION: if the `country` data field does not follow the [ISO-3166-1 Alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) the tests will fail - [see events.js within the web codebase for full list of countries](https://github.com/web3privacy/web/blob/main/src/lib/events.js)
- CAUTION: if the `country` data field is two CAPITALISED letters the tests will fail - **only use lowercase for country codes**
- CAUTION: data within `refs` data field does not need the http://domain.com/ section, only the handle or username of the person (exception to this is the `email` sub-category)
- KNOWN BUG: within the `caption` field you can add URL hyperlinks using markdown, but due to an issue with YAML parsing the url cannot contain certain characters such as `-` this bug has been [reported in the following issue in the repository](https://github.com/web3privacy/data/issues/12)
### Troubleshooting