Strange behavior with _index.md

I’m using Hugo for my course website. I did so for an earlier version of the course in Fall 2017 and it worked without any problems. Then for the Fall 2020 version, in content/ I copied over what was in the fall17 directory to a new fall20 directory and made some minor changes the text. Now I get some weird behavior (compare https://www.sketchingbigdata.org/fall20/ with https://www.sketchingbigdata.org/fall17/):

  • The navbar is all wrong; it should be like the subpage syllabus on fall20/ (sorry but the discussion forum won’t let me put > 2 links in this post, else I would have written the link in full!)
  • “Sketching Algorithms” for some reason appears twice at the top.
  • There should be no text under “linear algebra”, but other text is randomly showing up (seems to be text from the syllabus and project subpages of fall20/).

What I thought should display at fall20/ is what’s in content/fall20/_index.md. That file is very similar to content/fall17/_index.md, which seems to be working just fine. Any ideas what might be causing the fall20 issues?

Some more info:

  • Here’s a copy of _index.md

    +++
    date = “2020-08-01T00:00:00”
    draft = false
    title = “Sketching Algorithms”
    type = “class”
    section_id = 10
    weight = 10

    [[navLinks]]
    title = “Home”
    url = “can’t put > 2 links”
    [[navLinks]]
    title = “Lectures”
    url = “can’t put > 2 links”
    [[navLinks]]
    title = “Assignments”
    url = “can’t put > 2 links”
    [[navLinks]]
    title = “Syllabus”
    url = “can’t put > 2 links”
    [[navLinks]]
    title = “Project”
    url = “can’t put > 2 links”
    [[navLinks]]
    title = “Piazza”
    url = “hugo discussion forum won’t let me put > 2 links”
    [[navLinks]]
    title = “Staff”
    url = “can’t put > 2 links”
    +++

    Sketching Algorithms

    CS 294-165 - Fall 2020 ([Syllabus](can’t put > 2 links))

    Sketching algorithms compress data in a way that is still useful for answering some pre-specified family of queries, possibly across datasets by comparing sketches. This course will cover mathematically rigorous models for developing such algorithms, as well as some provable limitations of algorithms operating in those models. Some topics covered include:

    • Streaming algorithms. Compute useful statistics over a dataset making only one pass over it, while using little memory.

    • Dimensionality reduction. General techniques and impossibility results for reducing data dimension while still preserving geometric structure.

    • Randomized linear algebra. Algorithms for big matrices (e.g. a user/product rating matrix for Netflix or Amazon). Regression, low rank approximation, clustering, etc.

    • Compressed sensing. Recovery of (approximately) sparse signals based on few linear measurements.

      This is a graduate course, though there may be room for a limited number of advanced undergraduate students satisfying the following prerequisites: mathematical maturity and comfort with algorithms (e.g. CS 170), discrete probability, and linear algebra.

  • content/ has in it fall17/ fall20/ and home/ subdirectories. Each of fall17/ and fall20/ have their own files hmwk.md, _index.md, lec.md, project.md, staff.md, and syllabus.md. If I go to any of the subpages of fall20, they seem to work, e.g. fall20/hmwk. But going to the index file is giving this weird behavior, though again, fall17/ works perfectly though.

I’m happy to answer any further questions that might help diagnose this. Thank you!

EDIT: I thought maybe the problem was I should be using index.md and not _index.md, so I made that change. It now works locally when I do hugo server, but it still is rendering weirdly when I deploy online.

There’s been quite a few changes since 2017.

  • Which Hugo version and theme version were you on vs which one currently?

  • It is probably around the .Pages variable: https://gohugo.io/variables/site/#site-pages

  • It would be easier to help if we can see the source in a repo

1 Like

Thanks for your response @pointyfar.

  • I’m now using hugo v0.40.1. I don’t know what version I was using in 2017.
  • I looked at the link you posted about .Pages, but I wasn’t sure how to apply it.
  • The source was in a private repo. I’ve now copied it to a public repo: https://github.com/minilek/forum_help

EDIT: That hugo version is what I have locally. I just noticed that netlify, which I’m using for deployment, is using Hugo 0.26. Also, I’m using the Academic theme.

OK sorry for wasting everyone’s time. After looking through the repo more carefully I realized I must have come across the same issue in Fall 2017 as well, and hack-fixed it by creating a new layouts/fall17/list.html. I copied that into layouts/fall20/list.html and now it works.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.