-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog.qmd
44 lines (39 loc) · 929 Bytes
/
blog.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
title: "Today I learned"
subtitle: A (data science & R-Stats) blog where I chronicle my journey learning new things.
listing:
type: default
fields: [image, title, description, date, reading-time]
page-size: 12
feed: true
contents: posts
sort-ui: true
#filter-ui: true
sort: "date desc"
categories: true
page-layout: full
title-block-banner: true
image: data/images/karat.png
---
<style>
#title-block-header {
margin-block-end: -2rem;
position: relative;
margin-top: -1px;
}
</style>
```{r write-redirects}
#| echo: false
# list names of post folders
posts <- list.dirs(
path = here::here("posts"),
full.names = FALSE,
recursive = FALSE
)
# extract the slugs
slugs <- gsub("^.*_", "", posts)
# lines to insert to a netlify _redirect file
redirects <- paste0("/", slugs, " ", "/posts/", posts)
# write the _redirect file
writeLines(redirects, here::here("_site", "_redirects"))
```