Skip to content

Commit 40a3a51

Browse files
committed
Added Notes section.
With structure change of js into individual pages instead of putting in shared folder.
1 parent cf3b50d commit 40a3a51

17 files changed

Lines changed: 274 additions & 6 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

blog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<a href="index.html" class="back-link">Back to Home</a>
4646
<footer id="footer-placeholder"></footer>
4747
<script type="module" src="js/header-footer.js"></script>
48-
<script src="js/blog.js"></script>
48+
<script src="posts/js/blog.js"></script>
4949
</body>
5050

5151
</html>

components/header.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
<nav>
33
<a href="index.html">Home</a> |
44
<a href="about.html">About</a> |
5-
<a href="blog.html">Blog</a> | <!-- points to the new listing page -->
6-
<a href="projects.html">Projects</a>
5+
<a href="blog.html">Blog</a> |
6+
<a href="projects.html">Projects</a> |
7+
<a href="notes.html">Notes</a>
78
</nav>
89
<div class="header-row">
910
<p>Welcome! Sharing ideas, projects, school notes, and more.</p>

css/notes.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* ==========================================================================
2+
NOTES PAGES
3+
========================================================================== */
4+
5+
.course-entry, .note-entry {
6+
border-bottom: 1px solid #ddd;
7+
padding: 0.7rem 0;
8+
display: flex;
9+
justify-content: space-between;
10+
}
11+
12+
.course-title, .note-title {
13+
font-weight: bold;
14+
color: var(--link-color, #0055aa);
15+
}
16+
17+
.course-meta, .note-date {
18+
font-size: 0.9rem;
19+
color: #555;
20+
}
21+
22+
.dark-mode .course-meta,
23+
.dark-mode .note-date {
24+
color: #aaa;
25+
}

notes.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<script>
6+
(function () {
7+
var stored = localStorage.getItem('theme');
8+
var prefers = window.matchMedia('(prefers-color-scheme:dark)').matches;
9+
if (stored === 'dark' || (!stored && prefers)) {
10+
document.documentElement.classList.add('dark-mode');
11+
}
12+
})();
13+
</script>
14+
<meta charset="UTF-8" />
15+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
16+
<title>Notes – Robin's Site</title>
17+
18+
<link rel="stylesheet" href="css/shared.css" />
19+
<link rel="stylesheet" href="css/notes.css" />
20+
21+
<meta http-equiv="Content-Security-Policy" content="
22+
default-src 'self';
23+
script-src 'self' https://cdn.jsdelivr.net;
24+
style-src 'self' 'unsafe-inline';
25+
connect-src 'self';
26+
font-src 'self';
27+
img-src 'self' data:;">
28+
</head>
29+
30+
<body>
31+
<header id="header-placeholder"></header>
32+
33+
<section id="courses-list"></section>
34+
35+
<footer id="footer-placeholder"></footer>
36+
<script type="module" src="js/header-footer.js"></script>
37+
<script src="notes/js/notes.js"></script>
38+
</body>
39+
40+
</html>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# What is Language?
2+
- Cultural artifact
3+
- Articulation of thoughts
4+
- Code for communication
5+
- Human biological trait
6+
7+
## How does language work?
8+
- Language as a mapping
9+
```
10+
form <-> function
11+
sound/sign <-> words <-> sentences <-> meaning
12+
```
13+
- what exactly do we know when we say we 'know' a language?
14+
15+
## What does it mean to 'know' a language
16+
### Linguistic competence
17+
Sounds, words, linguistic structures, meanings, etc.
18+
Mostly unconscious
19+
20+
#### Knowledge of sound patterns: Phonetics
21+
- Inventory of sounds
22+
- Which sounds exists in the language
23+
- How does sounds distinct from each other
24+
- which sounds can occur where
25+
26+
#### Knowledge of Word patterns: Morphology
27+
[Morpheme:= smallest meaningful unit.](##Morphology)
28+
29+
#### Knowledge of sentence patterns: Syntax
30+
31+
#### Knowledge of meaning patterns: Semantics
32+
Logical implication for the sentence.
33+
34+
### Communicative competence
35+
- Knowledge of how and when to use those linguistic structures
36+
- Evalutation of others' linguistic (in)competance
37+
38+
#### Knowledge of usage patterns: Sociolinguistics
39+
Association of meaning with the words
40+
41+
### Linguistic performance
42+
The way people use languages.
43+
44+
## Key features of language
45+
1. Arbitrariness
46+
No inherent connection between the word and the thing, just **convention**.
47+
2. Displacement
48+
Use language to communicate about things that are unrelated to (or distant from) the here and now.
49+
3. Discreteness
50+
Made up of discrete units: sounds, words, phrases, etc.
51+
5. Creativity
52+
Use language to form an infinite set of well-formed, grammatical sentences.
53+
6. Rule-Governedness
54+
- Follow a set of conventional rules (grammar).
55+
- Govern how linguistic units are constructed and how they fit together.
56+
- (Include "non-standard" dialects and slangs as well)
57+
58+
Does not have a distinguish between dialect and language for linguists.
59+
## What exactly is Linguistics?
60+
- Scientific study of language
61+
- Unconscious knowledge we have
62+
- the way we learn language
63+
- structure of language and of particular languages
64+
- how languages vary
65+
- how language is used in society
66+
67+
### Descriptivism vs. Prescriptivism
68+
- Descriptive grammar: description or model of the mental grammar, what speaker know about their language
69+
- Prescriptive Grammar:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"slug": "01-intro",
4+
"title": "01 – What is Language",
5+
"date": "2025-05-20"
6+
},
7+
{
8+
"slug": "02-phonetics",
9+
"title": "02 – Phonetics",
10+
"date": "2025-05-21"
11+
}
12+
]

