Fixed issues with referenced by not getting all references

This commit is contained in:
thepaperpilot 2024-06-26 09:33:17 -05:00
parent 70ad2d0b28
commit 1a760570ee
17 changed files with 43 additions and 13 deletions

View file

@ -71,7 +71,7 @@ function moveImportStatementUp(filePath, times = 1) {
await walk("./Garden/pages", (dir, file, resolve) => { await walk("./Garden/pages", (dir, file, resolve) => {
const filePath = path.resolve(dir, file); const filePath = path.resolve(dir, file);
let data = fs.readFileSync(filePath).toString(); let data = fs.readFileSync(filePath).toString();
if (!data.match(/public::/g)) { if (data.match(/public::/g) == null) {
resolve(); resolve();
return; return;
} }
@ -98,9 +98,22 @@ function moveImportStatementUp(filePath, times = 1) {
}); });
} }
resolve();
});
await walk("./Garden/pages", (dir, file, resolve) => {
const filePath = path.resolve(dir, file);
let data = fs.readFileSync(filePath).toString();
if (data.match(/public::/g) == null) {
resolve();
return;
}
const name = path.basename(file, ".md").replaceAll('___', '/');
const slug = toSlug(name).replaceAll(/%3F/gi, '').replaceAll('\'', '-');
if (!indices.includes(slug)) { if (!indices.includes(slug)) {
for (const match of data.matchAll(/\[\[([^\[\]]*)\]\]/g)) { for (const match of data.matchAll(/\[\[([^\[\]]*)\]\]/g)) {
const pageSlug = toSlug(match[1]); const pageSlug = pageLinks[match[1]];
referencedBy[pageSlug] = [...(referencedBy[pageSlug] ?? []), name]; referencedBy[pageSlug] = [...(referencedBy[pageSlug] ?? []), name];
} }
} }
@ -172,10 +185,11 @@ function moveImportStatementUp(filePath, times = 1) {
`---\n\n> Tagged by: ${taggedBy[title].map(tag => `[${tag}](${pageLinks[tag]})`).join(", ")}\n\n`); `---\n\n> Tagged by: ${taggedBy[title].map(tag => `[${tag}](${pageLinks[tag]})`).join(", ")}\n\n`);
} }
// TODO show context on references? Perhaps in a `::: info` block? // TODO show context on references? Perhaps in a `::: info` block?
if (title in referencedBy) { const pageTitle = data.match(/title: "(.+)"/)[1];
if (pageLinks[pageTitle] in referencedBy) {
data = data.replaceAll( data = data.replaceAll(
/---\n\n/gm, /---\n\n/gm,
`---\n\n> Referenced by: ${referencedBy[title].map(tag => `[${tag}](${pageLinks[tag]})`).join(", ")}\n\n`); `---\n\n> Referenced by: ${referencedBy[pageLinks[pageTitle]].map(tag => `[${tag}](${pageLinks[tag]})`).join(", ")}\n\n`);
} }
// Fix links to /now // Fix links to /now
data = data.replace('NOW', '/now') data = data.replace('NOW', '/now')
@ -192,7 +206,7 @@ import { data } from '${path.relative(path.resolve("site", relPath), path.resolv
import { useData } from 'vitepress'; import { useData } from 'vitepress';
const pageData = useData(); const pageData = useData();
</script> </script>
<h1 class="p-name">${data.match(/title: "(.+)"/)[1]}</h1> <h1 class="p-name">${pageTitle}</h1>
<p>${wc} words, ~${Math.round(wc / 183)} minute read. <span v-html="data[\`site/\${pageData.page.value.relativePath}\`]" /></p> <p>${wc} words, ~${Math.round(wc / 183)} minute read. <span v-html="data[\`site/\${pageData.page.value.relativePath}\`]" /></p>
<hr/> <hr/>
\n`); \n`);

View file

@ -14,7 +14,7 @@ const pageData = useData();
<p>23 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>23 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Commune](/garden/commune/index.md) > Referenced by: [Commune](/garden/commune/index.md), [My Personal Website](/garden/my-personal-website/index.md), [The Small Web](/garden/the-small-web/index.md)
A theoretical chat system designed to solve the problems of transcribing branching conversations into linear timelines. A theoretical chat system designed to solve the problems of transcribing branching conversations into linear timelines.

