sort by date

This commit is contained in:
Adam 2024-02-01 17:05:12 -05:00
parent 1c9c2ae34c
commit 2e7024222e
13 changed files with 16 additions and 16 deletions

View file

@ -23,10 +23,10 @@ pub async fn get_articles(article_type: ArticleType) -> Result<Vec<Article>, Ser
use sqlx::*;
let query = match article_type {
ArticleType::All => "select * from blog order by date",
ArticleType::Blog => "select * from blog where content_type like 'blog'",
ArticleType::Game => "select * from blog where content_type like 'game'",
ArticleType::Project => "select * from blog where content_type like 'project'",
ArticleType::All => "select * from blog order by date desc",
ArticleType::Blog => "select * from blog where content_type like 'blog' order by date desc",
ArticleType::Game => "select * from blog where content_type like 'game' order by date desc",
ArticleType::Project => "select * from blog where content_type like 'project' order by date desc",
};
let pool: SqlitePool = use_context::<SqlitePool>().expect("couldn't get pool context");

View file

@ -1,7 +1,7 @@
```toml
content_type = "blog"
title = "Swim"
date = "2022 2 7"
date = "2022 02 07"
```
<p style="text-align: right;">

View file

@ -1,7 +1,7 @@
```toml
content_type = "blog"
title = "Change"
date = "2022 5 6"
date = "2022 05 06"
```
<p style="text-align: center;">

View file

@ -1,7 +1,7 @@
```toml
content_type = "blog"
title = "It's about time, NVIDIA"
date = "2022 5 20"
date = "2022 05 20"
```
It's about time... NVIDIA has finally released and is starting to

View file

@ -1,7 +1,7 @@
```toml
content_type = "game"
title = "snek"
date = "2022 5 20"
date = "2022 05 20"
```
[snek](https://old.doordesk.net/snek) is a simple snake game made with JS/Canvas.

View file

@ -1,7 +1,7 @@
```toml
content_type = "project"
title = "Predicting Housing Prices"
date = "2022 5 29"
date = "2022 05 29"
```
A recent project I had for class was to use [scikit-learn](https://scikit-learn.org/stable/index.html) to create a regression model that will predict the price of a house based on some features of that house.

View file

@ -1,7 +1,7 @@
```toml
content_type = "blog"
title = "Back to School"
date = "2022 6 2"
date = "2022 06 2"
```
### Where the hell have I been!?

View file

@ -1,7 +1,7 @@
```toml
content_type = "project"
title = "What goes into a successful Reddit post?"
date = "2022 6 14"
date = "2022 06 14"
```
In an attempt to find out what about a Reddit post makes it successful I will use some

View file

@ -1,7 +1,7 @@
```toml
content_type = "blog"
title = "It's a post about nothing!"
date = "2022 7 1"
date = "2022 07 1"
```
The progress update

View file

@ -1,7 +1,7 @@
```toml
content_type = "game"
title = "adam"
date = "2022 9 11"
date = "2022 09 11"
```
[adam](https://old.doordesk.net/games/adam/) is a quick fps demo to test how well WebGL

View file

@ -1,7 +1,7 @@
```toml
content_type = "game"
title = "balls"
date = "2022 9 13"
date = "2022 09 13"
```
[balls](https://old.doordesk.net/games/balls/) is another demo to test WebGL performance.

View file

@ -1,7 +1,7 @@
```toml
content_type = "game"
title = "fps"
date = "2022 10 9"
date = "2022 10 09"
```
[fps](https://old.doordesk.net/games/fps/) is a Godot/WebGL experiment from scratch with

View file

@ -1,7 +1,7 @@
```toml
content_type = "project"
title = "Lightning"
date = "2023 4 27"
date = "2023 04 27"
```
[Lightning](https://lightning.doordesk.net) is a mapping/data vis project for finding