Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research Best Practices on Accessing Source Content from Hugo #7840

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mattsqd
Copy link

@mattsqd mattsqd commented Aug 5, 2024

Summary

This is just a proof of concept, not to merge.
Using Hugo JSON endpoints as a migration source for a Drupal migration.

Solution

It shows how we can use JSON endpoints provided by HUGO to be the source data for a Drupal migration.
The corresponding code in Drupal that does the migrating is stored here GSA/digital-gov-drupal#1.
This shows that you can expose the images in Hugo and migrate them into Drupal. We should be able to do this for all the content we need rather than attempting to parse .md files.

How To Test

1a. You already have the Drupal environment checked out locally: move into it in your terminal
1b. You have not worked with the Drupal environment yet: git clone git@github.com:GSA/digital-gov-drupal.git && cd digital-gov-drupal
2. Checkout the feature branch: git checkout feature/migrate-image-example
3a. If you have not worked with the Drupal environment yet, see the documentation.
3b. If you have worked with the Drupal environment already: lando start && lando si
4. Enable the migration scripts and run the migration: ./drush.sh en -y digital_gov_migration && ./drush.sh migrate:import json_images (See 'Notes' below about the errors you'll see)
5. Login to Drupal: ./drush.sh uli
6. The files migrated from Hugo can be seen at http://digitalgov.lndo.site/admin/content/files

Notes

There are 9 images that 403 during the migration. You can see which ones with ./drush.sh migrate:messages json_imagesor in the document titled Digital.gov missing images in the shared drive.

…art the site without livereload so that JSON files could be parsed.
…urce-url field, dont load image if it doesnt have a uid or format, and reformat to read more easily.
Copy link

github-actions bot commented Aug 5, 2024

🔍 Preview in Federalist

@nick-mon1 nick-mon1 changed the title [Trello 1631] Research Best Practices on Accessing Source Content from Hugo Research Best Practices on Accessing Source Content from Hugo Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants