-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Note that gitinfo.js assumes you have installed the luxon package, to be used here for formatting dates from Git commit data. (On the other hand, child_process is included in Node.js.) Notice also that you’ll have to supply, in the repoLink variable, the URL for your online repo’s commits.
const { DateTime } = require("luxon") const childProcess = require('child_process') const environment = process.env.NODE_ENV module.exports = (pubdate, filename) => { let stringToRet = `` if (environment === "production") { let repoLink = `` /* ================ For `repoLink`, fill in the starting URL for commits to your project's online repo! If you use GitHub, it'll usually be in the format of: https://github.com/your-github-name/your-repo-name/commit/ ================ */ pubdate = DateTime.fromJSDate(pubdate).toFormat("yyyy-MM-dd") const lastUpdatedFromGit = childProcess .execSync(`git log -1 --format=%cd --date=short ${filename}`) .toString() .trim() const abbrevHash = childProcess .execSync(`git log -1 --pretty=format:"%h" ${filename}`) .toString() .trim() const longHash = childProcess .execSync(`git log -1 --pretty=format:"%H" ${filename}`) .toString() .trim() repoLink += longHash if (longHash !== '') { stringToRet = `Latest commit: ${repoLink}" rel="noopener">${abbrevHash}` if (pubdate !== lastUpdatedFromGit) { stringToRet += `, ${lastUpdatedFromGit}` } } else { stringToRet = ` ` } } else { stringToRet = `[Git info will appear here in production.]` } return stringToRet }
Note that gitinfo.js assumes you have installed the luxon package, to be used here for formatting dates from Git commit data. (On the other hand, child_process is included in Node.js.) Notice also that you’ll have to supply, in the repoLink variable, the URL for your online repo’s commits.
In “Get good Git info from Hugo,” I explained how to use the Hugo static site generator (SSG)’s built-in Git info variables to display page-by-page Git commit data for one’s static website. Well, lo and behold, you can get that kind of information in the Eleventy SSG, too. You just need to add a little code, in the form of a shortcode that takes advantage of Eleventy-supplied data.
The one potential kink to this for you is that, in order for this to work best, you’ll have to use a CI/CD method of deploying your site. For anybody likely to find this article, you’ll typically be using either GitHub Actions or GitLab CI/CD. The reason this is necessary is because this method uses git log, and — at least as far as I know — there's no way to use any of the Jamstack-savvy web hosts’ UIs to specify fetch-depth: 0, which is necessary for this to work.