{"id":13665795,"url":"https://github.com/r-lib/hugodown","last_synced_at":"2025-03-17T16:11:03.970Z","repository":{"id":44769471,"uuid":"264964079","full_name":"r-lib/hugodown","owner":"r-lib","description":"Make websites with hugo and RMarkdown","archived":false,"fork":false,"pushed_at":"2024-08-19T08:40:04.000Z","size":1331,"stargazers_count":166,"open_issues_count":22,"forks_count":24,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-02T13:11:17.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hugodown.r-lib.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-lib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-18T14:26:06.000Z","updated_at":"2025-01-29T08:18:11.000Z","dependencies_parsed_at":"2024-11-09T21:08:35.463Z","dependency_job_id":null,"html_url":"https://github.com/r-lib/hugodown","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fhugodown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fhugodown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fhugodown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fhugodown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/hugodown/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066180,"owners_count":20392406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T06:00:50.837Z","updated_at":"2025-03-17T16:11:03.925Z","avatar_url":"https://github.com/r-lib.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"\n# hugodown \u003cimg src='man/figures/logo.png' align=\"right\" height=\"138.5\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n[![R-CMD-check](https://github.com/r-lib/hugodown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/hugodown/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/hugodown/branch/master/graph/badge.svg)](https://codecov.io/gh/r-lib/hugodown?branch=master)\n\u003c!-- badges: end --\u003e\n\nhugodown is an experimental package that aims to facilitate the use of [RMarkdown](http://rmarkdown.rstudio.com/) and [hugo](http://gohugo.io/) together. It's similar to [blogdown](https://bookdown.org/yihui/blogdown/), but is focussed purely on Hugo websites, and enforces a stricter partitioning of roles: hugodown is responsible for transforming `.Rmd` to `.md`, and hugo is responsible for transforming `.md` to `.html`.\n\n## Compared to blogdown\n\n* It only re-runs your R code when you explicitly ask for it (by knitting the \n  post). This makes hugodown considerably easier to use for long-running blogs \n  and blogs with multiple contributors. \n  \n* Local previews are pinned to a specific version of hugo. This makes it easier\n  to work with multiple blogs, and protects your from hugo \u003c-\u003e theme \n  version incompatibilities.\n  \n* It provides support for getting started with a limited number of themes,\n  automatically making needed tweaks to ensure that html widgets, syntax \n  highlighting, and math display work out of the box.\n\n* It does not currently support within page cross-references for figures, \n  tables, and equations.\n\n* It is more opinionated about hugo configuration; see `vignette(\"config\")` \n  for details.\n  \n* It is designed around a single Rmarkdown format, `.Rmd`.\n\n## Installation\n\nhugodown isn't available from CRAN yet (and might never be), but you can install the development version from GitHub with:\n\n``` r\ndevtools::install_github(\"r-lib/hugodown\")\n```\n\n## Usage\n\nThe key to using hugodown is to put `output: hugodown::md_document()` in the YAML metadata of your `.Rmd` files. Then knitting the file will generate a `.md` file designed to work well with hugo. The rest of hugodown just makes your life a little easier:\n\n* `hugo_start()` will automatically start a hugo server in the background,\n  automatically previewing your site as you update it.\n\n* `use_post()` will create a new post (filling in default content from\n  the hugo [archetype](https://gohugo.io/content-management/archetypes/)).\n  \n* To knit an `.Rmd` post, you can use the Knit button to knit to the correct output format. You can also use the keyboard shortcut `Cmd+Shift+K` (Mac) or `Ctrl+Shift+K` (Windows/Linux).\n  \n* `site_outdated()` lists all `.Rmd` files that need to be re-rendered \n  (i.e. they have changed since the last time their `.md` was rendered).\n  \nWith hugodown, knitting an individual post and building the site are two separate processes. A good workflow when working with an existing Hugo site in RStudio is to open the site's `.Rproj` file, use `hugo_start()`, then add or edit your posts. Because the hugo server will only add `.Rmd` content to your site preview after knitting, you'll need to use the keyboard shortcut to knit first.\n\n### Citations\n\nTo use citations in a blog post, just provide a `bibliography` in the YAML metadata. If you want to use footnotes for citations (a style that generally works well in blogs), you'll need to find a footnote style CSL file (e.g. [`chicago-fullnote-bibliography.csl`][footnote-csl], and use the following YAML header.\n\n```yaml\nbibliography: refs.bib\nsuppress-bibliography: true\ncsl: chicago-fullnote-bibliography.csl\n```\n\n## Converting from blogdown\n\n* Make sure your post archetype has extension `.Rmd` and includes\n  `output: hugodown::md_document` in the YAML. The post archetype\n  should typically be `archetypes/blog/index.Rmd`.\n  \n* Delete `index.Rmd` from the root of your site.\n\n* Ensure that hugo is configured as described in `vignette(\"config\")`.\n\n[yihui-mathjax]: https://yihui.org/en/2018/07/latex-math-markdown/ \n[tourmaline]: https://github.com/rstudio/hugo-tourmaline\n[footer_mathjax]: https://github.com/rstudio/hugo-tourmaline/blob/master/layouts/partials/footer_mathjax.html\n[footer]: https://github.com/rstudio/hugo-tourmaline/blob/master/layouts/partials/footer.html#L22\n[math_code]: https://github.com/rstudio/hugo-tourmaline/blob/master/static/js/math-code.js\n[styles]: https://xyproto.github.io/splash/docs/all.html\n[footnote-csl]: https://github.com/citation-style-language/styles/blob/master/chicago-fullnote-bibliography.csl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fhugodown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Fhugodown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fhugodown/lists"}