Skip to content

Commit f7efde9

Browse files
Merge pull request #31 from roman-yagodin/master
Update website
2 parents d4d463a + a0fe50b commit f7efde9

File tree

6 files changed

+131
-4
lines changed

6 files changed

+131
-4
lines changed

Diff for: CUSTOMIZE.md

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Customizing content
2+
3+
The game content is represented by set of text files (notes) in [Markdown](https://www.markdownguide.org/) format.
4+
You can use any text editor to edit them.
5+
6+
## YAML frontmatter
7+
8+
In order to store structural information in Markdown notes, game uses YAML frontmatter:
9+
10+
```YAML
11+
---
12+
author: Someone
13+
colors: [ magenta, red ]
14+
---
15+
```
16+
17+
Frontmatter format is tested to be compatible with the [Obsidian](https://obsidian.md/).
18+
19+
## Organizing notes
20+
21+
Notes are located in `data` folder. You can place note in any subfolder.
22+
I generally create subfolders by author, but you may choose different approach.
23+
24+
## Note colors
25+
26+
Note can be displayed in one of the 8 colors, which should be set by `colors` tag in frontmatter.
27+
At least one color is required!
28+
29+
```YAML
30+
---
31+
author: Someone
32+
colors: [ white, magenta, blue, cyan, green, yellow, orange, red ]
33+
---
34+
```
35+
36+
## Notes in different languages
37+
38+
Every note have alphanumeric hash, like `0b11ffca.md`.
39+
Other than English language versions should have two-letter language code suffix, like `0b11ffca-ru.md` and `lang: XX` tag in frontmatter, like that:
40+
41+
```YAML
42+
---
43+
author: Me
44+
colors: [ magenta, red ]
45+
lang: ru
46+
---
47+
```
48+
49+
## Links
50+
51+
If you want a note to have direct link to another note, use `link` tag with target note hash:
52+
53+
```YAML
54+
---
55+
author: Someone
56+
colors: [ magenta, red ]
57+
lang: ru
58+
link: 6414ff15
59+
---
60+
```
61+
62+
## Hyperlinks
63+
64+
If you want a note to have a hyperlink to external resource `href` tag with target URI:
65+
66+
```YAML
67+
---
68+
author: Someone
69+
colors: [ magenta, red ]
70+
href: https://someone.me
71+
---
72+
```
73+
74+
## Content reuse
75+
76+
Follow license and content reuse rules provided by original authors there possible!
77+
78+
Provide license info using `license` tag in frontmatter and hyperlinks to the original.
79+
80+
```YAML
81+
---
82+
author: Multiple
83+
colors: [ white ]
84+
href: https://en.wikipedia.org/wiki/Main_Page
85+
license: CC-BY-SA
86+
---
87+
```
88+
89+
Note that you can add your custom tags to frontmatter, with additional info, if needed.
90+
91+
## Compiling notes
92+
93+
In order to use new notes or see changes in them at runtime, notes should be compiled to `data.js` file.
94+
To do that, open project root folder in terminal and execute:
95+
96+
```Shell
97+
node ./buildData.js
98+
```
99+
100+
## Publishing your version
101+
102+
Publishing is designed to be as simple as possible!
103+
104+
Currently I use the GitHub Pages pipeline for that. After inital setup, it's just:
105+
106+
1. Make changes in notes/scripts.
107+
2. Run `buildData.js` to update `data.js` file.
108+
3. Commit changes to *master* branch.
109+
4. Create and merge pull request from *master* to *website* branch.
110+
5. Wait GitHub Pages pipeline to update the website.
111+
112+
More details about how to setup that are coming.

Diff for: buildData.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const fileNames = fs.readdirSync(dataFolder, { recursive: true });
3434
const notes = [];
3535

3636
fileNames.forEach(fileName => {
37-
if (fileName.endsWith(".md")) {
37+
if (fileName.endsWith(".md") && !fileName.startsWith("_")) {
3838
const content = fs.readFileSync(`./data/${fileName}`, 'utf8');
3939
const dirSepIndex = fileName.lastIndexOf("\\");
4040
const shortFileName = dirSepIndex >= 0 ? fileName.substring(dirSepIndex + 1) : fileName;

Diff for: data/castaneda/7bda79b4.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ He calculates everything.
99

1010
That's control.
1111

12-
Once his calculations are over,
13-
he acts. He lets go.
12+
Once his calculations are over, he acts.
13+
He lets go.
1414

1515
That's abandon.

Diff for: data/etc/ef225316.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
author: J.R.R. Tolkien
3+
colors: [ magenta, blue, yellow, red ]
4+
source: The Fellowship of the Ring
5+
---
6+
But it is said: Do not meddle in the affairs of wizards,
7+
for they are subtle and quick to anger.
8+
The choice is yours: to go or wait.

Diff for: data/klein/29d4abe8.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
author: Alexander Klein
3+
colors: [ magenta, blue, cyan, yellow, orange, red ]
4+
href: https://proza.ru/2024/07/16/1023
5+
---
6+
Understanding is required only for action,
7+
not for anything else!

Diff for: js/data.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)