This patch implements theme_robotstxt() for better output.

It also changes some parts of the code for better readability without changing any functionality.

CommentFileSizeAuthor
theme_robotstxt.patch6.18 KBmustafau

Comments

david strauss’s picture

Can you explain why you would want to run robots.txt through a theme function?

mustafau’s picture

Drupal core outputs RSS and OPML through theme functions. It is the suggested way. This way you do not need to call "exit;" in robotstxt_robots() function.

rmiddle’s picture

Status: Needs review » Reviewed & tested by the community

This Patch looks ok. These are the changes being made in this patch that I can see.

1. It changes all refers from robots.txt to /robots.txt
2. It adds theming support.
3. Adds some minor text and formating changes.

Thanks
Robert

hass’s picture

Status: Reviewed & tested by the community » Needs work

I don't understand why you are adding a slash in front of every "robots.txt". This is not required at all and would only break the stable translations. We know all that drupal URLs starting without a slash are paths from base_path. About the rest I'm also not sure why we need this as this is a plain text file that never needs to be "themed". Not sure why we should waste time and memory for this.

mustafau’s picture

I think theming in Drupal means not only outputting HTML but also outputting XML (RSS, Atom, OPML), plain text...

hass’s picture

Do you have a real world or other module or core example for theming a text file like robots.txt? What do you like to "theme" on a simple TXT file that will "ever" be a txt file?

rmiddle’s picture

#6 hass,

See #2. I can't say for certain that is true but it is right in the thread.

Thanks
Robert

mustafau’s picture

Status: Needs work » Closed (won't fix)