# Reftagger theme component

**URL:** <https://meta.discourse.org/t/reftagger-theme-component/163544>\
**Category:** Theme component\
**Created:** [September 9, 2020, 7:31pm UTC](https://meta.discourse.org/t/reftagger-theme-component/163544 "2020-09-09T19:31:06Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![BrianC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brianc/32/487568_2.png) [@BrianC](https://meta.discourse.org/u/BrianC)\
**Post date:** [July 30, 2025, 11:42pm UTC](https://meta.discourse.org/t/reftagger-theme-component/163544/16 "2025-07-30T23:42:18Z")

</div>

I made some headway with this using ChatGPT and have working reftaggers for both using Logos RefTagger and Blue Letter Bible.

If these could be bundled into a theme component for community use that is great if not the theme component is simply to make. You just need to take the code for whichever you prefer and put in the JS tab of a new theme component. You need to remove the default code is in the JS tab from Discourse.

If anyone has feedback how to improve that is welcome. My skills only go as far as guiding the LLM.

using **Logos RefTagger** :

> import { apiInitializer } from “discourse/lib/api”;  
> import loadScript from “discourse/lib/load-script”;
> 
> export default apiInitializer(“0.1”, (api) =\> {  
> // 1. Define RefTagger settings on window BEFORE loading the script  
> window.refTagger = {  
> settings: {  
> bibleVersion: “ESV”, // e.g. default Bible version  
> tagChapters: true, // tag chapter references as well  
> convertHyperlinks: false, // don’t retag existing links  
> roundCorners: true,  
> socialSharing: ,  
> }  
> };
> 
> // 2. Hook into Discourse post rendering:  
> api.decorateCooked((element) =\> {  
> // Load the external RefTagger script (if not already loaded)  
> loadScript(“[https://api.reftagger.com/v2/RefTagger.js”](https://api.reftagger.com/v2/RefTagger.js%E2%80%9D)).then(() =\> {  
> // Run the tagging on the new content element  
> window.refTagger.tag(element);  
> });  
> });  
> });

**using BLB ScriptTagger:**

> import { apiInitializer } from “discourse/lib/api”;  
> import loadScript from “discourse/lib/load-script”;
> 
> export default apiInitializer(“0.1”, (api) =\> {  
> // Optionally set BLB ScriptTagger settings before loading (defaults shown)  
> window.BLB ||= {}; // ensure global BLB object exists  
> window.BLB.Tagger ||= {};  
> window.BLB.Tagger.Translation = “NKJV”; // default translation version  
> window.BLB.Tagger.HyperLinks = “all”; // tag even already-linked refs  
> window.BLB.Tagger.TargetNewWindow = true; // links open in new tab  
> // … (other settings like DarkTheme, etc., as needed)
> 
> api.decorateCooked((elem) =\> {  
> loadScript(“[https://www.blueletterbible.org/assets/scripts/blbToolTip/BLB\_ScriptTagger-min.js”](https://www.blueletterbible.org/assets/scripts/blbToolTip/BLB_ScriptTagger-min.js%E2%80%9D))  
> .then(() =\> {  
> if (window.BLB && window.BLB.Tagger) {  
> window.BLB.Tagger.pageInit(); // re-scan new content for verses:contentReference[oaicite:6]{index=6}  
> }  
> });  
> });  
> });

---

_[View the full topic](https://meta.discourse.org/t/reftagger-theme-component/163544)._
