Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE/boombox.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
### Checklist

#### Required files
- [ ] `meta.yaml` with all required fields
- [ ] `<slug>.md` with frontmatter containing all required fields
- [ ] Audio file: `.mp3`, `.wav`, or `.ogg`

#### meta.yaml fields
#### Frontmatter fields (in `<slug>.md`)
- [ ] `title` — display name for this boombox track
- [ ] `author` — creator name or handle
- [ ] `description` — brief description of the track
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE/hornsound.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
### Checklist

#### Required files
- [ ] `meta.yaml` with all required fields
- [ ] `<slug>.md` with frontmatter containing all required fields
- [ ] Audio file: `.mp3`, `.wav`, or `.ogg`

#### meta.yaml fields
#### Frontmatter fields (in `<slug>.md`)
- [ ] `title` — display name for this horn sound
- [ ] `author` — creator name or handle
- [ ] `description` — brief description of the horn sound
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE/lightshow.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
### Checklist

#### Required files
- [ ] `meta.yaml` with all required fields
- [ ] `<slug>.md` with frontmatter containing all required fields
- [ ] `.fseq` sequence file
- [ ] `.mp3` audio file (optional but recommended)

#### meta.yaml fields
#### Frontmatter fields (in `<slug>.md`)
- [ ] `title` — display name for this light show
- [ ] `author` — creator name or handle
- [ ] `description` — brief description of the light show
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE/locksound.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
### Checklist

#### Required files
- [ ] `meta.yaml` with all required fields
- [ ] `<slug>.md` with frontmatter containing all required fields
- [ ] `.wav` audio file

#### meta.yaml fields
#### Frontmatter fields (in `<slug>.md`)
- [ ] `title` — display name for this lock sound
- [ ] `author` — creator name or handle
- [ ] `description` — brief description of the lock sound
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE/wrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
### Checklist

#### Required files
- [ ] `meta.yaml` with all required fields
- [ ] `<slug>.md` with frontmatter containing all required fields
- [ ] Image file: `.png`, `.jpg`, `.jpeg`, `.webp`, or `.svg`

#### meta.yaml fields
#### Frontmatter fields (in `<slug>.md`)
- [ ] `title` — display name for this wrap design
- [ ] `author` — creator name or handle
- [ ] `description` — brief description of the wrap
Expand Down
2 changes: 1 addition & 1 deletion content/_boombox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Community-contributed Tesla Boombox audio tracks.

Each boombox track lives in its own folder with a `meta.yaml` and the audio file.
Each boombox track lives in its own folder with an accompanying `.md` file (frontmatter metadata) and the audio file.
10 changes: 0 additions & 10 deletions content/_boombox/sample-track/meta.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion content/_hornsounds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Community-contributed Tesla custom horn sounds.

Each horn sound lives in its own folder with a `meta.yaml` and the audio file.
Each horn sound lives in its own folder with an accompanying `.md` file (frontmatter metadata) and the audio file.
10 changes: 0 additions & 10 deletions content/_hornsounds/sample-horn/meta.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion content/_lightshows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Community-contributed Tesla light show sequences (`.fseq` files).

Each light show lives in its own folder with a `meta.yaml` and the `.fseq` file (plus optional `.mp3` audio).
Each light show lives in its own folder with an accompanying `.md` file (frontmatter metadata) and the `.fseq` file (plus optional `.mp3` audio).
12 changes: 0 additions & 12 deletions content/_lightshows/sample-show/meta.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion content/_locksounds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Community-contributed Tesla lock/unlock chime sounds (`.wav` files).

Each lock sound lives in its own folder with a `meta.yaml` and the `.wav` file.
Each lock sound lives in its own folder with an accompanying `.md` file (frontmatter metadata) and the `.wav` file.
10 changes: 0 additions & 10 deletions content/_locksounds/sample-chime/meta.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion content/_wraps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Community-contributed Tesla vehicle wrap designs and templates.

Each wrap lives in its own folder with a `meta.yaml` and image assets.
Each wrap lives in its own folder with an accompanying `.md` file (frontmatter metadata) and image assets.
11 changes: 0 additions & 11 deletions content/_wraps/sample-wrap/meta.yaml

This file was deleted.

119 changes: 119 additions & 0 deletions package-lock.json

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

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
"validate": "ts-node scripts/validate.ts"
},
"devDependencies": {
"typescript": "^5.4.0",
"ts-node": "^10.9.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.0.0",
"glob": "^10.3.0",
"gray-matter": "^4.0.3",
"js-yaml": "^4.1.0",
"@types/js-yaml": "^4.0.9",
"glob": "^10.3.0"
"ts-node": "^10.9.0",
"typescript": "^5.4.0"
}
}
14 changes: 8 additions & 6 deletions scripts/build.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as fs from "fs";
import * as path from "path";
import * as yaml from "js-yaml";
import matter from "gray-matter";

const ROOT_DIR = path.resolve(__dirname, "..");
const CONTENT_DIR = path.join(ROOT_DIR, "content");
Expand Down Expand Up @@ -51,10 +52,11 @@ interface CatalogItem {
meta: ItemMeta;
}

function readMetaYaml(filePath: string): ItemMeta | null {
function readFrontmatter(filePath: string): ItemMeta | null {
try {
const raw = fs.readFileSync(filePath, "utf-8");
return yaml.load(raw) as ItemMeta;
const { data } = matter(raw);
return data as ItemMeta;
} catch {
console.warn(`Warning: could not read ${filePath}, skipping.`);
return null;
Expand All @@ -72,7 +74,7 @@ function listItemDirs(categoryDir: string): string[] {
function listFiles(dir: string, baseUrl: string, category: string, slug: string): FileEntry[] {
return fs
.readdirSync(dir, { withFileTypes: true })
.filter((f) => f.isFile() && f.name !== "meta.yaml")
.filter((f) => f.isFile())
.map((f) => ({
name: f.name,
downloadUrl: `${baseUrl}/content/${category}/${slug}/${f.name}`,
Expand All @@ -89,11 +91,11 @@ function buildCatalog(): CatalogItem[] {

for (const slug of slugs) {
const itemDir = path.join(categoryDir, slug);
const metaPath = path.join(itemDir, "meta.yaml");
const mdPath = path.join(categoryDir, `${slug}.md`);

if (!fs.existsSync(metaPath)) continue;
if (!fs.existsSync(mdPath)) continue;

const meta = readMetaYaml(metaPath);
const meta = readFrontmatter(mdPath);
if (!meta) continue;

// Add downloadUrl to meta.files entries if present
Expand Down
Loading
Loading