-
Notifications
You must be signed in to change notification settings - Fork 0
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
Reduce redundancy in the front-matter of markdown pages #22
Comments
One note about this is that there needs to be a distinction between the name on the card and the name on the page's banner. In #10 there was the comment about including One pro that I see with keeping it in the front matter is that the pages can now use the default layout since the text isn't hardcoded in the layout. |
I see what you're saying. Another possibility to consider: prepend the "Goal" or "Sub-Goal" text to the title conditionally. I have not tested this, but as an example:
See: Section variables |
This kind of machinery kind of scares me because
Are you fairly set on getting rid of the 'title' line? If so I'll go ahead and make the change-but I have the reservations above |
Yes, these are good points. Another idea: markdown: ---
title_prefix: "Sub-Goal"
title: "Habitat"
image: "/images/methodology/goals/biodiversity/card.jpg"
--- template: {{ $pageTitle := .Params.title }}
{{ with .Params.title_prefix }}
{{ $pageTitle = printf "%s : %s" . $pageTitle }}
{{ end }}
<h1>{{- $pageTitle -}}</h1> Not exactly DRY because |
Update the layouts so that the markdown front-matter doesn't require repeated information. For example, change:
to
The text was updated successfully, but these errors were encountered: