avillafiorita / jekyll-datapage_gen

Generate one page per yaml record in Jekyll sites.
372 stars 80 forks source link

Periods not being stripped from names; breaks file extensions #89

Open lfracalossiFA opened 4 years ago

lfracalossiFA commented 4 years ago

I am trying to generate a number of pages for a list of event speakers. I am having issues when the speaker wishes their degree, i.e. "Ph.D." added as part of their name. The periods are not being stripped, and the result is that in writing the filename, the generator reaches the file extension prematurely, causing havoc in the filesystem. The rendered result is something like this:

Screen Shot 2020-11-06 at 1 46 41 PM

FWIW, I'm not having issues when the "." is in the middle of the name (i.e. "Taylor A. Murphy" becoming "taylor-a.-murphy.html")

I could write my own name_expr, but then I'd give up all the sanitizing stuff you're already doing.

Is this by design, i.e. do we ever need "."s to appear in names? Or is this something that should be fixed?

avillafiorita commented 4 years ago

Hi, thanks for the report ... ... and this is odd (which bug isn't?)

I had a look at the code: the extension is appended and not the result of a string replacement which might have caused the issue.

Could you send me or post your configuration, so that I can trace the bug?

thanks

lfracalossiFA commented 4 years ago

Hi @avillafiorita, I'm not sure how much info you need, but here are the datapage_gen-related parts of my config.yml file:

plugins:
  - jekyll-datapage-generator

page_gen-dirs: false 

page_gen:
  - data: 'coalesce-sessions-2020'
    template: 'coalesce-agenda-item'
    name: 'title'
    dir: 'coalesce/agenda'
  - data: 'coalesce-speakers-2020'
    template: 'coalesce-speaker'
    name: 'fullName'
    dir: coalesce/speakers

And here are two of the problem items (in a YAML file in _data) that datapage_gen is trying to read:

- fullName: "Taylor A. Murphy, Ph.D."
  firstName: "Taylor"
  lastName: "Murphy"
  title: "Staff Data Engineer"
  company: "GitLab"
  pronouns: "He, him, his"
  twitterHandle: "tayloramurphy"
  location: Tennessee, US
  bio: "Taylor is a data geek who loves increasing efficiency, transparency, and value with data. His background is in Chemical and Biomolecular Engineering, but he learned he loves computers and data more while working as a Data Scientist. When not munging or analyzing data, he enjoys being outdoors with his wife and sons, reading, writing, playing ultimate frisbee, playing with his dogs, and learning about anything related to space."
- fullName: Colleen Tartow, Ph.D.
  firstName: Colleen
  lastName: Tartow
  title: Director of Engineering
  company: Starburst Data
  pronouns: She, her, hers
  twitterHandle: ctartow
  location: Boston, US
  bio: Colleen is the Director of Engineering at Starburst Data, has a PhD in astrophysics, and has been obsessed with data for her entire life. She is determined to make engineering organizations better for both humans and business through mentoring, leadership, and streamlining processes. Her work on data, engineering, analytics, and diversity issues has led to her speaking and mentoring in a variety of venues in Boston and beyond.

I can send along more upon request.

Thanks, Lise