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

8
src/utils/date.js Normal file
View file

@ -0,0 +1,8 @@
export const dateFormat = (d) => {
const formatter = new Intl.DateTimeFormat('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric',
});
return formatter.format(d);
};

5
src/utils/path.js Normal file
View file

@ -0,0 +1,5 @@
import path from 'node:path';
export const urlfrag = (base, pth) => {
return path.join(base, pth);
};

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;
}
}
});
};
};

8
src/utils/strings.js Normal file
View file

@ -0,0 +1,8 @@
export const titleCase = (s) => {
if (!s) return "";
return s
.toLowerCase()
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
};