1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/plugins/filters.py

23 lines
496 B
Python

import iso8601
def format_datetime(value):
return iso8601.parse_date(str(value)).strftime("%x")
def category_find(categories, name):
for category_name, articles in categories:
if category_name == name:
return articles
return []
def limit(line, length):
if len(line) <= length:
return line
return " ".join(line.split(" ")[:length]) + '...'
def format_title(value):
space_split = " ".join(value.split("-"))
return space_split.title()