View file

@ -14,7 +14,7 @@ const pageData = useData();
<p>144 words, ~1 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>144 words, ~1 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Federated Identity](/garden/federated-identity/index.md), [/now](/now/index), [Webrings](/garden/webrings/index.md), [Weird](/garden/weird/index.md) > Referenced by: [Federated Identity](/garden/federated-identity/index.md), [My Personal Website](/garden/my-personal-website/index.md), [/now](/now/index), [Webrings](/garden/webrings/index.md), [Weird](/garden/weird/index.md)
An [Open Source](/garden/open-source/index.md) [Matrix](/garden/matrix/index.md) web client built to be better for communities than anything else out there An [Open Source](/garden/open-source/index.md) [Matrix](/garden/matrix/index.md) web client built to be better for communities than anything else out there
- Currently in development - Currently in development

View file

@ -15,7 +15,7 @@ const pageData = useData();
<p>67 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>67 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Chronological](/garden/chronological/index.md), [Commune](/garden/commune/index.md), [Garden-RSS](/garden/garden-rss/index.md), [The Cozy Web](/garden/the-cozy-web/index.md), [The Small Web](/garden/the-small-web/index.md) > Referenced by: [Chronological](/garden/chronological/index.md), [Commune](/garden/commune/index.md), [Garden-RSS](/garden/garden-rss/index.md), [The Cozy Web](/garden/the-cozy-web/index.md), [The Small Web](/garden/the-small-web/index.md), [This Knowledge Hub](/garden/this-knowledge-hub/index.md)
Digital Gardens are [Freeform](/garden/freeform/index.md) collections of information made by an individual or community Digital Gardens are [Freeform](/garden/freeform/index.md) collections of information made by an individual or community
- Alternatives to [Chronological](/garden/chronological/index.md) personal blogs - Alternatives to [Chronological](/garden/chronological/index.md) personal blogs

View file

@ -16,7 +16,7 @@ const pageData = useData();
<p>68 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>68 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Commune](/garden/commune/index.md), [Weird](/garden/weird/index.md) > Referenced by: [Commune](/garden/commune/index.md), [Fedi v2](/garden/fedi-v2/index.md), [Weird](/garden/weird/index.md)
> Tags: [Decentralized](/garden/decentralized/index.md) > Tags: [Decentralized](/garden/decentralized/index.md)

View file

@ -14,7 +14,7 @@ const pageData = useData();
<p>1652 words, ~9 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>1652 words, ~9 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Social Media](/garden/social-media/index.md), [Weird](/garden/weird/index.md) > Referenced by: [Social Media](/garden/social-media/index.md), [The IndieWeb/Signature Blocks](/garden/the-indieweb/signature-blocks/index.md), [Weird](/garden/weird/index.md)
A placeholder name for a theoretical new federated network that is client-centric, in contrast to the server-centric [Fediverse](/garden/fediverse/index.md). Many of the ideas here will be implemented as described or similarly by people much smarter than me as part of [Agentic Federation on Iroh](https://github.com/commune-os/weird/discussions/32), an initiative by the [Weird](/garden/weird/index.md) developers. A placeholder name for a theoretical new federated network that is client-centric, in contrast to the server-centric [Fediverse](/garden/fediverse/index.md). Many of the ideas here will be implemented as described or similarly by people much smarter than me as part of [Agentic Federation on Iroh](https://github.com/commune-os/weird/discussions/32), an initiative by the [Weird](/garden/weird/index.md) developers.

View file

@ -16,7 +16,7 @@ const pageData = useData();
<p>29 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>29 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [ATProto](/garden/atproto/index.md), [Decentralized](/garden/decentralized/index.md), [Fedi v2](/garden/fedi-v2/index.md), [Incremental Social](/garden/incremental-social/index.md), [Mbin](/garden/mbin/index.md), [Weird](/garden/weird/index.md) > Referenced by: [ActivityPub](/garden/activitypub/index.md), [ATProto](/garden/atproto/index.md), [Decentralized](/garden/decentralized/index.md), [Fedi v2](/garden/fedi-v2/index.md), [Incremental Social](/garden/incremental-social/index.md), [Mbin](/garden/mbin/index.md), [Nostr](/garden/nostr/index.md), [Social Media](/garden/social-media/index.md), [The Small Web](/garden/the-small-web/index.md), [Weird](/garden/weird/index.md)
> Tags: [Decentralized](/garden/decentralized/index.md) > Tags: [Decentralized](/garden/decentralized/index.md)

View file

@ -14,6 +14,8 @@ const pageData = useData();
<p>636 words, ~3 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>636 words, ~3 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Digital Gardens](/garden/digital-gardens/index.md), [Incremental Social](/garden/incremental-social/index.md), [Kronos](/garden/kronos/index.md), [My Personal Website](/garden/my-personal-website/index.md), [Social Media](/garden/social-media/index.md)
There are a lot of developers in the incremental games community - the genre seems to draw them in, and convert a lot of players _into_ developers. Let's explore the reasons why this genre appeals to developers. There are a lot of developers in the incremental games community - the genre seems to draw them in, and convert a lot of players _into_ developers. Let's explore the reasons why this genre appeals to developers.
## Incrementals are Easy to Make ## Incrementals are Easy to Make

