2024-03-07
Here’s a summary of the key files created within the starter blog project:
| File | Description | 
|---|---|
| _quarto.yml | Quarto project file. | 
| index.qmd | Blog home page. | 
| about.qmd | Blog about page. | 
| posts/ | Directory containing posts | 
| posts/_metadata.yml | Shared options for posts | 
| styles.css | Custom CSS for website | 
format functions - create markup for specific fields
e.g. format_post_name, format_abstract, format_slides, format_keywords, format_event
yaml_kv for fixing up yaml entries properly
talk_to_params - create data frame with columns that map to key-value pairs
create_talk - creates whole qmd file from parameters
get_image_link - creates an image for the talk
talk_to_params()Goal: Format all the components of the qmd posts, keeping results in a data frame
create_talk()Goal: Create a qmd file from a single row of data
get_image_link()Goal: Get something to use as a cover image
yaml_kv for fixing up yaml entries properly
format functions - create markup for specific fields
e.g. format_title, format_github, format_addendum, format_citation, `format_bibtex
pub_to_params - create data frame with columns that map to key-value pairs
create_paper - creates whole qmd file from parameters
pub_to_params()Goal: Format all the components of the qmd post, keeping results in a data frame
Works similarly to talk_to_params() but:
create_paper()Goal: Create a qmd file from a single row of data
name: 'Trigger update of CV and srvanderplas.github.io'
on:
  push:
    branches: main
      
jobs:
  trigger_workflow:
    runs-on: ubuntu-latest
    steps:
      - name: Echo workflow name
        shell: bash
        run: |
          echo "I am workflow of cv-data"
      - name: Trigger site repo build
        uses: convictional/trigger-workflow-and-wait@v1.6.1
        with: # Set up for each dependency
          owner: srvanderplas
          repo: srvanderplas.github.io
          github_token: ${{ secrets.GH_TOKEN }}
          workflow_file_name: publish.yml
          ref: main
          wait_interval: 100
          propagate_failure: false
          trigger_workflow: true
          wait_workflow: false
The important part:
on:
  workflow_dispatch:
  push:
    branches: mainEverything else:
name: Quarto Publish
jobs:
  build-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Install libcurl on Linux
        if: runner.os == 'Linux'
        run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev
      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2
        with:
          tinytex: false
      - name: Quarto version
        run: |
          quarto --version
      - name: Check out repository
        uses: actions/checkout@v4
        with:
          submodules: recursive
          token: ${{ secrets.GITHUB_TOKEN }}
      - name: Install R
        uses: r-lib/actions/setup-r@v2
        with:
          use-public-rspm: true
      - name: Setup renv
        uses: r-lib/actions/setup-renv@v2
        with:
          cache-version: 1
      - name: Publish
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: gh-pages
        env:
          GS_AUTH: ${{ secrets.GS_AUTH }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}