Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
indexers
editorial-content
Commits
76f15eec
Commit
76f15eec
authored
Jun 14, 2021
by
DESPRES Damien
Browse files
verification que le contenu n'est pas vide
parent
3f046e88
Pipeline
#14440
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/indexer.py
View file @
76f15eec
...
...
@@ -160,13 +160,14 @@ def replaceGhostUrlByMinioUrl(cfg,client,doc):
new_url
=
minio_read_url
+
'/'
+
bucket_name
+
'/'
+
file_path
logger
.
debug
(
'New URL:'
+
new_url
)
doc
[
'content-fr'
][
'feature_image'
]
=
new_url
urls
=
re
.
findall
(
'src="(https:\/\/ghost[^"]*)'
,
fr_content
)
for
url
in
urls
:
logger
.
debug
(
'URL '
+
url
)
pushToMinio
(
client
,
bucket_name
,
url
)
newcontent
=
re
.
sub
(
'(https:\/\/ghost[^"]*\/images)'
,
minio_read_url
+
'/'
+
bucket_name
,
fr_content
)
logger
.
debug
(
newcontent
)
doc
[
'content-fr'
][
'html'
]
=
newcontent
if
fr_content
is
not
None
:
urls
=
re
.
findall
(
'src="(https:\/\/ghost[^"]*)'
,
fr_content
)
for
url
in
urls
:
logger
.
debug
(
'URL '
+
url
)
pushToMinio
(
client
,
bucket_name
,
url
)
newcontent
=
re
.
sub
(
'(https:\/\/ghost[^"]*\/images)'
,
minio_read_url
+
'/'
+
bucket_name
,
fr_content
)
logger
.
debug
(
newcontent
)
doc
[
'content-fr'
][
'html'
]
=
newcontent
return
doc
def
pushToMinio
(
client
,
bucket_name
,
image
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment