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

feat: add template variables #338

Merged
merged 1 commit into from
Aug 18, 2024
Merged

Conversation

calebdw
Copy link
Contributor

@calebdw calebdw commented Aug 15, 2024

Hello!

This PR adds some more variables that can be used in the footer template (basically everything available in the slide metadata):

  • {title}
  • {sub_title}
  • {location}
  • {event}
  • {date}

There may be a better way of including all the metadata in the FooterContext without having to repeat all the definitions?

Default Template

I tried to add a default footer template, but I couldn't seem to decouple the footer template itself from the template style.

The following template is very common in presentations and I think it would make a great default:

left: "{author}"
center: "{title}" # this can also be a short title
right: "{current_slide} / {total_slides}"

Ideally, I would like to just be able to set the style to template and have the default template used:

theme:
  override:
    footer:
      style: template

However, it seems I must manually define the template for all of my slides

Thanks!

src/theme.rs Outdated Show resolved Hide resolved
@mfontanini mfontanini merged commit 50d6152 into mfontanini:master Aug 18, 2024
6 checks passed
@mfontanini
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants