Compare commits

...

10 commits

Author SHA1 Message Date
Patrick Kollitsch 600bddab7c
build(deps): update dependencies
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
2024-12-14 06:29:57 +07:00
Klaas Demter b06949eb2d
theme(fix): add show_recent_posts parameter to stop showing recent posts on index (#795)
<!---

Add the issue number that is discussed and fixed by this PR (In the form
`Closes #123`). If this PR doesn't fix an issue, remove the line below.
This will
also lead to us not treating this PR as an important one. It might be
closed
without a review.

If there is no issue associated with this PR and you are not a
maintainer of
this repository, your PR might be closed without a review.

-->

Closes #794

You can no longer set `recent_posts_number = 0` because in current hugo
versions `{{ $n_posts := $.Param "recent_posts_number" | default 3 }}`
will default to three if recent_posts_number is 0. This used to work a
couple of versions back, I am assuming this is not a regression but
rather wanted behavior in hugo -- so I introduce a new parameter
(boolean) `show_recent_posts` to enable(default) or disable recent posts
on index.



<!---

Explain what this PR does and what existing problem it solves. If this
PR is a
work in progress, please prefix the title with [WIP].

-->

<!--

Make sure that the code is readable and well-documented. If you have
added new
functionality, please add the necessary documentation.
If testing of the new functionality is possible, please add tests.

-->
2024-12-02 12:17:41 +07:00
Patrick Kollitsch 1839b4fe3f
chore(config): update gitignore
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
2024-11-29 13:45:26 +07:00
Patrick Kollitsch 9c30c1974e
build(deps): update dependencies
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
2024-11-29 13:39:43 +07:00
Patrick Kollitsch 819f673037
build(feat): add discord notification for new releases
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
2024-11-29 13:38:03 +07:00
Patrick Kollitsch 6a77b14638
chore(config): update dependabot to monthly runs
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
2024-11-29 13:38:03 +07:00
dependabot[bot] 40c8d5f5ee
build(deps): bump postcss from 8.4.47 to 8.4.49 (#793)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.47 to
8.4.49.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/releases">postcss's
releases</a>.</em></p>
<blockquote>
<h2>8.4.49</h2>
<ul>
<li>Fixed custom syntax without <code>source.offset</code> (by <a
href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
</ul>
<h2>8.4.48</h2>
<ul>
<li>Fixed position calculation in error/warnings methods (by <a
href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/blob/main/CHANGELOG.md">postcss's
changelog</a>.</em></p>
<blockquote>
<h2>8.4.49</h2>
<ul>
<li>Fixed custom syntax without <code>source.offset</code> (by <a
href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
</ul>
<h2>8.4.48</h2>
<ul>
<li>Fixed position calculation in error/warnings methods (by <a
href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="aed8b89988"><code>aed8b89</code></a>
Release 8.4.49 version</li>
<li><a
href="345063010b"><code>3450630</code></a>
Fix position calculations when offset is missing (<a
href="https://redirect.github.com/postcss/postcss/issues/1983">#1983</a>)</li>
<li><a
href="77420d6291"><code>77420d6</code></a>
Release 8.4.48 version</li>
<li><a
href="341529ff4e"><code>341529f</code></a>
Update dependencies</li>
<li><a
href="66fa667831"><code>66fa667</code></a>
Add Node.js 23 to CI</li>
<li><a
href="1a8b261404"><code>1a8b261</code></a>
fix inconsistent position calculations (<a
href="https://redirect.github.com/postcss/postcss/issues/1980">#1980</a>)</li>
<li><a
href="1cc6ac3bf4"><code>1cc6ac3</code></a>
Clarify usage in docs</li>
<li>See full diff in <a
href="https://github.com/postcss/postcss/compare/8.4.47...8.4.49">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=postcss&package-manager=npm_and_yarn&previous-version=8.4.47&new-version=8.4.49)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-16 07:16:33 +07:00
dependabot[bot] 8031d999a4
build(deps): bump postcss-preset-env from 10.0.9 to 10.1.0 (#792)
Bumps
[postcss-preset-env](https://github.com/csstools/postcss-plugins/tree/HEAD/plugin-packs/postcss-preset-env)
from 10.0.9 to 10.1.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/CHANGELOG.md">postcss-preset-env's
changelog</a>.</em></p>
<blockquote>
<h3>10.1.0</h3>
<p><em>November 11, 2024</em></p>
<ul>
<li>Added <code>@csstools/postcss-random-function</code> <a
href="https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-random-function#readme">Check
the plugin README</a> for usage details.</li>
<li>Added <code>@csstools/postcss-sign-functions</code> <a
href="https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-sign-functions#readme">Check
the plugin README</a> for usage details.</li>
<li>Updated <a
href="https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc"><code>@csstools/css-calc</code></a>
to <a
href="https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#210"><code>2.1.0</code></a>
(minor)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/csstools/postcss-plugins/commits/HEAD/plugin-packs/postcss-preset-env">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=postcss-preset-env&package-manager=npm_and_yarn&previous-version=10.0.9&new-version=10.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-16 07:14:59 +07:00
dependabot[bot] bedc2ec05f
build(deps-dev): bump @davidsneighbour/tools from 2024.4.6 to 2024.4.8 (#789)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps
[@davidsneighbour/tools](https://github.com/davidsneighbour/configurations)
from 2024.4.6 to 2024.4.8.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="177f094f8e"><code>177f094</code></a>
chore(release): publish v2024.4.8</li>
<li><a
href="4191af5c15"><code>4191af5</code></a>
chore(deps): update dependency <code>@​eslint/js</code> to v9.14.0 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1676">#1676</a>)</li>
<li><a
href="81e92619d1"><code>81e9261</code></a>
chore(deps): update dependency stylelint-no-unsupported-browser-features
to v...</li>
<li><a
href="8beaa7c9fa"><code>8beaa7c</code></a>
chore(deps): update eslint to v2.10.1 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1670">#1670</a>)</li>
<li><a
href="95cb927cb0"><code>95cb927</code></a>
chore(deps): update dependency <code>@​eslint/json</code> to v0.6.0 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1658">#1658</a>)</li>
<li><a
href="1143889267"><code>1143889</code></a>
chore(deps): update eslint to v2.10.0 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1657">#1657</a>)</li>
<li><a
href="afbca31fe1"><code>afbca31</code></a>
chore(deps): update dependency eslint-plugin-cypress to v4.1.0 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1656">#1656</a>)</li>
<li><a
href="af4250d57e"><code>af4250d</code></a>
chore(deps): update dependencies</li>
<li><a
href="f495128391"><code>f495128</code></a>
chore(release): publish v2024.4.7</li>
<li><a
href="385bb4904f"><code>385bb49</code></a>
chore(deps): update dependencies</li>
<li>Additional commits viewable in <a
href="https://github.com/davidsneighbour/configurations/compare/v2024.4.6...v2024.4.8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@davidsneighbour/tools&package-manager=npm_and_yarn&previous-version=2024.4.6&new-version=2024.4.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 15:44:37 +07:00
dependabot[bot] c708f0d15e
build(deps-dev): bump @davidsneighbour/markdownlint-config from 2024.4.6 to 2024.4.8 (#788)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps
[@davidsneighbour/markdownlint-config](https://github.com/davidsneighbour/configurations)
from 2024.4.6 to 2024.4.8.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="177f094f8e"><code>177f094</code></a>
chore(release): publish v2024.4.8</li>
<li><a
href="4191af5c15"><code>4191af5</code></a>
chore(deps): update dependency <code>@​eslint/js</code> to v9.14.0 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1676">#1676</a>)</li>
<li><a
href="81e92619d1"><code>81e9261</code></a>
chore(deps): update dependency stylelint-no-unsupported-browser-features
to v...</li>
<li><a
href="8beaa7c9fa"><code>8beaa7c</code></a>
chore(deps): update eslint to v2.10.1 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1670">#1670</a>)</li>
<li><a
href="95cb927cb0"><code>95cb927</code></a>
chore(deps): update dependency <code>@​eslint/json</code> to v0.6.0 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1658">#1658</a>)</li>
<li><a
href="1143889267"><code>1143889</code></a>
chore(deps): update eslint to v2.10.0 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1657">#1657</a>)</li>
<li><a
href="afbca31fe1"><code>afbca31</code></a>
chore(deps): update dependency eslint-plugin-cypress to v4.1.0 (<a
href="https://redirect.github.com/davidsneighbour/configurations/issues/1656">#1656</a>)</li>
<li><a
href="af4250d57e"><code>af4250d</code></a>
chore(deps): update dependencies</li>
<li><a
href="f495128391"><code>f495128</code></a>
chore(release): publish v2024.4.7</li>
<li><a
href="385bb4904f"><code>385bb49</code></a>
chore(deps): update dependencies</li>
<li>Additional commits viewable in <a
href="https://github.com/davidsneighbour/configurations/compare/v2024.4.6...v2024.4.8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@davidsneighbour/markdownlint-config&package-manager=npm_and_yarn&previous-version=2024.4.6&new-version=2024.4.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 15:44:22 +07:00
8 changed files with 819 additions and 341 deletions

View file

@ -6,7 +6,7 @@ updates:
- package-ecosystem: npm - package-ecosystem: npm
directory: / directory: /
schedule: schedule:
interval: weekly interval: monthly
day: friday day: friday
time: "18:00" time: "18:00"
timezone: Asia/Bangkok timezone: Asia/Bangkok
@ -24,7 +24,7 @@ updates:
- package-ecosystem: gomod - package-ecosystem: gomod
directory: / directory: /
schedule: schedule:
interval: weekly interval: monthly
day: friday day: friday
time: "18:00" time: "18:00"
timezone: Asia/Bangkok timezone: Asia/Bangkok
@ -42,7 +42,7 @@ updates:
- package-ecosystem: github-actions - package-ecosystem: github-actions
directory: / directory: /
schedule: schedule:
interval: weekly interval: monthly
day: friday day: friday
time: "18:00" time: "18:00"
timezone: Asia/Bangkok timezone: Asia/Bangkok

162
.github/scripts/posterboy.mjs vendored Normal file
View file

@ -0,0 +1,162 @@
import { readFile, writeFile, access, mkdir } from 'node:fs/promises';
import path from 'node:path';
import fs from 'node:fs';
import dotenv from 'dotenv';
import { homedir } from 'node:os';
const userHomeDir = homedir();
// Load .env files
const GLOBAL_ENV_PATH = path.join(userHomeDir, '.env');
const LOCAL_ENV_PATH = path.resolve('.env');
/**
* Load environment variables from a file if it exists.
* @param {string} filePath
* @returns {object} Parsed environment variables
*/
function loadEnvFile(filePath) {
if (fs.existsSync(filePath)) {
return dotenv.parse(fs.readFileSync(filePath));
}
return {};
}
// Merge global and local .env configurations
const globalEnv = loadEnvFile(GLOBAL_ENV_PATH);
const localEnv = loadEnvFile(LOCAL_ENV_PATH);
process.env = { ...globalEnv, ...process.env, ...localEnv };
// Configurable values
const DISCORD_WEBHOOK = process.env.DISCORD_WEBHOOK || '';
const GITHUB_DEV_TOKEN = process.env.GITHUB_DEV_TOKEN || '';
const GITHUB_REPO = process.env.GITHUB_REPO || 'theNewDynamic/gohugo-theme-ananke';
const DEFAULT_MESSAGE_TEMPLATE = 'New release: {{tag_name}} - {{html_url}}';
const MESSAGE_TEMPLATE = process.env.MESSAGE_TEMPLATE || DEFAULT_MESSAGE_TEMPLATE;
const CACHE_DIR = './cache';
const CACHE_FILE = 'github-releases.json';
const CACHE_FILE_PATH = path.join(CACHE_DIR, CACHE_FILE);
/**
* Ensures the cache directory exists, creating it if necessary.
* @returns {Promise<void>}
*/
async function ensureCacheDirectory() {
try {
await access(CACHE_DIR);
} catch {
try {
await mkdir(CACHE_DIR, { recursive: true });
} catch (err) {
console.error(`Failed to create cache directory: ${err.message}`);
process.exit(1);
}
}
}
/**
* Reads the cache file or returns an empty array if not found.
* @returns {Promise<string[]>}
*/
async function readCache() {
try {
const data = await readFile(CACHE_FILE_PATH, 'utf8');
return JSON.parse(data) || [];
} catch {
return [];
}
}
/**
* Writes data to the cache file.
* @param {string[]} data
*/
async function writeCache(data) {
await writeFile(CACHE_FILE_PATH, JSON.stringify(data, null, 2));
}
/**
* Fetches the latest release from the GitHub REST API.
* @returns {Promise<{ tag_name: string, html_url: string } | null>}
*/
async function fetchLatestRelease() {
try {
const response = await fetch('https://api.github.com/repos/' + GITHUB_REPO + '/releases', {
headers: {
Authorization: `token ${GITHUB_DEV_TOKEN}`,
},
});
if (!response.ok) {
throw new Error(`GitHub API request failed: ${response.statusText}`);
}
const releases = await response.json();
if (!Array.isArray(releases) || releases.length === 0) {
console.log('No releases found.');
return null;
}
return releases[0];
} catch (err) {
console.error('Failed to fetch releases:', err.message);
return null;
}
}
/**
* Posts a message to Discord using a webhook.
* @param {string} message
*/
async function postToDiscord(message) {
try {
const response = await fetch(DISCORD_WEBHOOK, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ content: message }),
});
if (!response.ok) {
throw new Error(`Failed to post to Discord: ${response.statusText}`);
}
console.log('Posted to Discord successfully.');
} catch (err) {
console.error('Failed to post to Discord:', err.message);
}
}
/**
* Formats the release message using the template.
* @param {Record<string, string>} releaseData
* @returns {string}
*/
function formatMessage(releaseData) {
return MESSAGE_TEMPLATE.replace(/{{\s*(\w+)\s*}}/g, (_, key) => releaseData[key] || '');
}
/**
* Main function to fetch the latest GitHub release and post it to Discord.
*/
async function main() {
try {
await ensureCacheDirectory();
const cachedIds = await readCache();
const latestRelease = await fetchLatestRelease();
if (latestRelease && !cachedIds.includes(latestRelease.tag_name)) {
const message = formatMessage(latestRelease);
await postToDiscord(message);
cachedIds.push(latestRelease.tag_name);
await writeCache(cachedIds);
} else {
console.log('No new releases to post.');
}
} catch (err) {
console.error('Error:', err.message);
}
}
main();

390
.gitignore vendored
View file

@ -1,41 +1,365 @@
# OS # local ignored files
cache/
# Created by https://www.toptal.com/developers/gitignore/api/hugo,node,linux,macos,windows,phpstorm+all,visualstudiocode,go
# Edit at https://www.toptal.com/developers/gitignore?templates=hugo,node,linux,macos,windows,phpstorm+all,visualstudiocode,go
### Go ###
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
# Go workspace file
go.work
### Hugo ###
# Generated files by hugo
/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux
# Temporary lock file while building
/.hugo_build.lock
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store .DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### macOS Patch ###
# iCloud generated files
*.icloud
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
### Node Patch ###
# Serverless Webpack directories
.webpack/
# Optional stylelint cache
# SvelteKit build / generate output
.svelte-kit
### PhpStorm+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### PhpStorm+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.
.idea/*
!.idea/codeStyles
!.idea/runConfigurations
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
### Windows ###
# Windows thumbnail cache files
Thumbs.db Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# IDEs # Dump file
.buildpath *.stackdump
.project
.settings/
.build/
.idea/
public/
nbproject/
# Vagrant # Folder config file
.vagrant/ [Dd]esktop.ini
# FE Setup # Recycle Bin used on file shares
.bin/node_modules/ $RECYCLE.BIN/
/node_modules/
src/node_modules/
exampleSite/node_modules/
src/npm-debug.log.*
npm-debug.log
/npm-debug.log*
/dist/
/src/client.config.json
/styleguide/
/docs/
/junit.xml # Windows Installer files
partials/structure/stylesheet.html *.cab
*.msi
*.msix
*.msm
*.msp
# Hugo # Windows shortcuts
.hugo_build.lock *.lnk
resources/_gen/
# Build # End of https://www.toptal.com/developers/gitignore/api/hugo,node,linux,macos,windows,phpstorm+all,visualstudiocode,go
.wireit
.favorites.json
*.code-workspace
config/gargulus

31
ananke.code-workspace Normal file
View file

@ -0,0 +1,31 @@
{
"folders": [
{
"path": "."
},
{
"path": "../gohugo-theme-ananke.wiki"
}
],
"settings": {
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#65c89b",
"activityBar.background": "#65c89b",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#945bc4",
"activityBarBadge.foreground": "#e7e7e7",
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#65c89b",
"statusBar.background": "#42b883",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#359268",
"statusBarItem.remoteBackground": "#42b883",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#42b883",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#42b88399",
"titleBar.inactiveForeground": "#15202b99"
}
}
}

View file

@ -1,3 +1,6 @@
[ananke]
show_recent_posts = true # show recent posts on the homepage
[ananke.social] [ananke.social]
icon_path = "ananke/socials/%s.svg" icon_path = "ananke/socials/%s.svg"

View file

@ -4,6 +4,7 @@
</article> </article>
{{/* Define a section to pull recent posts from. For Hugo 0.20 this will default to the section with the most number of pages. */}} {{/* Define a section to pull recent posts from. For Hugo 0.20 this will default to the section with the most number of pages. */}}
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }} {{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{ $show_recent_posts := site.Params.ananke.show_recent_posts }}
{{/* Check to see if the section is defined for ranging through it */}} {{/* Check to see if the section is defined for ranging through it */}}
{{range ($mainSections)}} {{range ($mainSections)}}
@ -12,7 +13,7 @@
{{/* Create a variable with that section to use in multiple places. */}} {{/* Create a variable with that section to use in multiple places. */}}
{{ $section := where $.Site.RegularPages "Section" "in" $section_name }} {{ $section := where $.Site.RegularPages "Section" "in" $section_name }}
{{ $section_count := len $section }} {{ $section_count := len $section }}
{{ if ge $section_count 1 }} {{ if and ($show_recent_posts) (ge $section_count 1) }}
<div class="pa3 pa4-ns w-100 w-70-ns center"> <div class="pa3 pa4-ns w-100 w-70-ns center">
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}} {{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}}
{{ with $.Site.GetPage "section" $section_name }} {{ with $.Site.GetPage "section" $section_name }}

554
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -33,14 +33,15 @@
], ],
"dependencies": { "dependencies": {
"cssnano": "7.0.6", "cssnano": "7.0.6",
"postcss": "8.4.47", "postcss": "8.4.49",
"postcss-preset-env": "10.0.9", "postcss-preset-env": "10.1.2",
"tachyons": "4.12.0" "tachyons": "4.12.0"
}, },
"devDependencies": { "devDependencies": {
"@davidsneighbour/markdownlint-config": "^2024.4.6", "@davidsneighbour/markdownlint-config": "2024.4.12",
"@davidsneighbour/release-config": "2024.4.8", "@davidsneighbour/release-config": "2024.4.12",
"@davidsneighbour/tools": "2024.4.6" "@davidsneighbour/tools": "2024.4.12",
"dotenv": "16.4.7"
}, },
"scripts": { "scripts": {
"deploy": "cd exampleSite; hugo;", "deploy": "cd exampleSite; hugo;",