Add order by
This commit is contained in:
parent
1377be120e
commit
909c28050a
4 changed files with 10 additions and 86 deletions
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
image_path: "https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Test-Logo.svg/783px-Test-Logo.svg.png?20150906031702"
|
image_path: "https://community.kde.org/images.community/thumb/a/af/Mascot_konqi-base-plasma.png/250px-Mascot_konqi-base-plasma.png"
|
||||||
slug: kde_first_conf
|
slug: kde_first_conf
|
||||||
title: Mes premières contributions à KDE
|
title: Mes premières contributions à KDE
|
||||||
date: 2023-11-26T00:00:00Z
|
date: 2024-01-12T00:00:00Z
|
||||||
description: Ma première configuration et ma première contribution à l'environnement mobile (Plasma-Mobile).
|
description: Ma première configuration et ma première contribution à l'environnement mobile (Plasma-Mobile).
|
||||||
project_link: none
|
project_link: none
|
||||||
draft: true
|
draft: true
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
---
|
|
||||||
image_path: "https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Test-Logo.svg/783px-Test-Logo.svg.png?20150906031702"
|
|
||||||
slug: test_layout
|
|
||||||
title: Testing layout
|
|
||||||
date: 2023-11-26T00:00:00Z
|
|
||||||
description: Testing the layout of the site.
|
|
||||||
project_link: none
|
|
||||||
draft: true
|
|
||||||
tags:
|
|
||||||
- test
|
|
||||||
---
|
|
||||||
|
|
||||||
# Heading 1
|
|
||||||
## Heading 2
|
|
||||||
### Heading 3
|
|
||||||
#### Heading 4
|
|
||||||
##### Heading 5
|
|
||||||
###### Heading 6
|
|
||||||
|
|
||||||
This is a paragraph tag. It's used `for` displaying text content.
|
|
||||||
|
|
||||||
[Click me to visit Example website!](https://www.example.com)
|
|
||||||
|
|
||||||
Unordered list
|
|
||||||
|
|
||||||
* Item 1
|
|
||||||
* Item 2
|
|
||||||
* Item 3
|
|
||||||
|
|
||||||
Ordered list
|
|
||||||
|
|
||||||
1. Item 1
|
|
||||||
2. Item 2
|
|
||||||
3. Item 3
|
|
||||||
|
|
||||||
|
|
||||||
> It's probably important that images look okay here by default as well:
|
|
||||||
|
|
||||||
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Test-Logo.svg/783px-Test-Logo.svg.png?20150906031702">
|
|
||||||
|
|
||||||
### Code Blocks
|
|
||||||
|
|
||||||
```python
|
|
||||||
def hello_world():
|
|
||||||
print("Hello World!")
|
|
||||||
```
|
|
||||||
|
|
||||||
```rust
|
|
||||||
fn main() {
|
|
||||||
println!("Hello World!");
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
function helloWorld() {
|
|
||||||
console.log("Hello World!");
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
def hello_world
|
|
||||||
puts "Hello World!"
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
```dockerfile
|
|
||||||
FROM rust
|
|
||||||
RUN cargo build --release
|
|
||||||
CMD ["./target/release/hello_world"]
|
|
||||||
```
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
graph TD;
|
|
||||||
A-->B;
|
|
||||||
A-->C;
|
|
||||||
B-->D;
|
|
||||||
C-->D;
|
|
||||||
```
|
|
|
@ -1,7 +1,5 @@
|
||||||
mod post;
|
mod post;
|
||||||
|
|
||||||
pub use post::{Post, PostMetadata};
|
|
||||||
|
|
||||||
cfg_if::cfg_if! {
|
cfg_if::cfg_if! {
|
||||||
if #[cfg(feature = "ssr")] {
|
if #[cfg(feature = "ssr")] {
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
@ -16,8 +14,10 @@ cfg_if::cfg_if! {
|
||||||
impl Data {
|
impl Data {
|
||||||
#[allow(dead_code)] // Use in main.rs
|
#[allow(dead_code)] // Use in main.rs
|
||||||
pub fn new() -> anyhow::Result<Self> {
|
pub fn new() -> anyhow::Result<Self> {
|
||||||
let posts = crate::app::utils::data_src::get_all::<Post>("posts")?
|
let mut posts = crate::app::utils::data_src::get_all::<Post>("posts")?;
|
||||||
.into_iter()
|
posts.sort_by(|post, post2| post2.metadata.date.cmp(&post.metadata.date));
|
||||||
|
|
||||||
|
let posts = posts.into_iter()
|
||||||
.map(Arc::new)
|
.map(Arc::new)
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
@ -47,4 +47,6 @@ cfg_if::cfg_if! {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub use post::{Post, PostMetadata};
|
||||||
|
|
|
@ -38,7 +38,7 @@ cfg_if::cfg_if! {
|
||||||
let matter = Matter::<YAML>::new();
|
let matter = Matter::<YAML>::new();
|
||||||
let mut post_data = matter
|
let mut post_data = matter
|
||||||
.parse_with_struct::<PostMetadata>(&content)
|
.parse_with_struct::<PostMetadata>(&content)
|
||||||
.ok_or_else(|| PostDeserializationError::InvalidFrontMatter)?;
|
.ok_or(PostDeserializationError::InvalidFrontMatter)?;
|
||||||
|
|
||||||
let content = post_data.content;
|
let content = post_data.content;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue