Minor changes affecting Atom feed and Tag URLs#283
Minor changes affecting Atom feed and Tag URLs#283bbbhltz wants to merge 2 commits intoventhur:masterfrom
Conversation
https://validator.w3.org/feed/ feed validation * changed replace space in tags with dash
blag/blag.py
Outdated
| ) | ||
|
|
||
| with open(f"{output_dir}/atom.xml", "w") as fh: | ||
| feed.write(fh, encoding="utf8") |
There was a problem hiding this comment.
Are you sure this actually changes something? I think utf8 and utf-8 are synonymous.
There was a problem hiding this comment.
I think they are synonymous, but after making that change my atom feed passed the W3C Feed Validation Test.
e.g. this atom feed compared to this one, both are valid.
There was a problem hiding this comment.
Very good catch, thank you! I've fixed this and added a test for correct encoding in a separate PR.
| tags = meta["tags"].split(",") | ||
| tags = [t.lower() for t in tags] | ||
| tags = [t.strip() for t in tags] | ||
| tags = [t.replace(" ","-") for t in tags] |
There was a problem hiding this comment.
Thise change seems reasonable, can you write a test case that ensures that the replace is working?
There was a problem hiding this comment.
I can certainly try, and I might also suggest changing it to:
tags = ['-'.join(t.split()) for t in tags]
in case of accidental double-spaces.
Hi,
I'm really enjoying this software. I have two small suggestions. I am still very green when it comes to Python and website development, but I don't think these small changes break anything.