notes/js/courses.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* course.js – list all notes in a course */
2+
3+
const params = new URLSearchParams(location.search);
4+
const slug = params.get("id");
5+
if (!slug) location.href = "notes.html";
6+
7+
const listEl = document.getElementById("notes-list");
8+
const heading = document.getElementById("course-title");
9+
10+
fetch(`/notes/metadata/courses.json`)
11+
.then(r => r.json())
12+
.then(all => {
13+
const course = all.find(c => c.slug === slug);
14+
heading.textContent = course ? course.title : slug;
15+
});
16+
17+
fetch(`/notes/entries/${slug}/index.json`)
18+
.then(r => r.json())
19+
.then(notes => {
20+
if (!notes.length) {
21+
listEl.innerHTML = "<p>No notes yet.</p>";
22+
return;
23+
}
24+
25+
notes.forEach(n => {
26+
const div = document.createElement("div");
27+
div.className = "note-entry";
28+
29+
const link = document.createElement("a");
30+
link.href = `note.html?course=${slug}&note=${n.slug}`;
31+
link.textContent = n.title;
32+
link.className = "note-title";
33+
34+
const date = document.createElement("div");
35+
date.className = "note-date";
36+
date.textContent = n.date;
37+
38+
div.append(link, date);
39+
listEl.appendChild(div);
40+
});
41+
})
42+
.catch(e => {
43+
console.error(e);
44+
listEl.innerHTML = "<p>Failed to load notes.</p>";
45+
});

notes/js/note.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* note.js – render note */
2+
3+
function parseFrontMatter(md) {
4+
const match = /^---\r?\n([\s\S]+?)\r?\n---/.exec(md);
5+
if (!match) return { meta: {}, body: md };
6+
const meta = window.jsYaml ? jsYaml.load(match[1]) : {};
7+
return { meta, body: md.slice(match[0].length) };
8+
}
9+
10+
const p = new URLSearchParams(location.search);
11+
const course = p.get("course");
12+
const noteSlug = p.get("note");
13+
if (!course || !noteSlug) location.href = "notes.html";
14+
15+
const article = document.getElementById("note-content");
16+
17+
fetch(`/notes/entries/${course}/${noteSlug}.md`)
18+
.then(r => r.text())
19+
.then(raw => {
20+
const { meta, body } = parseFrontMatter(raw);
21+
document.title = `${meta.title || noteSlug} – Notes`;
22+
23+
const h1 = document.createElement("h1");
24+
h1.textContent = meta.title || noteSlug;
25+
article.appendChild(h1);
26+
27+
const html = window.marked ? marked.parse(body) : body;
28+
article.insertAdjacentHTML("beforeend", html);
29+
30+
if (window.MathJax) MathJax.typesetPromise?.([article]);
31+
})
32+
.catch(e => {
33+
console.error(e);
34+
article.innerHTML = "<h2>Note not found.</h2>";
35+
});

notes/js/notes.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* notes.js – courses list */
2+
3+
const listEl = document.getElementById("courses-list");
4+
5+
fetch("/notes/metadata/courses.json")
6+
.then(r => r.json())
7+
.then(courses => {
8+
if (!courses.length) {
9+
listEl.innerHTML = "<p>No courses yet.</p>";
10+
return;
11+
}
12+
13+
courses.forEach(c => {
14+
const div = document.createElement("div");
15+
div.className = "course-entry";
16+
17+
const link = document.createElement("a");
18+
link.href = `course.html?id=${c.slug}`;
19+
link.textContent = c.title;
20+
link.className = "course-title";
21+
22+
const meta = document.createElement("div");
23+
meta.className = "course-meta";
24+
meta.textContent = `${c.semester || ""}${c.instructor ? " – " + c.instructor : ""}`;
25+
26+
div.append(link, meta);
27+
listEl.appendChild(div);
28+
});
29+
})
30+
.catch(e => {
31+
console.error("Could not load courses.json", e);
32+
listEl.innerHTML = "<p>Failed to load courses.</p>";
33+
});

0 commit comments

Comments
 (0)