Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
276712b7
Verified
Commit
276712b7
authored
1 year ago
by
jindra12
Browse files
Options
Downloads
Patches
Plain Diff
Add shared articles to feeds
#210
parent
7263a6c7
No related branches found
No related tags found
2 merge requests
!816
Release
,
!801
Prepare basic shared tags
Pipeline
#13886
passed
1 year ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/feeds.py
+7
-3
7 additions, 3 deletions
main/feeds.py
with
7 additions
and
3 deletions
main/feeds.py
+
7
−
3
View file @
276712b7
...
...
@@ -22,7 +22,11 @@ class LatestArticlesFeed(Feed):
return
obj
.
perex
def
items
(
self
,
obj
:
MainArticlesPage
)
->
list
:
return
MainArticlePage
.
objects
.
live
().
child_of
(
obj
).
order_by
(
"
-date
"
)[:
32
]
return
obj
.
materialize_shared_articles_query
(
obj
.
append_all_shared_articles_query
(
MainArticlePage
.
objects
.
child_of
(
obj
))[
:
32
]
)
def
item_title
(
self
,
item
:
MainArticlePage
)
->
str
:
return
item
.
title
...
...
@@ -52,10 +56,10 @@ class LatestArticlesFeed(Feed):
return
""
def
item_categories
(
self
,
item
:
MainArticlePage
)
->
list
:
return
item
.
tags
.
all
()
return
item
.
get_tags
()
if
callable
(
item
.
get_tags
)
else
item
.
get_tags
def
item_link
(
self
,
item
:
MainArticlePage
)
->
str
:
return
item
.
get_full_url
()
return
item
.
get_full_url
def
item_enclosure_url
(
self
,
item
:
MainArticlePage
)
->
typing
.
Union
[
None
,
str
]:
if
item
.
image
is
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment