diff options
| author | seth <[email protected]> | 2023-03-17 09:16:29 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-03-17 09:16:29 -0400 |
| commit | b33c5d086dddf4462121ac7cfc60e2ac4e0093e2 (patch) | |
| tree | 65abf5cf13cab666ca20202efc9d55917178466f /_config.ts | |
| parent | 60006032a9a6aab6495e340aedf47b1ccd957aca (diff) | |
| parent | 9b9488da6add4b0555206e99bb2949f449469777 (diff) | |
Merge pull request #1 from ryanccn/some-refactors
some refactors
Diffstat (limited to '_config.ts')
| -rw-r--r-- | _config.ts | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -8,8 +8,8 @@ import sass from "lume/plugins/sass.ts"; import sitemap from "lume/plugins/sitemap.ts"; const site = lume({ - src: "./src", - location: new URL("https://getchoo.github.io"), + src: "./src", + location: new URL("https://getchoo.github.io"), }); site.use(attributes()); @@ -19,7 +19,28 @@ site.use(date()); site.use(remark()); site.use(sass()); site.use(sitemap()); + +const getGitRevision = async () => { + const p = Deno.run({ + cmd: ["git", "rev-parse", "HEAD"], + stdout: "piped", + }); + const [status, output] = await Promise.all([p.status(), p.output()]); + + if (status.success) { + return new TextDecoder().decode(output).trim(); + } + + return null; +}; + +site.data( + "gitRevision", + await getGitRevision(), +); + site.ignore("README.md", "LICENSE", ".gitignore", ".gitattributes"); + site.copy("imgs"); site.copy("files"); site.copy("js"); |
