Page MenuHomeFreeBSD

website: RSS fix news/feed.xml for ru and zh-tw
Needs ReviewPublic

Authored by vladlen on Mon, Nov 17, 5:32 PM.
Tags
Referenced Files
Unknown Object (File)
Fri, Nov 21, 12:56 AM
Unknown Object (File)
Fri, Nov 21, 12:54 AM
Unknown Object (File)
Fri, Nov 21, 12:50 AM
Unknown Object (File)
Tue, Nov 18, 8:04 AM
Unknown Object (File)
Tue, Nov 18, 6:43 AM
Unknown Object (File)
Tue, Nov 18, 1:50 AM
Unknown Object (File)
Tue, Nov 18, 1:23 AM
Unknown Object (File)
Mon, Nov 17, 11:42 PM
Subscribers
None

Details

Reviewers
None
Group Reviewers
doceng
Summary

Translated versions of website generate RSS feed for news from EN data directory.
This patch fixes this issue. The same approach is used as in https://reviews.freebsd.org/D53647 .

Implementation details

  1. Home page (index.html):

link is fixedwith the same variable as previously fixed link to translated news.

  1. RSS feed content (rss.xml):

The code section moved to the beginning of the file to make initialization (similar to D53647). Additional variables added.
tag <title> - for translated version added language code to have different titles in the RSS lists.
tag <link> - correct path for translated versions (containing language code)
tag <language> - for translated versions contains language code (2 or 5 chars - both variants are accepted by RSS format)
tag <image><link> - correct path for translated versions (containing language code)
tag <atom> - correct path for translated versions (containing language code)
tag <atom><link> - correct path for translated versions (containing language code)
tag <atom><guid> - correct path for translated versions (containing language code)

tag <atom><pubDate> - the expression from 3 parts is used instead fo dateFormat. dateFormat generates month name in local representation instead of 3-letters English abbreviation for months. Hugo documentation does not have any description how site language affects dateFormat output. In reality this output is translated to site language. RSS format require RFC 822 date formet, that accept only English 3-letter months names. Proposed expression always generates English month names based on month number returned by dateFormat (converted to int and index method is used to take name from slice with months names).

Test Plan

cd website
bmake run

Diff Detail

Repository
R9 FreeBSD doc repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

vladlen created this revision.