Adding Astrojs sources.

This commit is contained in:
Benjamin A. Shelton 2026-06-05 14:31:12 -06:00
commit e20f4f45de
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
169 changed files with 11389 additions and 0 deletions

23
src/utils/remark.js Normal file
View file

@ -0,0 +1,23 @@
import { visit } from 'unist-util-visit';
export const ScriptureLinks = () => {
return async tree => {
visit(tree, node => {
if (node.type === 'link') {
if (node.url.startsWith(':scripture')) {
let passage;
if (node.url.indexOf('=') != -1) {
passage = node.url.substring(node.url.indexOf('=')+1).replace(/\+/, " ");
} else {
if (node.children.length != 0) {
passage = node.children[0].value;
}
}
const script = encodeURIComponent(passage.toLowerCase());
const url = `https://www.biblegateway.com/passage/?search=${script}&version=ESV`;
node.url = url;
}
}
});
};
};