Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
osuny
Admin
Commits
09b8c8b7
Commit
09b8c8b7
authored
3 years ago
by
pabois
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:noesya/osuny
parents
986859f8
f5cb80f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/models/communication/website/imported/medium.rb
+6
-2
6 additions, 2 deletions
app/models/communication/website/imported/medium.rb
docs/websites/export.md
+3
-0
3 additions, 0 deletions
docs/websites/export.md
docs/websites/import.md
+29
-0
29 additions, 0 deletions
docs/websites/import.md
with
38 additions
and
2 deletions
app/models/communication/website/imported/medium.rb
+
6
−
2
View file @
09b8c8b7
...
...
@@ -33,8 +33,12 @@ class Communication::Website::Imported::Medium < ApplicationRecord
belongs_to
:medium
,
class_name:
'Communication::Website::Medium'
,
optional:
true
has_many
:pages
,
class_name:
'Communication::Website::Imported::Page'
,
foreign_key: :featured_medium_id
has_many
:posts
,
class_name:
'Communication::Website::Imported::Post'
,
foreign_key: :featured_medium_id
has_many
:pages
,
class_name:
'Communication::Website::Imported::Page'
,
foreign_key: :featured_medium_id
has_many
:posts
,
class_name:
'Communication::Website::Imported::Post'
,
foreign_key: :featured_medium_id
before_validation
:sync
...
...
This diff is collapsed.
Click to expand it.
docs/websites/export.md
0 → 100644
+
3
−
0
View file @
09b8c8b7
# Export
Comment exporter les attachments, qu'ils soient liés à un objet active storage, ou dans un champ action text ?
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docs/websites/import.md
+
29
−
0
View file @
09b8c8b7
...
...
@@ -43,6 +43,35 @@ Etapes :
4.
Import du contenu brut des pages importées
5.
Analyse du contenu des pages importées et création / mise à jour des pages
## Import depuis WordPress
### Media
1.
On importe les media depuis l'API
2.
On crée des objets en DB (Communication::Website::Imported::Medium)
### Pages
1.
On importe les pages depuis l'API
2.
On crée des objets en DB (Communication::Website::Imported::Page)
3.
Les objets importés créent ou mettent à jour les objets réels (Communication::Website::Page)
3.
1 sans écraser de modifs locales
3.
2 uniquement si l'import a bougé
3.
3 Le contenu de l'html est filtré
3.
3.1 enlever les balises problématiques
3.
3.2 supprimer les classes
3.
3.3 supprimer les ids
3.
3.4 décaler les titres si h1
3.
4 la featured image est transformée en attachment
3.
5 si pas de featured image, la première image est enlevée du texte et devient featured
3.
6 les medias dans le texte html sont transformés en action text attachments
3.
6.1 lister les files dans le domaine
3.
6.2 identifier le media master correspondant (via data:jsonb)
3.
6.3 s'il n'existe pas, le créer (le cas se produit il ?)
3.
6.4 crée l'attachment
3.
6.5 on remplace le code du media par l'action text attachement
### Posts
Idem pages
## Exemples
### Condé
...
...
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