Skip to content
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

Wrong post URL in atom.xml when we have multiple blog languages #136

Closed
SilverRainZ opened this issue Apr 24, 2022 · 1 comment · Fixed by #142
Closed

Wrong post URL in atom.xml when we have multiple blog languages #136

SilverRainZ opened this issue Apr 24, 2022 · 1 comment · Fixed by #142

Comments

@SilverRainZ
Copy link
Contributor

Describe the bug

All my posts directly located under path blog, but in the generated atom.xml, all post URL has a extra "zh_CN" insuffix:

<feed xml:lang="zh_CN">
<id>https://silverrainz.me/</id>
<title>银色子弹</title>
<updated>2022-04-22T12:17:50.750363+00:00</updated>
<link href="https://silverrainz.me/"/>
<link href="https://silverrainz.me/zh_CN/blog/atom.xml" rel="self"/>
<generator uri="https://ablog.readthedocs.org/" version="0.10.25">ABlog</generator>
<subtitle>Yes silver bullet here.</subtitle>
<entry>
<id>
https://silverrainz.me/zh_CN/blog/idf-reverse-writeup.html   <<<<<<<<<<<<<<<<<<<<<<< SEE EHRE
</id>
<title>IDF 实验室逆向题部分题解</title>
<updated>2015-01-02T00:00:00+00:00</updated>
<author>
<name>Shengyu Zhang</name>
</author>
....

The correct URL should be https://silverrainz.me/blog/idf-reverse-writeup.html

The full atom.xml file: https://gist.github.com/SilverRainZ/88a706344449d8f7f9fd587ac52e1e94

To Reproduce

Have multiple entries in your blog_languages confval, for example:

I have the following snippet in my conf.py:

blog_path = 'blog'
# ...
blog_languages = {
    'zh_CN': ('Chinese', None),
    'en':     ('English',  None),
}
blog_default_language = 'zh_CN'

If I changes the conf to:

blog_path = 'blog'
# ...
blog_languages = {
    'zh_CN': ('Chinese', None),
    # 'en':     ('English',  None),
}
blog_default_language = 'zh_CN'

Everything goes well.

What happened?

No response

Expected behavior

No response

Screenshots

No response

System Details

  • python 3.10.4
  • sphinx 4.5.0
  • ablog 0.10.25

Installation method

No response

@nabobalis
Copy link
Contributor

I thought I would try to fix this in #142
Changing to make sure that join() never gets a None value was simple enough but as far as I can see, the url should never have the language set in the URL. So I removed that block of code instead.

It should be in the next release of ablog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants