Title: Blocksy theme integration
Last modified: September 24, 2021

---

# Blocksy theme integration

 *  Resolved [Creative Themes](https://wordpress.org/support/users/creativethemeshq/)
 * (@creativethemeshq)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/blocksy-theme-integration/)
 * Hello,
 * I’m writing in regards to [this thread](https://wordpress.org/support/topic/blocksy-to-static-html-with-simply-static/)
   from the Blocksy’s support forums.
 * Because of the way Blocksy implements the dynamic loading of JS files, Simply
   Static is not aware of the URLs passed to JS via a `wp_localize_script()` call.
   Also, since the URLs are not automatically discovered by simply static, the underlying
   JS files are not copied over to the exported archive.
 * Down below I’m trying to outline a way to fix that, in hopes of having a proper
   integration between Blocksy and Simply Static.
 * For the whole idea to work we need:
 * 1. A way to parse the HTML body at the end of the [`extract_and_replace_urls_in_html()`](https://github.com/patrickposner/simply-static/blob/3751fa9bf69a081d647b2e01d6e1d3b92ee24fa8/src/class-ss-url-extractor.php#L265)
   method. I’ve introduced an action called `ss_after_extract_and_replace_urls_in_html`
   here into which we’ll pass both the `$dom` and the `Url_Extractor` objects.
    
   2. Having the `Url_Extractor` object, we need to be able to call `add_to_extracted_urls()`
   to be able to add arbitrary URLs. So we need to make this method public (now 
   it is `private`) 3. A way to add more files to the final archive programatically(
   to add the missing JS files). For that I’ve added an action called `ss_after_setup_task`
   [here](https://github.com/patrickposner/simply-static/blob/3751fa9bf69a081d647b2e01d6e1d3b92ee24fa8/src/tasks/class-ss-setup-task.php#L63).
   At that moment, we will call `\Simply_Static\Setup_Task::add_additional_files_to_db('
   DIR_PATH')` to add more files.
 * All 3 points are implemented in this pull request: [https://github.com/patrickposner/simply-static/pull/15](https://github.com/patrickposner/simply-static/pull/15)
 * Code that goes into Blocksy for implementing the integration: [https://gist.github.com/andreiglingeanu/cba6934ad79fbf6caa36726d2a499ecb](https://gist.github.com/andreiglingeanu/cba6934ad79fbf6caa36726d2a499ecb)
 * Hope we can get this change in Simply Static (Blocksy will have the integration
   in the next update which will be out next week at most) so that everyone could
   have statically exported Blocksy sites!
 * Thanks for considering this!

Viewing 1 replies (of 1 total)

 *  Thread Starter [Creative Themes](https://wordpress.org/support/users/creativethemeshq/)
 * (@creativethemeshq)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/blocksy-theme-integration/#post-15124303)
 * Update: PR was merged and now everything works fine.

Viewing 1 replies (of 1 total)

The topic ‘Blocksy theme integration’ is closed to new replies.

 * ![](https://ps.w.org/simply-static/assets/icon-256x256.png?rev=2443263)
 * [Simply Static - The Static Site Generator](https://wordpress.org/plugins/simply-static/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simply-static/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simply-static/)
 * [Active Topics](https://wordpress.org/support/plugin/simply-static/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simply-static/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simply-static/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Creative Themes](https://wordpress.org/support/users/creativethemeshq/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/blocksy-theme-integration/#post-15124303)
 * Status: resolved