Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check and update all index pages to meet specs #49

Closed
njr2128 opened this issue Jul 13, 2022 · 0 comments
Closed

check and update all index pages to meet specs #49

njr2128 opened this issue Jul 13, 2022 · 0 comments
Assignees

Comments

@njr2128
Copy link
Member

njr2128 commented Jul 13, 2022

From #21, each index page has been generated from a template. The info in the templates needs to be updated for each page

Template

A template is a single HTML file kept in a special folder in the repo which describes how a class of files should be formatted. It includes variables which, during generation, are filled in with values. Here, the variables are enclosed in $.

For example, the template for a student's index of fieldnotes in a given semester looks something like this:

fieldnote.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="">
    <title>$student$ Fieldnotes | $fullsemester$</title>
</head>
<body>
    <h1>$student$ Fieldnotes | $fullsemester$</h1>
    <p>$intro$</p>
    <br>
    <ul>
    $for(pages)$
        <li><b><a href="$it.link$">$it.title$.</a></b> $it.desc$</li>
    $endfor$
    </ul>
</body>
</html>

YAML metadata

Technically a Markdown file, but the most important thing is the YAML header at the top which details the content for each variable in the template.

There is a one-to-one correspondence between these files and the files that get generated at the end. So, we will need one of these "content files" for each of the files we want to generate.

For example, Nina Elizondo-Garza's content might look something like this:

index.md

---
title: "Nina Elizondo-Garza Fieldnotes"
template: fieldnote
semester: "fa17"
fullsemester: "Fall 2017"
student: "Nina Elizondo-Garza"

intro: "Nina is a person. She was born at a very young age."

pages:
  - title: "Historical Culinary Reconstruction"
    link: "fa17_fld_elizondo-garza_nina_hcr.html"
    desc: ""
  - title: "Verdigris Experiment"
    link: "fa17_fld_elizondo-garza_nina_verdigris-experiment.html"
    desc: ""
  - title: "An Exploration of Bread Making"
    link: "fa17_fld_elizondo-garza_nina_an-exploration-of-bread-making.html"
    desc: ""
  - title: "From Madder Root to Madder Lake"
    link: "fa17_fld_elizondo-garza_nina_from-madder-root-to-madder-lake.html"
    desc: ""
  - title: "Azurite"
    link: "fa17_fld_elizondo-garza_nina_azurite.html"
    desc: ""
  - title: "Flour Stucco and Paste Glue"
    link: "../dongchung_tenzin/fa17_fld_dongchung_tenzin_stucco.html"
    desc: ""
  - title: "Annotation Plans"
    link: "../../ann/stucco_elizono-garza/fa17_ann_stucco_elizondo-garza_annotation-plans.html"
    desc: ""
  - title: "Stucco Annotation Fieldnotes"
    link: "../../ann/stucco_elizono-garza/fa17_ann_stucco_elizondo-garza-stucco-fol-29r-1.html"
    desc: ""
  - title: "Stucco Annotation - Painting Stucco"
    link: "../../ann/stucco_elizono-garza/fa17_ann_stucco_elizondo-garza_stucco-annotation-painting-stucco.html"
    desc: ""
---

Pandoc command

To generate the file corresponding to the index.md for Nina above, use this:

pandoc -s -o index.html --template fieldnote.html index.md

This will generate a file called index.html which looks just like fieldnote.html, but the variables will be filled in with the content from index.md.

CSS/stylesheets

I am still figuring this out. Should be trivial to add it to the template and/or incantation.

Originally posted by @gschare in #21 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants