Skip to content

Commit

Permalink
🔥 Remove manual method of adding links
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaoz-Topsy committed Dec 27, 2023
1 parent d27cd54 commit f28802b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 63 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ This project aims to be the "Yellow pages" of the NMS community. Our goal is to

## Submitting a Community Link

There are currently two methods of submitting Community Links:
- **Easy method**: Complete this form [airtable.com/shrhZOQrrp9a9zoJk](https://airtable.com/shrhZOQrrp9a9zoJk?ref=nmscdCommunitySearchReadMe)
Complete this form [airtable.com/shrhZOQrrp9a9zoJk](https://airtable.com/shrhZOQrrp9a9zoJk?ref=nmscdCommunitySearchReadMe)
- We will look at your application and move it to the public data if it meets our requirements.
- **Developer method**: You can add your community link to the [manualCommunityList.json](/seo/data/manualCommunityList.json) and then create a pull request.
- Please be sure to use urls to images that are publicly available (test your images in incognito mode)
- Please include contact info so that we can contact you if there are any issues


If your Community Link does not show up on the site after a day or two, feel free to contact the [AssistantNMS support email](mailto:[email protected]). Multiple members have access to the support system that monitors that email address. OR you can open an issue in this repository.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed public/assets/img/manual/alianza-banner.jpg
Binary file not shown.
Binary file removed public/assets/img/manual/alianza.png
Binary file not shown.
Binary file not shown.
34 changes: 0 additions & 34 deletions seo/data/manualCommunityList.json

This file was deleted.

25 changes: 2 additions & 23 deletions seo/node/getAirtableData.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const tables = {
name: 'Main',
view: 'VisibleCommunities',
json: 'communityList.json',
addititionalJson: 'manualCommunityList.json',
records: [
{
source: 'Name',
Expand Down Expand Up @@ -114,28 +113,8 @@ async function generateJsonFromAirtable() {
return;
}

let allData = [...allItems];
if (currentTable.addititionalJson != null) {
const manualString = fs.readFileSync(`./data/${currentTable.addititionalJson}`, { encoding: 'utf8' });
const manual = JSON.parse(manualString);

for (const manualItem of manual) {
let found = false;
for (let allDataIndex = 0; allDataIndex < allData.length; allDataIndex++) {
const allDataItem = allData[allDataIndex];
if (allDataItem.id != manualItem.id) continue;
allData[allDataIndex] = { ...manualItem };
found = true;
}
if (found == false) {
allData.push({ ...manualItem });
}
}

}

console.log('write file ' + allData.length);
fs.writeFile(`../src/assets/data/${currentTable.json}`, JSON.stringify(allData), ['utf8'], () => { });
console.log('write file ' + allItems.length);
fs.writeFile(`../src/assets/data/${currentTable.json}`, JSON.stringify(allItems), ['utf8'], () => { });
});
}
}
Expand Down

0 comments on commit f28802b

Please sign in to comment.