Yamlify page objects

This commit is contained in:
2022-04-23 19:03:43 -04:00
parent 7ac30458d1
commit 088932a742
13 changed files with 235 additions and 249 deletions

View File

@@ -1,5 +1,6 @@
import React, { ReactElement } from 'react';
import Layout from '../components/layout';
import pl from '../public/playlists.yaml';
type listItem = {
children?: listItem[];
@@ -7,27 +8,7 @@ type listItem = {
title: string;
};
const list: listItem[] = [{
title: 'Classical by Composer',
children: [
{
title: '[Youtube] Antonio Lucio Vivaldi',
url: 'https://youtube.com/playlist?list=PLSU6wJEYct5HslkoJWHQFCttB-lhSwVr2'
},
{
title: '[Youtube] Johann Sebastian Bach',
url: 'https://youtube.com/playlist?list=PLSU6wJEYct5HftuY6UunC6zE_QMXOGmhm'
},
{
title: '[Youtube] Ludwig van Beethoven',
url: 'https://youtube.com/playlist?list=PLSU6wJEYct5Etx0WAXUQ7YXe84Fp5E142'
},
{
title: '[Youtube] Wolfgang Amadeus Mozart',
url: 'https://youtube.com/playlist?list=PLSU6wJEYct5EJsE-9Zh-jWckBuZAmIt8Q'
}
]
}];
const list: listItem[] = pl;
function mapChild(obj: listItem, level: number) {
if (obj.url)

View File

@@ -1,6 +1,6 @@
import Layout from '../../components/layout';
import { useRouter } from 'next/router';
import { getAllPosts, getPost } from '../../lib/slug';
import { getAllPosts, getPost } from '../../util/slug';
import ReactMarkdown from 'react-markdown';
import Image from 'next/image';

View File

@@ -1,7 +1,6 @@
import Link from 'next/link';
import React from 'react';
import Layout from '../../components/layout';
import { getAllPosts } from '../../lib/slug';
import Pages from '../../public/pages.json';
import cachePostLinkData from '../../util/post-cache';

View File

@@ -1,6 +1,7 @@
import React, { ReactElement } from 'react';
import Layout from '../components/layout';
import style from '../styles/lists.module.css';
import rec from '../public/recommended.yaml';
type listItem = {
children?: listItem[] | string[];
@@ -9,151 +10,11 @@ type listItem = {
description?: string
};
const list: listItem[] = [
{
title: 'Books',
children: [
{
title: 'Technology',
children: [
{
title: 'C programming',
children: [
{
title: 'The C Programming Language [K&R]',
url: 'https://en.wikipedia.org/wiki/The_C_Programming_Language'
},
{
title: 'Expert C Programming by Peter van der Linden'
},
{
title: 'Practical C Programming by Steve Oualline (outdated like all the books in this section but still good)'
},
{
title: 'Mastering Algorithms with C by Kyle Loudon'
}
]
},
{
title: 'Other Programming',
children: [
'Programming Perl by Larry Wall [Camel Book] (one of the first programming books I used. It probably is outdated but it is written well)',
'Programming Rust: Fast, Safe Systems Development',
'The Rust Programming Language',
'Programming in Lua, Fourth Edition by Roberto Ierusalimschy'
]
},
{
title: 'Operating Systems',
children: [
'Advanced Programming in the Unix Environment by W. Richard Stevens',
'Operating Systems: Design and Implementation by Andrew S. Tanenbaum (I have not had a chance to read his other books on OS. I am not a fan of his networking book though.)'
]
},
// {
// title: 'Networking'
// },
// {
// title: 'Electronics'
// },
{
title: 'Computer Engineering',
children: [
'Making Embedded Systems: Design Patterns for Great Software by Elecia White',
'Computer Organization and Design: the Hardware/Software Interface [Patterson Hennessy]',
'Computer Architecture: A Quantitative Approach [Hennessy Patterson]'
]
},
{
title: 'Compilers',
children: [
{
title: 'Compilers: Principles, Techniques, and Tools [Dragon Book] (discusses theory in detail so it is kind of hard to read)'
}
]
},
{
title: 'Other',
children: [
{
title: 'Definitive Guide to sed: Tutorial and Reference'
}
]
}
]
},
{
title: 'Classics',
description: 'Only the English ones for now.',
children: [
'Christmas Carol',
'A Tale of Two Cities',
'The Mayor of Casterbridge',
'The Citadel',
'Oliver Twist',
'Macbeth',
'Othello',
'Adventures of Huckleberry Finn',
'Murder on the Orient Express'
]
},
{
title: 'Language Learning',
children: ['Lingua Latina per se Illustrata (Both parts)']
}
]
},
{
title: 'Movies',
children: [
'Pulp Fiction',
'Blade Runner 2049',
'The Grand Budapest Hotel',
'The Hateful Eight',
'Goodfellas',
'Inception',
'Memento',
'Dune (2021)',
'Hot Fuzz',
'Snatch'
]
},
{
title: 'Music',
children: [
'American Pie by Don McLean',
'L\'Ultima Diligenza by Ennio Morricone'
]
},
{
title: 'Classical Music',
children: [
'Große Fuge Op. 133',
'KV 387',
'KV 448',
'KV 626',
'Piano Sonata No. 2 Mvmt. 3 (Chopin)',
'BWV 1048',
'Prelude in G Minor (Op. 23 No. 5)',
'String Quartet, Op. 20 No. 2 (Haydn)',
'Arabesque No. 1 (Debussy)'
]
},
{
title: 'Video Games',
children: [
'The Legend of Zelda: Breath of the Wild',
'Portal 2',
'Factorio',
'The Witcher 3: The Wild Hunt GOTY Edition (Especially the DLCs)',
'Baba is You',
'Red Dead Redemption'
]
}
];
const list: listItem[] = rec // todo: validate this
function mapChild(obj: listItem | string, level: number) {
if (typeof obj === 'string') {
console.log(list)
if (typeof obj === 'string') {
if (obj === '')
return <></>
return <span className={style.listItem}>{obj}</span>

View File

@@ -1,6 +1,7 @@
import React, { ReactElement } from 'react';
import Layout from '../components/layout';
import style from '../styles/lists.module.css';
import res from '../public/resources.yaml';
type listItem = {
children?: listItem[] | string[];
@@ -9,80 +10,7 @@ type listItem = {
description?: string
};
const list = [{
title: 'Programming',
children: [
{
url: 'http://aggregate.org/MAGIC/',
title: 'The Aggregate Magic Algorithms'
},
{
url: 'https://3fx.ch/typing-is-hard.html',
title: 'Typing is Hard'
},
{
url: 'https://www.atlassian.com/git/',
title: 'Atlassian\'s Git Guide'
},
{
url: 'https://learnopengl.com/',
title: 'LearnOpenGL.com'
},
{
url: 'http://ctan.math.utah.edu/ctan/tex-archive/info/symbols/comprehensive/symbols-letter.pdf',
title: '[PDF] LaTeX Symbols'
},
{
url: 'https://tobi.oetiker.ch/lshort/lshort.pdf',
title: '[PDF] The Not So Short Introduction to LATEX 2ε'
},
{
url: 'https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html',
title: 'The MIT License, Line by Line by Kyle E. Mitchell'
},
{
title: 'Posts',
children: [
{
title: 'How to Make Your Code Reviewer Fall in Love with You by Michael Lynch',
url: 'https://mtlynch.io/code-review-love/'
},
{
title: 'What\'s in the box? by @fasterthanlime',
url: 'https://fasterthanli.me/articles/whats-in-the-box'
}
]
},
{
title: 'Talks',
children: [
{
title: 'Concurrency is not Parallelism by Rob Pike',
url: 'https://talks.golang.org/2012/waza.slide'
}
]
}
]
},
{
title: 'Electrical',
children: [
{
title: 'Common Wire-To-Board, Wire-To-Wire Connectors, And Crimp Tools',
url: 'http://www.mattmillman.com/info/crimpconnectors/'
}
]
},
{
title: 'Other Topics',
children: [
{
title: 'Sight Reading Trainer',
url: 'https://sightreading.training/'
}
]
}];
const list: listItem[] = res;
function mapChild(obj: listItem | string, level: number) {
if (typeof obj === 'string') {