Merge lp:~davidc3/resource-centre/jp-exclude-from-rss into lp:resource-centre

Proposed by David Callé
Status: Merged
Merged at revision: 111
Proposed branch: lp:~davidc3/resource-centre/jp-exclude-from-rss
Merge into: lp:resource-centre
Diff against target: 11 lines (+1/-0)
1 file modified
functions/rss.php (+1/-0)
To merge this branch: bzr merge lp:~davidc3/resource-centre/jp-exclude-from-rss
Reviewer Review Type Date Requested Status
Anthony Dillon Approve
David Callé (community) Needs Fixing
Review via email: mp+359035@code.launchpad.net

Commit message

Exclude lang:jp tagged posts from the main RSS feed

Description of the change

Filtering out posts containing the "lang:jp" tag, so the future Japanese blog can be derived on tag basis from blog.ubuntu.com without impacting the english RSS feed. A matching change will be made on blog.ubuntu.com to filter out these posts from being displayed.

To post a comment you must log in.
Revision history for this message
David Callé (davidc3) wrote :

I was able to test and got tag exclusion working using `tag__not_in`.

Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

The blog loads the data via the built-in WordPress Rest API. The content is not loaded from the RSS although I guess it should be hidden from that too for people using the RSS.

I have applied your branch (and updated the tag id) to [our testing enviroment](http://insights.canonicalwebteam.com).

I created an article with the tag `lang:jp`.

This article is still [visible in the API](http://insights.canonicalwebteam.com/wp-json/wp/v2/posts?per_page=3&page=1&_embed=True).

A similar approach may be to add a condition to [blog.ubuntu.com code base](https://github.com/canonical-websites/blog.ubuntu.com/). Keeping all the logic in one place, [example PR](https://github.com/canonical-websites/blog.ubuntu.com/pull/392)

With that this branch is good.

review: Approve
Revision history for this message
David Callé (davidc3) wrote :

Thanks for testing, doing the same filtering as the custom snapcraft tag was the intended plan of action.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'functions/rss.php'
2--- functions/rss.php 2017-03-02 16:07:24 +0000
3+++ functions/rss.php 2018-11-20 10:49:17 +0000
4@@ -6,6 +6,7 @@
5 function myFeedExcluder($query) {
6 if ($query->is_feed) {
7 $query->set('cat','-1554,-1551,-1552,-1553,-344,-347,-346,-345');
8+ $query->set('tag__not_in','3184');
9 }
10 return $query;
11 }

Subscribers

People subscribed via source and target branches