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

Zola doesn't load .txt files as templates in Tera #2768

Open
ky-bean opened this issue Jan 13, 2025 · 0 comments
Open

Zola doesn't load .txt files as templates in Tera #2768

ky-bean opened this issue Jan 13, 2025 · 0 comments

Comments

@ky-bean
Copy link

ky-bean commented Jan 13, 2025

Bug Report

Environment

Zola version: 0.19.2

Expected Behavior

Zola should allow .txt files to be loaded as available templates.

Current Behavior

Running zola build yields:

Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 2 pages (0 orphan) and 2 sections
Error: Failed to serve the site
Error: Failed to render 'robots.txt'
Error: Reason: Template '[other.txt]' not found

Step to reproduce

  • Create a zola site
  • Add a file to the templates/ folder that ends in .txt, e.g. other.txt
  • In another template, try to include the .txt file in the template, e.g. {% include "other.txt" %}
  • Attempt to build the site with zola build or similar

Background

I was looking to add some functionality to my site in the form of utilizing a blocklist to extend my robots.txt. I tried simply extending the default robots.txt with an include but it failed as above. In looking for prior art regarding my use-case I came across this forum post describing the same issue. The discussion concluded with @Keats suggestion that adding txt to the file formats loaded by Tera should be fine.

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

1 participant