Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blag/blag.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def generate_feed(
)

with open(f"{output_dir}/atom.xml", "w") as fh:
feed.write(fh, encoding="utf8")
Copy link
Owner

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.

Copy link
Author

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.

Copy link
Owner

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.

feed.write(fh, encoding="utf-8")


def generate_index(
Expand Down
2 changes: 2 additions & 0 deletions blag/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def convert_markdown(
* `date` is converted into datetime with local timezone
* `tags` is interpreted as a comma-separeted list of strings.
All strings are stripped and converted to lower case.
All strings have spaces replaced with dashes.

Parameters
----------
Expand Down Expand Up @@ -85,6 +86,7 @@ def convert_markdown(
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]
Copy link
Owner

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?

Copy link
Author

@bbbhltz bbbhltz Apr 24, 2025

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.

meta["tags"] = tags

return content, meta
Expand Down