styling, navigation bar, theming, article lists, page routing.

This commit is contained in:
Joshua Ashton
2025-03-20 19:54:37 -06:00
parent 5af0547864
commit c0fc9e9d00
28 changed files with 489 additions and 95 deletions
+25 -14
View File
@@ -6,17 +6,11 @@ CREATE TABLE roles (
role VARCHAR(16) NOT NULL
);
INSERT INTO roles (role)
VALUES ('owner'), ('admin'), ('contributor'), ('reader');
CREATE TABLE tags (
tag_id INT PRIMARY KEY AUTO_INCREMENT,
tag VARCHAR(16) NOT NULL
);
INSERT INTO tags (tag)
VALUES ('linux'), ('web-dev'), ('raspberry-pi'), ('self-hosting');
CREATE TABLE user (
user_id INT PRIMARY KEY,
username VARCHAR(32) NOT NULL UNIQUE,
@@ -30,11 +24,10 @@ CREATE TABLE user (
FOREIGN KEY (role_id) REFERENCES roles (role_id)
);
CREATE TABLE articles (
CREATE TABLE article (
article_id INT PRIMARY KEY AUTO_INCREMENT,
author_id INT NOT NULL,
markdown_file_path VARCHAR(256) NOT NULL UNIQUE,
title VARCHAR(64) NOT NULL,
title VARCHAR(26) NOT NULL,
slug VARCHAR(32),
read_count INT DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
@@ -46,9 +39,27 @@ CREATE TABLE articles (
);
CREATE TABLE article_tags (
article_id INT NOT NULL,
tag_id INT NOT NULL,
PRIMARY KEY (article_id, tag_id),
FOREIGN KEY (article_id) REFERENCES articles(article_id),
FOREIGN KEY (tag_id) REFERENCES tags(tag_id)
article_id INT NOT NULL,
tag_id INT NOT NULL,
PRIMARY KEY (article_id, tag_id),
FOREIGN KEY (article_id) REFERENCES article(article_id),
FOREIGN KEY (tag_id) REFERENCES tags(tag_id)
);
INSERT INTO roles (role)
VALUES ('owner'), ('admin'), ('contributor'), ('reader');
INSERT INTO tags (tag)
VALUES ('linux'), ('web-dev'), ('raspberry-pi'), ('self-hosting'), ('devlog'), ('testing');
INSERT INTO user (user_id, username, email, password_hash, role_id, profile_picture)
VALUES (2025, 'quaxlyqueen', 'me@joshashton.dev', 'changeme', 1, '2025.jpg');
INSERT INTO article (author_id, title, excerpt, published_at)
VALUES (2025, 'Building vintagecoding.net', 'This site is intended to be a platform for exposing, celebrating, and sharing the style of Vintage Coding. Topics from hardware to software and kernel to web, this site aims to cover it all.', CURRENT_TIMESTAMP);
INSERT INTO article (author_id, title, excerpt, published_at)
VALUES (2025, 'Testing vintagecoding.net', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas a mauris sit amet dui pellentesque sodales. Pellentesque non viverra leo, et congue metus.', CURRENT_TIMESTAMP);
INSERT INTO article_tags (article_id, tag_id) VALUES (1, 2), (1, 4), (1, 5);
INSERT INTO article_tags (article_id, tag_id) VALUES (2, 2), (2, 6);