Skip to content

Commit

Permalink
fix: reorder and separate earn and hiring
Browse files Browse the repository at this point in the history
  • Loading branch information
monotykamary committed Oct 24, 2023
1 parent 2c5870b commit 431aec8
Show file tree
Hide file tree
Showing 7 changed files with 392 additions and 129 deletions.
21 changes: 7 additions & 14 deletions _templater/Refresh Guild.md → _templater/Refresh Earn.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<%*
const dv = this.app.plugins.plugins["dataview"].api;
const guildPage = dv.pages(`"guild.md"`);
const earnPage = dv.pages(`"earn/_index.md"`);

for (const element of guildPage) {
for (const element of earnPage) {
let content = "---\n";
for (const prop in element.file.frontmatter) {
const value = element.file.frontmatter[prop]
Expand All @@ -19,25 +19,18 @@ for (const element of guildPage) {
"[[" + file.path + "|" + title + "]]" as title,
bounty + " ICY" as bounty,
status
FROM "earn"
FROM "earn" and !"_templates" and !"_templater" and !"_index" and !"site-index" and !"README"
WHERE status = "Open"
AND title != NULL
SORT status DESC
`);
content += `## Earn and Bounty Program\n\n`;
content += `Our earn and bounty program for all of the open-source work we do at Console Labs. A good portion of the earns and bounties help to improve quality-of-life for our community, creating bots and extensions for our messaging apps, and more serious work such as aggregating data from blockchains.\n\n`
content += earnArticles.value

const hiringArticles = await dv.queryMarkdown(`
LIST
FROM "hiring"
`);
content += `## Hiring\n\n`;
content += ``
content += hiringArticles.value
content += `Our earn and bounty program for all of the open-source work we do at Console Labs. A good portion of the earns and bounties help to improve quality-of-life for our community, creating bots and extensions for our messaging apps, and more serious work such as aggregating data from blockchains.\n\n`;
content += earnArticles.value;

// get folder and file path
const filePath = app.vault.getAbstractFileByPath(element.file.path);
const folder = app.vault.getAbstractFileByPath(element.file.folder)
const folder = app.vault.getAbstractFileByPath(element.file.folder);

// delete the file
await app.vault.trash(filePath, true);
Expand Down
41 changes: 41 additions & 0 deletions _templater/Refresh Hiring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<%*
const dv = this.app.plugins.plugins["dataview"].api;
const hiringPage = dv.pages(`"hiring/_index.md"`);
const readme = dv.pages(`"hiring/README.md"`);
const readmeFile = await app.vault.getAbstractFileByPath(readme[0].file.path);
const readmeContent = await app.vault.read(readmeFile);
console.log(readmeContent);

for (const element of hiringPage) {
let content = "---\n";
for (const prop in element.file.frontmatter) {
const value = element.file.frontmatter[prop]
if (Array.isArray(value) && value.length > 0) {
content += `${prop}: \n - ${value.join("\n - ")}\n`;
} else {
content += `${prop}: ${value}\n`;
}
}
content += "---\n";

const hiringArticles = await dv.queryMarkdown(`
LIST WITHOUT ID
"[[" + file.path + "|" + title + "]]"
FROM "hiring" and !"_templates" and !"_templater" and !"_index" and !"site-index" and !"README"
WHERE title != NULL
`);
content += hiringArticles.value;
content += `\n\n---\n\n`;
content += readmeContent;

// get folder and file path
const filePath = app.vault.getAbstractFileByPath(element.file.path);
const folder = app.vault.getAbstractFileByPath(element.file.folder);

// delete the file
await app.vault.trash(filePath, true);

// create a new file with the matching template
await tp.file.create_new(content, element.file.name, false, folder);
}
%>
4 changes: 2 additions & 2 deletions _templater/Refresh Members' Profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for (const element of membersList) {
TABLE WITHOUT ID
"![avatar\|100x100](" + avatar + ")" as ${element.file.name},
join(social, "<br>") as contact
FROM "members"
FROM "members" and !"_templates" and !"_templater" and !"_index" and !"site-index" and !"README
WHERE file.name = "${element.file.name}"
`);
content += `<div class="profile"/>\n\n${profileTable.value}\n`;
Expand All @@ -32,7 +32,7 @@ for (const element of membersList) {
console.log(content, element.file.name);
// get folder and file path
const filePath = app.vault.getAbstractFileByPath(element.file.path);
const folder = app.vault.getAbstractFileByPath(element.file.folder)
const folder = app.vault.getAbstractFileByPath(element.file.folder);

// delete the file
await app.vault.trash(filePath, true);
Expand Down
34 changes: 8 additions & 26 deletions guild.md → earn/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags:
- dwarves
- work
title: Dwarves Guild
title: Dwarves Earn
date: 2023-10-19
description: null
authors:
Expand All @@ -18,29 +18,11 @@ Our earn and bounty program for all of the open-source work we do at Console Lab

| title | bounty | status |
| ------------------------------------------------------------------------------------------------ | ------- | ------ |
| [[earn/consulting-map.md\|Consulting record webpage]] | 80 ICY | Open |
| [[earn/dwarvesf-map.md\|A webpage showing where the Dwarves from]] | 80 ICY | Open |
| [[earn/fortress-mma-score.md\|Fortress: MMA data]] | 120 ICY | Open |
| [[earn/fortress-shanky-data.md\|Fortress: API to show shanky data]] | 120 ICY | Open |
| [[earn/fleeting-notes.md\|A discord cmd to receive a link, and create a brainery fleeting note]] | 60 ICY | Open |
| [[earn/tech-radar-report.md\|Tech radar status report]] | 60 ICY | Open |
| [[earn/tech-radar-status.md\|Tech radar status report]] | 60 ICY | Open |
| [[earn/trend-command.md\|?trend command]] | 60 ICY | Open |
## Hiring

- [[hiring/README.md|README]]
- [[hiring/additional-info/benefits-and-perks.md|benefits-and-perks]]
- [[hiring/additional-info/how-we-hire.md|how-we-hire]]
- [[hiring/additional-info/how-we-work.md|how-we-work]]
- [[hiring/additional-info/making-a-career.md|making-a-career]]
- [[hiring/additional-info/what-we-stand-for.md|what-we-stand-for]]
- [[hiring/additional-info/what-we-value.md|what-we-value]]
- [[hiring/additional-info/where-we-work.md|where-we-work]]
- [[hiring/open-positions/Android.md|Android]]
- [[hiring/open-positions/Apprentice.md|Apprentice]]
- [[hiring/open-positions/Frontend.md|Frontend]]
- [[hiring/open-positions/Golang.md|Golang]]
- [[hiring/open-positions/Growth.md|Growth]]
- [[hiring/open-positions/Intern.md|Intern]]
- [[hiring/open-positions/QA.md|QA]]
- [[hiring/open-positions/iOS.md|iOS]]
| [[earn/tech-radar-status.md\|Tech radar status report]] | 60 ICY | Open |
| [[earn/tech-radar-report.md\|Tech radar status report]] | 60 ICY | Open |
| [[earn/fleeting-notes.md\|A discord cmd to receive a link, and create a brainery fleeting note]] | 60 ICY | Open |
| [[earn/fortress-shanky-data.md\|Fortress: API to show shanky data]] | 120 ICY | Open |
| [[earn/fortress-mma-score.md\|Fortress: MMA data]] | 120 ICY | Open |
| [[earn/dwarvesf-map.md\|A webpage showing where the Dwarves from]] | 80 ICY | Open |
| [[earn/consulting-map.md\|Consulting record webpage]] | 80 ICY | Open |
Loading

0 comments on commit 431aec8

Please sign in to comment.