How fortune9/blogdown-everyday works
Project Type and Purpose
• This is a static website built with the R package blogdown, which uses Hugo (a Go-based static-site generator) under the hood.
• Content is authored as R Markdown (.Rmd) and Markdown (.md) files; the build produces raw HTML/CSS/JS assets.
• The site is deployed via Netlify, providing CI/CD, CDN, and hosting.
Top‐Level Structure and Key Directories
• content/ – All posts and pages in .md or .Rmd.
• layouts/ – Custom Hugo templates (partials, shortcodes, category RSS, etc.).
• themes/diary/ – Theme folder containing CSS, template overrides, assets.
• static/ – Static assets copied verbatim to the site root (images, JS libs, trelliscope outputs).
• Config files:
• config.toml – Hugo site settings (base URL, menus, parameters).
• netlify.toml – Netlify build & deploy settings.
• Project metadata: .gitignore, .gitmodules, .Rproj, README.
Main Components
a. Content Authoring Environment
• *R/RStudio + blogdown package*
• Sources: .Rmd & .md in content/, theme code in themes/, Hugo templates in layouts/.
b. Static‐Site Generator
• *blogdown* orchestrates Hugo: converts R Markdown to Markdown, then Hugo compiles everything into HTML/CSS/JS.
c. Asset Store
• static/ directory for images, JS, CSS, plus auto‐generated public/ (implied output).
d. Version Control
• Git repository containing source, theme submodule, build scripts.
e. CI/CD & Hosting
• Netlify build: triggered by Git push → reads netlify.toml & config.toml → runs blogdown/Hugo build → publishes to Netlify’s CDN.
f. End Users
• Web browsers hit Netlify’s CDN endpoint (HTTPS), retrieve static assets.
Component Interactions and Data Flow
• Developer writes/edits content/*.Rmd or *.md →
• blogdown in R converts Rmd → md, then calls Hugo →
• Hugo processes templates (layouts/, theme) + content →
• Generates static files into a public/ folder (HTML, CSS, JS, images) →
• Git commit & push to remote →
• Netlify CI detects push, reads netlify.toml →
• Runs build commands (blogdown::build_site() or hugo) →
• Deploys build output to Netlify CDN →
• Visitors’ browsers request pages, CDN serves static files.
Architectural Patterns and Design Principles
• Static Site Generation (SSG): separation of content & presentation; no server‐side logic at runtime.
• CI/CD Pipeline: automated build+deploy on Git push.
• Theme‐based UI: reusable templates, partials & shortcodes for consistent layout.
• Modular Content: granular posts/pages under content/, each compiled independently.
• Asset Pipeline: Rmd → md → HTML + bundling of static assets.
Essential Details to Capture
• The two‐step build (Rmd→md via blogdown, then md→HTML via Hugo).
• Role of layouts/ & themes/ in shaping the output.
• Netlify’s automated workflow governed by netlify.toml.
• Static asset flow from static/ into final site.