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
00154e84
Commit
00154e84
authored
3 years ago
by
OndraRehounek
Committed by
jan.bednarik
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
WIP
parent
d82dc466
Branches
Branches containing commit
No related tags found
2 merge requests
!442
Release
,
!432
Feature/majak imports
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
district/jekyll_import.py
+10
-3
10 additions, 3 deletions
district/jekyll_import.py
with
10 additions
and
3 deletions
district/jekyll_import.py
+
10
−
3
View file @
00154e84
...
...
@@ -3,6 +3,7 @@ import re
import
urllib
import
xml.etree.ElementTree
as
ET
import
zipfile
from
datetime
import
date
from
io
import
StringIO
from
shutil
import
rmtree
from
sys
import
stdout
...
...
@@ -104,9 +105,15 @@ def import_post(path, file_path, parent, title_suffix, dry_run):
article
.
text
=
html
article
.
perex
=
get_perex
(
md
)
article
.
date
=
meta
[
"
date
"
].
split
()[
0
]
meta_date
=
meta
[
"
date
"
]
if
isinstance
(
meta_date
,
date
):
article
.
date
=
meta_date
else
:
article
.
date
=
meta
[
"
date
"
].
split
()[
0
]
article
.
title
=
meta
[
"
title
"
]
article
.
author
=
meta
[
"
author
"
]
article
.
author
=
meta
.
get
(
"
author
"
,
"
Česká pirátská strana
"
)
article
.
seo_title
=
article
.
title
+
title_suffix
article
.
search_description
=
meta
.
get
(
"
description
"
,
""
)
...
...
@@ -217,7 +224,7 @@ def perform_import(
site_config
=
get_site_config
(
path
)
title_suffix
=
get_title_from_site_config
(
site_config
)
articlepath
=
site_config
[
"
articlepath
"
]
articlepath
=
site_config
.
get
(
"
articlepath
"
,
"
aktuality
"
)
for
fn
in
os
.
listdir
(
os
.
path
.
join
(
path
,
POSTS_DIR
)):
fname
=
os
.
path
.
join
(
POSTS_DIR
,
fn
)
...
...
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