View file

@ -14,6 +14,8 @@ const pageData = useData();
<p>2166 words, ~12 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>2166 words, ~12 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Digital Gardens](/garden/digital-gardens/index.md), [Incremental Social](/garden/incremental-social/index.md), [Kronos](/garden/kronos/index.md), [My Personal Website](/garden/my-personal-website/index.md), [Social Media](/garden/social-media/index.md)
This is something that has been discussed and analyzed by many people, and to some extent, I feel like everything that can be said on the topic already has. However, a lot of these analyses are from the perspective of those with not as much experience and involvement within the genre as I'd argue would be necessary for a fully contextualized answer. I'm interested in ludology and part of that includes interpreting games as art, and to that end what constitutes a game, let alone a "good game". Incremental games are oft criticized, unfairly in my biased opinion, of not even constituting games, such as was posited by [this polygon article](https://www.polygon.com/2013/9/30/4786780/the-cult-of-the-cookie-clicker-when-is-a-game-not-a-game). This is something that has been discussed and analyzed by many people, and to some extent, I feel like everything that can be said on the topic already has. However, a lot of these analyses are from the perspective of those with not as much experience and involvement within the genre as I'd argue would be necessary for a fully contextualized answer. I'm interested in ludology and part of that includes interpreting games as art, and to that end what constitutes a game, let alone a "good game". Incremental games are oft criticized, unfairly in my biased opinion, of not even constituting games, such as was posited by [this polygon article](https://www.polygon.com/2013/9/30/4786780/the-cult-of-the-cookie-clicker-when-is-a-game-not-a-game).
## Numbers Going Up ## Numbers Going Up

View file

@ -14,6 +14,8 @@ const pageData = useData();
<p>3429 words, ~19 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>3429 words, ~19 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Digital Gardens](/garden/digital-gardens/index.md), [Incremental Social](/garden/incremental-social/index.md), [Kronos](/garden/kronos/index.md), [My Personal Website](/garden/my-personal-website/index.md), [Social Media](/garden/social-media/index.md)
Video games are placed into genres for a variety of reasons. They can give a mental shorthand to set the player's expectations up, they can help a game market itself by its similarities to other, already popular games, and honestly, people just love categorization for its own sake. For this guide, it's important to define the genre so it is clear what games it's even talking about. Video games are placed into genres for a variety of reasons. They can give a mental shorthand to set the player's expectations up, they can help a game market itself by its similarities to other, already popular games, and honestly, people just love categorization for its own sake. For this guide, it's important to define the genre so it is clear what games it's even talking about.
This poses a problem. "Incremental" is a _horribly_ vague way to define games. _Most_ games have numbers going up in some form or another. We need a more specific definition - similar to how "strategy" can't just mean any game with _any_ amount of strategy because that would be _most_ games. What specifically differentiates incremental games from the rest? This poses a problem. "Incremental" is a _horribly_ vague way to define games. _Most_ games have numbers going up in some form or another. We need a more specific definition - similar to how "strategy" can't just mean any game with _any_ amount of strategy because that would be _most_ games. What specifically differentiates incremental games from the rest?

View file

@ -14,6 +14,8 @@ const pageData = useData();
<p>747 words, ~4 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>747 words, ~4 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Digital Gardens](/garden/digital-gardens/index.md), [Incremental Social](/garden/incremental-social/index.md), [Kronos](/garden/kronos/index.md), [My Personal Website](/garden/my-personal-website/index.md), [Social Media](/garden/social-media/index.md)
Developing games is fun and exciting and teaches a lot of wonderful skills - I enthusiastically encourage anyone with an interest in game development to try it out - and incremental games are a wonderful way to get started. However, there are many challenges young and inexperienced developers have to face, and I think the hardest one - harder than coding, debugging, balancing, etc. - is handling criticism. When you put your heart and soul into a game it is natural to feel very vulnerable. While I think there's a lot communities can do to ensure they're welcoming, positive and constructive with their criticisms, inevitably you will eventually read some, and potentially a lot, of comments that can deeply affect you. No one is immune to this, from young incremental game developers to the largest content creators you can think of. That's why it's important to be able to process and navigate criticism, because ultimately collecting feedback is essential to the journey to becoming a better developer. On this page, we'll explore how to embrace criticism, grow from it, and continue to post your games publicly with confidence. Developing games is fun and exciting and teaches a lot of wonderful skills - I enthusiastically encourage anyone with an interest in game development to try it out - and incremental games are a wonderful way to get started. However, there are many challenges young and inexperienced developers have to face, and I think the hardest one - harder than coding, debugging, balancing, etc. - is handling criticism. When you put your heart and soul into a game it is natural to feel very vulnerable. While I think there's a lot communities can do to ensure they're welcoming, positive and constructive with their criticisms, inevitably you will eventually read some, and potentially a lot, of comments that can deeply affect you. No one is immune to this, from young incremental game developers to the largest content creators you can think of. That's why it's important to be able to process and navigate criticism, because ultimately collecting feedback is essential to the journey to becoming a better developer. On this page, we'll explore how to embrace criticism, grow from it, and continue to post your games publicly with confidence.
## Reading Feedback ## Reading Feedback

View file

@ -14,6 +14,8 @@ const pageData = useData();
<p>2092 words, ~11 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>2092 words, ~11 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Digital Gardens](/garden/digital-gardens/index.md), [Incremental Social](/garden/incremental-social/index.md), [Kronos](/garden/kronos/index.md), [My Personal Website](/garden/my-personal-website/index.md), [Social Media](/garden/social-media/index.md)
If you've been in the incremental games community for any amount of time, you'll quickly find the number one thing players want is _content_. They want as much of it as possible! The most popular incremental games have tons of content, so they just keep stretching on and on and on, introducing mechanic after mechanic, and players love it. In fact, players seem to value the _amount_ of content over the quality of any _specific_ content. However, there's a bit of a lack of understanding concerning _what_ content is, and I'd like to explore what counts as content, and how we measure it. As a baseline definition, I think "content" can just be described as the parts of the game that engage the player, but to truly understand it we need to contextualize what that means and how it affects the gameplay experience. If you've been in the incremental games community for any amount of time, you'll quickly find the number one thing players want is _content_. They want as much of it as possible! The most popular incremental games have tons of content, so they just keep stretching on and on and on, introducing mechanic after mechanic, and players love it. In fact, players seem to value the _amount_ of content over the quality of any _specific_ content. However, there's a bit of a lack of understanding concerning _what_ content is, and I'd like to explore what counts as content, and how we measure it. As a baseline definition, I think "content" can just be described as the parts of the game that engage the player, but to truly understand it we need to contextualize what that means and how it affects the gameplay experience.
To clarify the purpose of this page, my goal is not to get (too) nitpicky or to attack games with "low content". There's nothing wrong with short / low-content games - I'm quite a big fan of those games myself! This is mostly targeted toward those who _ask_ for content and settle for "long" games, and those who _want_ to provide content but want to make sure they're not just artificially inflating the game. Ultimately, I suppose the goal is to just reduce the amount of artificially inflated content for the sake of having a "longer" game. To clarify the purpose of this page, my goal is not to get (too) nitpicky or to attack games with "low content". There's nothing wrong with short / low-content games - I'm quite a big fan of those games myself! This is mostly targeted toward those who _ask_ for content and settle for "long" games, and those who _want_ to provide content but want to make sure they're not just artificially inflating the game. Ultimately, I suppose the goal is to just reduce the amount of artificially inflated content for the sake of having a "longer" game.

