diff --git a/eleventy.config.js b/eleventy.config.js index 900d4a7..2097d5c 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -12,7 +12,12 @@ const buildTime = new Date(Date.now()).toISOString(); export default function (eleventyConfig) { eleventyConfig.addNunjucksAsyncFilter("githubReleases", async function(owner, repo, callback) { const token = process.env.GITHUB_ACCESS_TOKEN; - if (!owner || !repo) return callback(null, []); + + if (!owner || !repo) return callback(null, [ name = "This project is not configured properly." ]); + if (!token || !isProd) return callback(null, [{ + name: "This instance cannot fetch releases from GitHub, you can check them manually here.", + html_url: `https://github.com/${owner}/${repo}/releases` + }]); const url = `https://api.github.com/repos/${owner}/${repo}/releases`; @@ -26,6 +31,7 @@ export default function (eleventyConfig) { }); if (!res.ok) return callback(null, [ name = "Error fetching releases for GitHub project." ]); const data = await res.json(); + console.log(data) callback(null, data); } catch (err) { console.error(err); @@ -33,6 +39,10 @@ export default function (eleventyConfig) { } }); + eleventyConfig.addFilter("collectionFind", (collection = [], url = "") => { + return collection.find(item => item.url = url); + }); + eleventyConfig.setInputDirectory("src"); eleventyConfig.setOutputDirectory("public"); eleventyConfig.addPassthroughCopy("src/projects/**/*.png"); diff --git a/package.json b/package.json index 9464bde..47870dc 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "build": "npm run build:eleventy", "build:sass:prod": "sass src/static/scss:public/static/css --style compressed", "build:eleventy:prod": "ELEVENTY_ENV=production eleventy", - "build:prod": "npm run build:eleventy:prod" + "build:prod": "npm run build:eleventy:prod", + "serve:prod": "ELEVENTY_ENV=production eleventy --serve" }, "repository": { "type": "git", diff --git a/src/_data/news.json b/src/_data/news.json new file mode 100644 index 0000000..e7f87a7 --- /dev/null +++ b/src/_data/news.json @@ -0,0 +1,14 @@ +{ + "entries": [ + { + "date": "2025-10-30", + "title": "Releases support", + "text": "Now developers can list their software version and automatically list their GitHub releases in their project page!" + }, + { + "date": "2025-10-27", + "title": "Website redesign!", + "text": "Yaaay! neoBeta got a stylish redesign." + } + ] +} \ No newline at end of file diff --git a/src/_includes/news.njk b/src/_includes/news.njk new file mode 100644 index 0000000..48da0e3 --- /dev/null +++ b/src/_includes/news.njk @@ -0,0 +1,5 @@ +

Latest updates

+{% for news in news.entries %} +

{{ news.date }} {{ news.title }}:

+

{{ news.text | safe }}

+{% endfor %} \ No newline at end of file diff --git a/src/_virtual/releases.njk b/src/_virtual/releases.njk index 37d475b..21eb1f9 100644 --- a/src/_virtual/releases.njk +++ b/src/_virtual/releases.njk @@ -6,24 +6,62 @@ pagination: permalink: "{{ project.url }}releases.html" layout: base.njk --- +

Releases for {{ project.data.name }}

-{% if project.data.releaseType %} -

- {% if project.data.releaseType == "github" %} - {% set releases = project.data.githubRepoOwner | githubReleases(project.data.githubRepoName) %} - Releases fetched from GitHub at {{ buildTime }}:
- {% for release in releases %} -

{{ release.name }}

- {% endfor %} - {% endif %} - {% if project.data.releaseType == "local" %} -

{{ project.data.releases | length }} releases.

- {% for label, addr in project.data.releases %} -

{{ label }}

- {% endfor %} - {% endif %} +{% if project.data.dependencies %} +

This project depends on: + {% for dep in project.data.dependencies %} + {% set depl = collections.projects | collectionFind("/projects/" + dep + "/") %} + {{ dep }}. + {% endfor %}

+{% endif %} + +{% if project.data.releaseType %} +{% if project.data.releaseType == "github" %} +{% set releases = project.data.githubRepoOwner | githubReleases(project.data.githubRepoName) %} +

{{ releases | length }} releases fetched from GitHub at {{ buildTime }}.

+
+{% for release in releases %} +
+

{{ release.name }}

+

{{ release.tag_name }} for {{ project.data.gameLoaders or "unknown loader" }} {{ project.data.gameVersions or "unknow version" }}

+
+ + + +
+
+{% endfor %} +
+{% endif %} +{% if project.data.releaseType == "local" %} +

{{ project.data.releases | length }} releases.

+
+ {% for release in project.data.releases %} +
+

{{ release.name }}

+

Version {{ release.version }} for {{ release.gameLoaders or project.data.gameLoaders }} {{ release.gameVersions or project.data.gameVersions }}

+ {% if release.downloads %} +
+ {% for label, addr in release.downloads %} + + {% endfor %} +
+ {% endif %} +
+ {% endfor %} +
+{% endif %} {% else %} -

Could not find any release for this project...

+

Could not find any release for this project...

{% endif %} diff --git a/src/assets/stylesheets/styles.css b/src/assets/stylesheets/styles.css index 98f38bf..83be309 100644 --- a/src/assets/stylesheets/styles.css +++ b/src/assets/stylesheets/styles.css @@ -72,6 +72,7 @@ code { display: inline-block; max-width: 100%; overflow-x: auto; + font-size: .8em; } input, select { @@ -93,6 +94,10 @@ hr { margin-bottom: 1em; } +h1, h2, h3, h4, h5, h6 { + text-shadow: 2px 6px 5px rgba(0,0,0,0.2), 0px -4px 10px rgba(0,0,0,0.3); +} + #linksBox { padding: 2em; display: flex; @@ -184,6 +189,16 @@ hr { -webkit-box-orient: vertical } +.oneLineClamp { + overflow: hidden; + width: 100%; + display: -webkit-box; + height: 1em; + line-clamp: 1; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical +} + .featuredProjectSubtitle { padding-bottom: 0px; } @@ -235,6 +250,7 @@ h1, h2, h3 { color: transparent; animation: rainbow_animation 6s ease-in-out infinite; background-size: 400% 100%; + text-shadow: none; } @keyframes rainbow_animation { diff --git a/src/authors/tenkuma/index.md b/src/authors/tenkuma/index.md index 232f6bb..7e72695 100644 --- a/src/authors/tenkuma/index.md +++ b/src/authors/tenkuma/index.md @@ -1,9 +1,7 @@ --- name: "tenkuma" subtitle: "A bear doing things on the internet." -downloadLink: "https://modrinth.com/plugin/tenkumalib/versions" -logoName: "logo" -logoExtension: "png" +logo: "logo.png" images: ["tenkuma-silverfish.jpg", "tenkuma-mrnando-enderdragon.jpg"] --- diff --git a/src/contribute.md b/src/contribute.md index c936590..e96b1ec 100644 --- a/src/contribute.md +++ b/src/contribute.md @@ -17,12 +17,21 @@ neoBeta is an open-source content management system. There are various ways you ### Optional metadata fields Please fill as many fields as possible. - *images* - lists of image files names or URLs that will appear in the project page. - - *logo* - your logo file name or URL. + - *logo* - your logo file name or URL. + - *gameVersions* - taget Minecraft versions. + - *gameLoaders* - supported modloaders. ### Releases metadata - *releasesType* - wheter your project uses `local` releases or `github`. + For local releases: - - *releases* - a list of relases labels and links. + - *releases* - a list of relases labels and links. + - *name* - name of the release. + - *version* - version of the release. + - *gameVersions* - taget Minecraft versions (overrides default value). + - *gameLoaders* - supported modloaders (overrides default value). + - *downloads* - list of download links for this release. + For GitHub releases: - *githubRepoOwner* - username of the repo owner. - *githubReponame* - name of the repository. @@ -47,7 +56,17 @@ For GitHub releases: "releaseType": "github or local", "githubRepoOwner": "adrianvic", "githubRepoName": "ghostsandstuff", - "releases": { - "test release": "https://example.com/" - } -}``` \ No newline at end of file + "gameLoaders": ["Craftbukkit"] + "releases": [ + { + "name": "The first release.", + "version": "1.0.0", + "gameVersions": ["b1.7.3"], + "downloads": { + "GitHub": "https://example.com", + "Modrinth": "https://modrinth.com" + } + } + ] +} +``` \ No newline at end of file diff --git a/src/index.njk b/src/index.njk index bf67345..4f9ae95 100644 --- a/src/index.njk +++ b/src/index.njk @@ -11,10 +11,9 @@ styles: ["home"]

Featured projects

- {{ featured.projectShowcase(["ghostsandstuff", "aboukkit", "tenkumalib", "hangglidere", "devilwithin", "timekeeper", "tefreezer"], collections.projects) }} + {{ featured.projectShowcase(["ghostsandstuff", "devilwithin", "timekeeper", "tefreezer"], collections.projects) }}
-

Latest updates

-

2025-10-27: Website redesign!
Yaaay! neoBeta got a stylish redesign.

+ {% include "news.njk" %}
\ No newline at end of file diff --git a/src/projects/aboukkit/index.json b/src/projects/aboukkit/index.json index b130087..60596e1 100644 --- a/src/projects/aboukkit/index.json +++ b/src/projects/aboukkit/index.json @@ -2,7 +2,38 @@ "name": "Aboukkit", "subtitle": "A simple way to add custom commands with custom responses to your server.", "author": "tenkuma", - "downloadLink": "https://modrinth.com/plugin/aboukkit/versions", + "links": { + "Modrinth": "https://modrinth.com/plugin/aboukkit/versions", + "GitHub": "https://github.com/adrianvic/aboukkit", + "Disroot Git": "https://git.disroot.org/adrianvictor/aboukkit" + }, "logo": "logo.png", - "tags": ["plugin"] + "tags": ["plugin"], + "releaseType": "local", + "dependencies": ["tenkumalib"], + "gameVersions": "b1.7.3", + "gameLoaders": "Bukkit", + "releases": [ + { + "name": "Library update", + "version": "2.1", + "downloads": { + "Modrinth": "https://modrinth.com/plugin/aboukkit/version/2.1" + } + }, + { + "name": "Color update", + "version": "2.0", + "downloads": { + "Modrinth": "https://modrinth.com/plugin/aboukkit/version/2.0" + } + }, + { + "name": "Vanilla", + "version": "1.0", + "downloads": { + "Modrinth": "https://modrinth.com/plugin/aboukkit/version/1.0" + } + } + ] } \ No newline at end of file diff --git a/src/projects/ghostsandstuff/index.json b/src/projects/ghostsandstuff/index.json index c81edea..d054908 100644 --- a/src/projects/ghostsandstuff/index.json +++ b/src/projects/ghostsandstuff/index.json @@ -15,5 +15,7 @@ }, "releaseType": "github", "githubRepoOwner": "adrianvic", - "githubRepoName": "ghostsandstuff" + "githubRepoName": "ghostsandstuff", + "gameVersions": ["b1.7.3"], + "gameLoaders": ["Bukkit"] } \ No newline at end of file