-
Notifications
You must be signed in to change notification settings - Fork 10
Minor changes affecting Atom feed and Tag URLs #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this actually changes something? I think utf8 and utf-8 are synonymous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thise change seems reasonable, can you write a test case that ensures that the replace is working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.