diff --git a/_freeze/index/execute-results/html.json b/_freeze/index/execute-results/html.json new file mode 100644 index 0000000..9bbbc63 --- /dev/null +++ b/_freeze/index/execute-results/html.json @@ -0,0 +1,16 @@ +{ + "hash": "2c3cc6a744947daa31d2556b03e05fdf", + "result": { + "markdown": "---\ntitle: \"rdiscovery\"\nsubtitle: A blog by Layal Christine Lettry\nlisting:\n contents: posts\n feed: true\n sort: \"date desc\"\n type: default\n categories: true\n sort-ui: false\n filter-ui: false\npage-layout: full\ntitle-block-banner: true\nimage: profile_cat.jpg\n---\n\n::: {.cell}\n\n:::\n\n\n\nHidden link used to verify my account on fosstodon.org \nHidden link used to verify my account on LinkedIn\nHidden link used to verify my account on Twitter \nHidden link used to verify my account on GitHub \n", + "supporting": [ + "index_files" + ], + "filters": [ + "rmarkdown/pagebreak.lua" + ], + "includes": {}, + "engineDependencies": {}, + "preserve": {}, + "postProcess": true + } +} \ No newline at end of file diff --git a/_quarto.yml b/_quarto.yml index 083a9a0..4bdd5bb 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -3,18 +3,37 @@ project: website: title: "rdiscovery" + description: "Explore R with Layal Christine Lettry" navbar: + title: false + background: "#eee" + left: + - href: index.qmd + text: Home + - href: index.xml + text: RSS right: - about.qmd - icon: github - href: https://github.com/Layalchristine24/rdiscovery - - icon: twitter - href: https://twitter.com/LettryL - - icon: linkedin - href: https://linkedin.com/in/layal-christine-lettry-529b4471/ - - icon: mastodon - href: https://fosstodon.org/@layal - site-url: "https://rdiscovery.netlify.app" + href: https://github.com/Layalchristine24 + - text: Social + menu: + - icon: twitter + href: https://twitter.com/LettryL + - icon: linkedin + href: https://linkedin.com/in/layal-christine-lettry-529b4471/ + - icon: mastodon + href: https://fosstodon.org/@layal + - text: Sites + menu: + - href: http://layalchristinelettry.rbind.io/ + text: Homepage + - href: https://rdiscovery.netlify.app + text: rdiscovery blog + site-url: https://rdiscovery.netlify.app + repo-url: https://github.com/Layalchristine24/rdiscovery + open-graph: true + search: false format: html: diff --git a/index.qmd b/index.qmd index 2e9e845..32029bd 100644 --- a/index.qmd +++ b/index.qmd @@ -1,5 +1,6 @@ --- title: "rdiscovery" +subtitle: A blog by Layal Christine Lettry listing: contents: posts feed: true @@ -10,4 +11,62 @@ listing: filter-ui: false page-layout: full title-block-banner: true +image: profile_cat.jpg --- + +```{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 +post_redirects <- paste0("/", slugs, " ", "/posts/", posts) + +# function to extract post categories from index.qmd files +get_post_categories <- function(post) { + file <- here::here("posts", post) |> fs::path("index.qmd") + if(!fs::file_exists(file)) { + return(character(0)) + } + file |> + readLines() |> + stringr::str_subset("^categories:") |> + stringr::str_extract("\\[.*\\]") |> + stringr::str_remove_all("[\\[\\]]") |> + stringr::str_split(", ") |> + unlist() +} + +# extract the categories +categories <- purrr::map(posts, get_post_categories) |> + unlist() |> + unique() + +# extract categories in nice form +keys <- categories |> + stringr::str_to_lower() |> + stringr::str_replace_all(" ", "-") + +# extract categories in ugly form +values <- categories |> + stringr::str_replace_all(" ", "%20") + +# category redirects +category_redirects <- paste0("/category/", keys, " ", "/#category=", values) + +# write the _redirect file +writeLines(c(post_redirects, category_redirects), here::here("_site", "_redirects")) +``` + + +Hidden link used to verify my account on fosstodon.org +Hidden link used to verify my account on LinkedIn +Hidden link used to verify my account on Twitter +Hidden link used to verify my account on GitHub diff --git a/profile_cat.jpg b/profile_cat.jpg new file mode 100644 index 0000000..3bb73be Binary files /dev/null and b/profile_cat.jpg differ