Skip to content

checklist for a blog post with PDF(s) in the Lumber Collection

Devin Becker edited this page Dec 2, 2021 · 21 revisions

checklist for a blog post with PDF(s) added to the Lumber collection


Step 1: fetch origin from spec-lumber repository in GitHub Desktop

  1. Open GitHub Desktop
  2. Set "Current Repository" to "spec-lumber"
  3. click "fetch origin"

Step 2: add digital objects to GitHub repository

  1. open Windows File Explorer
  2. add PDF files to Documents/GitHub/spec-lumber/objects/archives folder

Step 3: add metadata to csv sheet

  1. add image metadata to the Lumber metadata csv Google sheet
    • NOTE: when adding PDFs to the csv sheet, make sure the "format" column is "application/pdf." If this is missing, it will break.
    • NOTE: make sure the "filename" column lists the extension as .pdf. When you run the rake generate_derivatives command on a pdf file (see Step 7), it will also generate some .jpg files (to use as the preview images). However, you only need to add the .pdf extension in the csv spreadsheet because when you add the objectid in the blog post (for example, in the cover-image or an include command), it will automatically pull the .jpg if necessary.
    • NOTE: view this metadata guide if you're unsure how to fill out spreadsheet
    • NOTE: file names cannot contain any spaces, or the rake generate_derivatives command will not work.
    • NOTE: file naming best practice includes only using lowercase letters, and using descriptive naming (i.e. pg83-folder2-item5).

Step 4: add csv sheet to GitHub repository

  1. open the Lumber metadata csv Google sheet and go to File/Download/comma-separated values (.csv) to download the Google sheet as a csv
  2. open Windows File Explorer and navigate to Documents/GitHub/spec-lumber/_data and replace the existing lumber.csv with the csv you just downloaded from Google sheets

Step 5: open Visual Studio Code

  1. open GitHub Desktop and click "Open in Visual Studio Code." This will open the spec-lumber repository in Visual Studio Code

Step 6: open terminal

  1. in Visual Studio Code, click on "Terminal" and "New Terminal" in the top menu
    • NOTE: make sure the terminal is set to "bash." The terminal should look similar to this:

If your terminal does NOT look like this, try the following:

  • make sure you're viewing the "Terminal tab" (view tabs at top left of screenshot)
  • make sure your terminal is using Bash. You can view different terminal types where it says "1: bash" in the screenshot and use the drop down menu to select the correct terminal.

Step 7: generate derivatives of digital objects

  1. in Visual Studio Code, type rake generate_derivatives into the terminal and hit Enter. This should create derivatives of the digital object(s) you put into the Documents/GitHub/spec-lumber/objects/archives folder.

Step 8: move derivatives to S: Drive

  1. move derivatives FROM Documents/GitHub/spec-lumber/objects TO Shared (S:) drive/Webpages/Library/spec/harvester/objects
    • NOTE: when running the rake generate_derivatives command on a .pdf file, it will also generate .jpg files. That's okay - just be sure to transfer the contents of an entire folder to its corresponding folder.
    • NOTE: it's important to move derivatives into the correct folder, or it can lead to broken images. Use the color code:

Step 9: create new markdown file in Visual Studio Code

  1. in Visual Studio Code, type rake new_post title="title of post" into the terminal and hit the Enter key. A new post should be created in the _posts folder (which you can find in the left-hand navigation menu in Visual Studio Code)
    • NOTE: the "date" field at the top of the blog post is what dictates when the post goes live on Harvester. The file name (left hand menu) includes the date, but has no effect on when the post goes live. BEST PRACTICE is to match these two dates to whenever you want the post to go live. To change the file name, right-click on the file name (left hand menu) and click "Rename."

Step 10: add frontmatter to post

  1. in Visual Studio Code, open the new post you just created. Add the top fields as applicable.
  2. to add pdfs to the cover-image, just paste the objectid like you normally would. It will automatically pull the jpg (which was generated in the rake generate_derivatives command) for the cover image and previews, etc.

Step 11: add digital objects to post

  1. to add pdfs to the body of the post, use the following command and add the objectid from the Lumber csv spreadsheet: {% include feature/item-pdf-embed.html objectid="lumber###" %}

Step 12: preview your post

  1. when the content of your post has been written in Visual Studio Code, you can preview the post by typing bundle exec jekyll s -i into the terminal
    • NOTE: PDFs will not render properly in the jekyll preview. This is okay!
    • NOTE: the date field at the top must be set for the present day or before. If the date is set for the future, you won't be able to view the post in the preview.

NOTE: if you receive a terminal error like this, it means there is an error in the code that is preventing it from fully parsing. The error will tell you which file, line, and column to look in, so you can narrow your search for the error. Here is the terminal error it will show you:

Here is the error (should be ["category"] with a closing bracket).

Step 13: stage your changes

  1. Go to the Source Control view in Visual Studio Code

  1. click on the "+" (plus) symbol to stage your changes

Step 14: commit your changes

  1. once your changes are staged, add a descriptive message about what your changes are. Then click on the "checkmark" to commit your changes to your local GitHub repository on your local machine

Step 15: push your changes

  1. open GitHub Desktop. You should see your descriptive message on the bottom left. If you've committed changes by accident, you can undo your commit here. If you want to push your commit, click on "Push Origin" at the top. This will push your commits to the cloud GitHub Repo, and will make your changes live on the Harvester website in approx. 5-10 minutes, or whenever the post is scheduled.

Clone this wiki locally