Apply the public site UI checklist.
Align header, footer, brand, homepage course preview, faculty links, and the course catalog with the documented changes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
8886aa8640
commit
de800d27b1
139 files changed
+3311
-1547
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import { readFileSync, existsSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import pg from "pg";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const envPath = path.join(root, ".env.local");
|
||||
if (existsSync(envPath)) {
|
||||
for (const line of readFileSync(envPath, "utf8").split(/\r?\n/)) {
|
||||
const m = line.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*)\s*$/);
|
||||
if (m && !(m[1] in process.env)) process.env[m[1]] = m[2];
|
||||
}
|
||||
}
|
||||
|
||||
const client = new pg.Client({ connectionString: process.env.DATABASE_URL });
|
||||
await client.connect();
|
||||
const cats = await client.query(
|
||||
"select slug, label, show_in_filter, published from course_categories order by sort_order",
|
||||
);
|
||||
const tags = await client.query(
|
||||
"select slug, label, show_in_nav, show_in_filter, published from course_tags order by sort_order",
|
||||
);
|
||||
const links = await client.query(`
|
||||
select c.slug as course,
|
||||
coalesce(json_agg(distinct cat.slug) filter (where cat.slug is not null), '[]') as cats,
|
||||
coalesce(json_agg(distinct t.slug) filter (where t.slug is not null), '[]') as tags
|
||||
from courses c
|
||||
left join course_category_links cl on cl.course_id = c.id
|
||||
left join course_categories cat on cat.id = cl.category_id
|
||||
left join course_tag_links tl on tl.course_id = c.id
|
||||
left join course_tags t on t.id = tl.tag_id
|
||||
where c.published
|
||||
group by c.slug
|
||||
order by c.slug
|
||||
`);
|
||||
console.log("CATEGORIES", cats.rows);
|
||||
console.log("TAGS", tags.rows);
|
||||
console.log("COURSE LINKS", links.rows);
|
||||
await client.end();
|
||||
Reference in new issue
Block a user