commit b70fef847f69bc7a303ca2af4909b152020bb0c2
parent ff9804e3cf9ecb695deb0b7624731053ea8fc89d
Author: Natalie Pendragon <natpen@natpen.net>
Date: Sat, 9 May 2020 14:07:02 -0400
[serve] Add documentation for content_types
Diffstat:
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/gus/serve.py b/gus/serve.py
@@ -61,8 +61,29 @@ def index(request):
"",
"GUS obeys User-agent of \"gus\" and \"*\".",
"",
- "If you encounter problems with GUS, or have ideas",
- "for its future, please email me at natpen@natpen.net.",
+ "If you have questions about or ideas for GUS, please",
+ "email me at natpen@natpen.net.",
+ "",
+ "# Advanced Searching",
+ "",
+ "To improve the quality of your search results, you can",
+ "use the following syntax to limit your results to specific",
+ "content types:",
+ "",
+ "<a search query> content_type:<a content type>",
+ "",
+ "You can specify a general content type, like `audio`, or",
+ "a more specific one like `audio/mp3`.",
+ "",
+ "Here are some useful content types to get started with:",
+ "- application/zip",
+ "- audio/mp3",
+ "- audio/mpeg",
+ "- image/gif",
+ "- image/jpg",
+ "- image/jpeg",
+ "- text/gemini",
+ "- text/plain"
])
data.extend(_render_footer())
return Response(Status.SUCCESS, "text/gemini", "\n".join(data))
@@ -91,8 +112,7 @@ def _get_search_suggestions(query):
def _render_search_suggestions(suggestions):
data = []
if len(suggestions) == 0:
- data.append("No results, which means it's time")
- data.append("to go create some hot new content!")
+ data.append("No results!")
return data
data.append("Search suggestions:")
for suggestion in suggestions: