diff options
author | Zhiming Wang <zmwangx@gmail.com> | 2015-06-09 10:12:59 -0700 |
---|---|---|
committer | Zhiming Wang <zmwangx@gmail.com> | 2015-06-09 10:12:59 -0700 |
commit | 420c4fd7aeb9c4685d0c7e0f285f323130bc5b8c (patch) | |
tree | a24c54c7700a4449ff215d5eabf035ceab9a3263 | |
parent | f23eba63dfcc6ba51b16a3112ab7c9c9dd2f8fe2 (diff) | |
download | my_new_personal_website-420c4fd7aeb9c4685d0c7e0f285f323130bc5b8c.tar.xz my_new_personal_website-420c4fd7aeb9c4685d0c7e0f285f323130bc5b8c.zip |
pyblog: do not include line-number classes in feed
For one thing, the top attribute is not recommended in feeds (see
https://github.com/zmwangx/zmwangx.github.io/issues/2). Also, extracting
line numbers (which are useless in feeds) make the feeds smaller.
-rwxr-xr-x | pyblog | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -385,6 +385,9 @@ def generate_index_and_feed(): article.header.extract() if article.footer is not None: article.footer.extract() + # remove line numbers + for line_number_span in article.find_all("span", attrs={"class": "line-number"}): + line_number_span.extract() entry.content_html = ''.join([str(content) for content in article.contents]) entry.content = ET.Element("content", type="html") |