View file

@ -15,6 +15,8 @@ const pageData = useData();
<p>70 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>70 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Davey Wreden](/garden/davey-wreden/index.md)
> Tags: [Davey Wreden](/garden/davey-wreden/index.md) > Tags: [Davey Wreden](/garden/davey-wreden/index.md)
My favorite video game of all time, bar none. Created by [Davey Wreden](/garden/davey-wreden/index.md) My favorite video game of all time, bar none. Created by [Davey Wreden](/garden/davey-wreden/index.md)

View file

@ -14,6 +14,8 @@ const pageData = useData();
<p>57 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>57 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Digital Gardens](/garden/digital-gardens/index.md), [Incremental Social](/garden/incremental-social/index.md), [Kronos](/garden/kronos/index.md), [My Personal Website](/garden/my-personal-website/index.md), [Social Media](/garden/social-media/index.md)
Refers to reblogging (and re-hosting, sometimes) of someone else's content on your own site Refers to reblogging (and re-hosting, sometimes) of someone else's content on your own site
[The Internet is a series of webs](https://aramzs.xyz/essays/the-internet-is-a-series-of-webs/) discusses some ideas and best practices for amplification [The Internet is a series of webs](https://aramzs.xyz/essays/the-internet-is-a-series-of-webs/) discusses some ideas and best practices for amplification

View file

@ -14,4 +14,6 @@ const pageData = useData();
<p>14 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>14 words, ~0 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Digital Gardens](/garden/digital-gardens/index.md), [Incremental Social](/garden/incremental-social/index.md), [Kronos](/garden/kronos/index.md), [My Personal Website](/garden/my-personal-website/index.md), [Social Media](/garden/social-media/index.md)
A proposal I want to write for posting signed content on your [IndieWeb](/garden/the-small-web/index.md) website A proposal I want to write for posting signed content on your [IndieWeb](/garden/the-small-web/index.md) website

View file

@ -15,7 +15,7 @@ const pageData = useData();
<p>771 words, ~4 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>771 words, ~4 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [/now](/now/index), [This Knowledge Hub](/garden/this-knowledge-hub/index.md) > Referenced by: [Commune](/garden/commune/index.md), [Federated Identity](/garden/federated-identity/index.md), [Fedi v2](/garden/fedi-v2/index.md), [My Personal Website](/garden/my-personal-website/index.md), [/now](/now/index), [The IndieWeb/Signature Blocks](/garden/the-indieweb/signature-blocks/index.md), [This Knowledge Hub](/garden/this-knowledge-hub/index.md), [Webrings](/garden/webrings/index.md), [Weird](/garden/weird/index.md)
The small web (also known as the indie web, personal web, the web revival movement, and other terms) refers to small, personal, independent websites. It is seen as a direct alternative to the centralized and homogenized websites like X, Meta, and TikTok. [My Personal Website](/garden/my-personal-website/index.md) is part of the small web! The small web (also known as the indie web, personal web, the web revival movement, and other terms) refers to small, personal, independent websites. It is seen as a direct alternative to the centralized and homogenized websites like X, Meta, and TikTok. [My Personal Website](/garden/my-personal-website/index.md) is part of the small web!

View file

@ -14,7 +14,7 @@ const pageData = useData();
<p>114 words, ~1 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p> <p>114 words, ~1 minute read. <span v-html="data[`site/${pageData.page.value.relativePath}`]" /></p>
<hr/> <hr/>
> Referenced by: [Commune](/garden/commune/index.md), [Fedi v2](/garden/fedi-v2/index.md), [The Small Web](/garden/the-small-web/index.md) > Referenced by: [Commune](/garden/commune/index.md), [Fedi v2](/garden/fedi-v2/index.md), [My Personal Website](/garden/my-personal-website/index.md), [The Small Web](/garden/the-small-web/index.md)
[Weird](https://weird.one) is an [Open Source](/garden/open-source/index.md) project by the [Commune](/garden/commune/index.md) team currently in development [Weird](https://weird.one) is an [Open Source](/garden/open-source/index.md) project by the [Commune](/garden/commune/index.md) team currently in development