Added tags to search result, search no long matches the project tags (the ones used for filtering) and implemented author page that show up on search.

This commit is contained in:
天クマ 2025-10-25 19:51:28 -03:00
commit e54f2336db
27 changed files with 244 additions and 89 deletions

27
_includes/author.njk Normal file
View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="/assets/styles.css" media="screen">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>neoBeta</title>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
</head>
<body>
<div id="everythingHelper">
{% include "header.njk" %}
<div id="projectHeader">
<img src="{{ page.dir }}{{ logoName }}.{{ logoExtension }}">
<div id="projectTitleSubtitle">
<div id="projectTitleAuthor">
<h1 id="projectTitle">{{ name }}</h1>
</div>
<p id="projectSubtitle">{{ subtitle }}</p>
</div>
</div>
<main id="projectDescription">
{{ content | safe }}
</main>
</div>
</body>
</html>

View file

@ -11,15 +11,17 @@
<div id="everythingHelper">
{% include "header.njk" %}
<div id="projectHeader">
{% if logoName and logoExtension %}
<img src="{{ page.dir }}{{ logoName }}.{{ logoExtension }}">
{% endif %}
<div id="projectTitleSubtitle">
<div id="projectTitleAuthor">
<h1 id="projectTitle">{{ projectName }}</h1>
<p id="projectAuthor">by {{ projectAuthor }}</p>
<h1 id="projectTitle">{{ name }}</h1>
<p id="projectAuthor">by {{ author }}</p>
</div>
<p id="projectSubtitle">{{ projectSubtitle }}</p>
<p id="projectSubtitle">{{ subtitle }}</p>
</div>
<a id="downloadLink" href="{{ projectDonwloadLink }}"><button id="downloadButton">Download</button></a>
<a id="downloadLink" href="{{ downloadLink }}"><button id="downloadButton">Download</button></a>
</div>
<main id="projectDescription">
{{ content | safe }}

View file

@ -1,7 +1,7 @@
const featuredHelper = document.querySelector("#featuredHelper");
async function getFeaturedJSON() {
const response = await fetch(`featured.json`);
const response = await fetch(`/assets/featured.json`);
if (!response.ok) {
featuredHelper.innerHTML = `
<p>;( Oopsie! Could not load featured projects...</p>
@ -17,13 +17,11 @@ async function getFeaturedJSON() {
featuredDiv.id = `featured-${project}`;
featuredDiv.innerHTML = `
<a href="project.html?id=${project}">
<img src="projects/${project}/logo.png">
<p>:${project}</p>
<img src="/projects/${project}/logo.png">
<p>${project}</p>
</a>
`;
featuredHelper.appendChild(featuredDiv);
loadProject(project, document.querySelector(`featured-${project} p`), undefined, undefined, undefined, document.querySelector(`featured-${project} img`))
});
}

1
assets/featured.json Normal file
View file

@ -0,0 +1 @@
["aboukkit", "ghostsandstuff", "tenkumalib"]

View file

@ -1,53 +0,0 @@
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const projectID = urlParams.get('id');
async function getProjectJSON(id = projectID) {
const response = await fetch(`projects/${id}/project.json`);
if (!response.ok) throw new Error("Failed to fetch project JSON");
return response.json();
}
async function getProjectDescription(obj, id = projectID) {
const response = await fetch(`projects/${id}/description.md`);
if (response.ok) {
const text = await response.text();
obj.innerHTML = marked.parse(text.replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/, ""));
}
}
async function loadProject(id = projectID, objTitle, objSubtitle, objAuthor, objDescription, objLogo, objDownloadLink, changeColor, changeBackground) {
try {
const jsonData = await getProjectJSON(id);
document.title = `${jsonData.project.author}:${id}@neoBeta`
if (objTitle) objTitle.innerText = jsonData.project.title;
if (objSubtitle) objSubtitle.innerText = jsonData.project.subtitle;
if (objAuthor) objAuthor.innerText = `by ${jsonData.project.author}`;
if (objDescription) await getProjectDescription(objDescription, id);
if (jsonData.project.downloadLink) {
if (objDownloadLink) objDownloadLink.href = jsonData.project.downloadLink;
} else {
if (objDownloadLink) objDownloadLink.innerText = "Download unavailable";
}
if (jsonData.project.displayLogo == true) {
if (objLogo) objLogo.src = `projects/${id}/logo.png`;
} else {
objLogo.remove();
}
if (jsonData.project.backgroundColor) {
changeColor.style.backgroundColor = jsonData.project.backgroundColor;
}
if (jsonData.project.backgroundImage) {
changeBackground.style.backgroundImage = `url(${jsonData.project.backgroundImage})`;
}
if (jsonData.project.backgroundImageSize) {
changeBackground.style.backgroundSize = jsonData.project.backgroundImageSize;
}
} catch (error) {
console.error("Error loading project:", error);
}
}

View file

@ -3,22 +3,36 @@ fetch('/search_index.json')
.then(data => {
const idx = elasticlunr.Index.load(data);
const docs = idx.documentStore.docs;
console.log(Object.values(docs)[0])
const searchInput = document.getElementById('search');
const out = document.getElementById('searchResults');
const filterSelect = document.getElementById('searchMode');
function runSearch(q, tags) {
return idx.search(q, { expand: true })
.map(r => docs[r.ref] )
.filter(d => tags === 'all' || d.tags.includes(tags));
function runSearch(q, tags = 'all') {
let result = idx.search(q, { expand: true }).map(r => docs[r.ref] )
if (tags === 'all') {
return result;
}
result = result.filter(d => tags === 'all' || d.tags.includes(tags));
return result;
}
function render(doc) {
return `<div>
<img class="searchItemImage" src="${doc.image}">
<a class="searchItemTitle" href="${doc.url}">${doc.title}</a>
console.log(doc.imageq)
let tagsHTML = "";
console.log(doc.tags)
doc.tags.forEach(tag => {
tagsHTML += `<div class="tag-${tag}">${tag}</div>`
});
return `<div class="searchItem">
<p>${doc.image ? `<img float=left class="searchItemImage" src="${doc.image}">` : ''} <a class="searchItemTitle" href="${doc.url}">${doc.title}</a>${doc.author ? ` by <a href="/authors/${doc.author}">${doc.author}</a>` : ''}</p>
<p class="searchItemDescription">${doc.subtitle}</p>
<div class="searchItemTagHolder">
${tagsHTML}
</div>
</div>`;
}

View file

@ -55,6 +55,16 @@ code {
margin-right: 2px; */
}
input, select {
padding: .4em;
background-color: black;
color: white;
}
p, ul {
padding-bottom: .6em;
}
#linksBox {
padding: 10px;
display: flex;
@ -149,7 +159,7 @@ code {
padding-top: 20px;
gap: 20px;
display: flex;
text-shadow: 2px 2px gray;
/* text-shadow: 2px 2px gray; */
}
#downloadButton {
@ -163,7 +173,7 @@ code {
margin-bottom: auto;
margin-left: auto;
text-align: right;
text-shadow: 2px 2px black;
/* text-shadow: 2px 2px black; */
}
#downloadButton:hover {
@ -173,7 +183,8 @@ code {
#projectHeader img {
outline: 2px solid gray;
height: 100%;
height: 5em;
image-rendering: pixelated;
}
#projectDescription li {
@ -199,6 +210,21 @@ code {
margin-left: auto;
}
.searchItemTagHolder {
display: flex;
padding-top: .2em;
gap: .4em;
}
.searchItemTagHolder div {
border: thin solid greenyellow;
padding: .1em .2em .1em .2em;
}
.searchItemDescription {
margin-bottom: 0px;
}
@media only screen and (max-width: 1280px) {
#everythingHelper {

4
authors/authors.json Normal file
View file

@ -0,0 +1,4 @@
{
"layout": "author.njk",
"tags": "author"
}

9
authors/tenkuma/index.md Normal file
View file

@ -0,0 +1,9 @@
---
name: "tenkuma"
subtitle: "A bear doing things on the internet."
downloadLink: "https://modrinth.com/plugin/tenkumalib/versions"
logoName: "logo"
logoExtension: "png"
---
I'm tenkuma.

BIN
authors/tenkuma/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

View file

@ -7,13 +7,17 @@ export default function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("projects/**/*.png");
eleventyConfig.addPassthroughCopy("projects/**/*.jpg");
eleventyConfig.addPassthroughCopy("projects/**/*.jpeg");
eleventyConfig.addPassthroughCopy("authors/**/*.png");
eleventyConfig.addPassthroughCopy("authors/**/*.jpg");
eleventyConfig.addPassthroughCopy("authors/**/*.jpeg");
eleventyConfig.addPassthroughCopy("assets");
eleventyConfig.addCollection('searchIndex', (collectionApi) => {
const result = collectionApi.getAll().map(item => {
return {
title: item.data.projectName,
subtitle: item.data.projectSubtitle || "",
title: item.data.name,
subtitle: item.data.subtitle || "",
author: item.data.author,
url: item.url,
image: (item.data.logoName && item.data.logoExtension) ? item.url + item.data.logoName + '.' + item.data.logoExtension : '',
tags: item.data.tags
@ -29,7 +33,7 @@ export default function (eleventyConfig) {
this.setRef('url');
this.addField('title', { boost: 2 });
this.addField('subtitle');
this.addField('tags')
// this.addField('tags') so search does not match
allPlugins.forEach(doc => this.addDoc(doc));
});

View file

@ -1 +0,0 @@
["aboukkit", "ghostsandstuff"]

View file

@ -2,6 +2,7 @@
layout: "base.njk"
---
<script src="/assets/featured.js" defer></script>
<h1>Welcome.</h1>
<p>This is a project that aims to preserve Minecraft Beta mods and plugins through archives of documentation and JARs and showcase new plugins for beta.</p>
<div id="featured"><h2>featured projects</h2>

View file

@ -1,9 +1,8 @@
---
layout: "project.njk"
projectName: "Aboukkit"
projectSubtitle: "A simple way to add custom commands with custom responses to your server."
projectAuthor: "tenkuma"
projectDownloadLink: "https://modrinth.com/plugin/aboukkit/versions"
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"
backgroundImageSize: "cover"
logoName: "logo"
logoExtension: "png"

View file

@ -0,0 +1,19 @@
---
name: "Console HUD"
subtitle: "A simple way to add custom commands with custom responses to your server."
author: "LO6AN"
downloadLink: "https://archive.org/details/console-hud-v-1.1/12548478.png"
tags: mod
---
## Description
This mod is made to replicate the HUD given to you by the console version of the game. It shifts the hotbar upwards and reorients the way lighting is shown on the blocks to make it better match. The controls are not displayed on the bottom, nor are any other interface elements tweaked. This mod does not allow you to play with a controller, for that I recommend using AntiMicro.
## Classes Edited
- ```uq.class``` (GuiIngame.java)
## Installation
- Add files to Minecraft.jar
For MultiMC, this means creating a Beta 1.7.3 Instance, clicking the "Add to Minecraft.jar" button within the Version Window, and selecting the zip for this mod
For the Vanilla launcher, this means cramming the edited class files from this mod into your Beta 1.7.3 Jar.

View file

@ -0,0 +1,40 @@
---
name: "The Devil Within"
subtitle: "Adds enchanting to Minecraft Beta. Supports balancing through curses."
author: "tenkuma"
downloadLink: "https://modrinth.com/plugin/devilwithin/versions"
logoName: "logo"
logoExtension: "png"
tags: plugin
---
This plugin is a remake of [GoldEnchant](https://dev.bukkit.org/projects/goldenchant/).
This plugin depends on [tenkumaLib](https://modrinth.com/plugin/tenkumalib).
Have you ever wanted to have enchantments in your beta server? This is the plugin you want.
## Enchanting
To enchant a armor piece you need to interact to a diamond block with a diamond armor piece in your hand.
## Enchantments and Curses
All of those enchantments will not take effect if the damage exceeds the player's HP. An armor get cursed if it's durability is below 30%. Spooky bad stuff will happen if your armor is cursed :D
### Helmet
- Prevents the player from drowning.
- The player cannot sleep. If the player try to sleep a entity will tell the player the text set in the config.
### Chestplate
- Prevents fire damage. Does not prevent lava damage.
- Protects the player from fire damage only half of the time, also has a 25% chance to ignite the player every time it takes damage.
### Leggings
- Nothing for now. Only useful for the full-set perks.
- Makes player run slower 50% of the time a PlayerMoveEvent happens. The speed is randomly generated.
### Boots
Prevents fall damage.
### Full-set perks
If the player has a full-set of enchanted armor the condition of the damage being taken if it's greater than the player's HP is ignored, also the player gets immune to contact damage (cactus), lava damage and lava damage.
## Config
Everything is explained in the config file's comments, in case it changes.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -1,9 +1,8 @@
---
layout: "project.njk"
projectName: "Ghosts 'n Stuff"
projectSubtitle: "Miscellaneous additions to your Minecraft server."
projectAuthor: "tenkuma"
projectDownloadLink: "https://modrinth.com/plugin/ghosts/versions"
name: "Ghosts 'n Stuff"
subtitle: "Miscellaneous additions to your Minecraft server."
author: "tenkuma"
downloadLink: "https://modrinth.com/plugin/ghosts/versions"
backgroundImageSize: "cover"
logoName: "logo"
logoExtension: "png"

View file

@ -0,0 +1,7 @@
---
name: "HangGlideRE"
subtitle: ""
author: "tenkuma"
downloadLink: "https://modrinth.com/plugin/aboukkit/versions"
tags: plugin
---

1
projects/projects.json Normal file
View file

@ -0,0 +1 @@
{ "layout": "project.njk" }

View file

@ -0,0 +1,24 @@
---
name: "teFreezer"
subtitle: "Force your players to refrigerate their food by rotting food in unrefrigerated chests!"
author: "tenkuma"
downloadLink: "https://modrinth.com/plugin/freezer/versions"
logoName: "logo"
logoExtension: "png"
tags: plugin
---
![Tefreezer written in Minecraft-like font in purple.](https://cdn.modrinth.com/data/cached_images/0aaabfb51609876ece6de83e62b9641a4635fad9_0.webp)
teFreezer is a fork of [Freezer by outadoc](https://dev.bukkit.org/projects/freezer), logo by [malcolmriley](https://github.com/malcolmriley/unused-textures/blob/master/items/food_pepper.png).
This plugins purpose is to force people in your server to refrigerate their food by placing a cold block around their chest with the food. In case there is no cold block around the chest, it will turn the food into a rotted item.
## Configuration
In the ```config.yml``` you can set these values:
- Cold blocks
- Resulting itens
- Itens that can rot
- Message for when the user let food rot
## Why fork?
I have forked this plugin because I was really anoyed by the original plugin that broadcasts the message to the whole server once anyone let food rot and the lack of a configuration file.

BIN
projects/tefreezer/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,9 @@
---
name: "tenkuma's Library"
subtitle: "Library to support my other plugins. Does nothing on it's own."
author: "tenkuma"
downloadLink: "https://modrinth.com/plugin/tenkumalib/versions"
logoName: "logo"
logoExtension: "png"
tags: "plugin"
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

View file

@ -0,0 +1,21 @@
---
name: "TimeKeeper"
subtitle: "Syncs real world time with your Minecraft server time."
author: "tenkuma"
downloadLink: "https://modrinth.com/plugin/timekeeper/versions"
logoName: "logo"
logoExtension: "png"
tags: plugin
---
This is a plugin for Minecraft beta that syncs the real world time with your in-game time. Logo by [malcolmriley](https://github.com/malcolmriley/unused-textures/blob/master/items/).
## How it works
It will calculate and change the game time every second (that's 20 ticks and can be changed in the config), it will use your computer's timezone as default if the config `timezone` value does not exist.
## Performance
I am not sure if this plugin has any significant performance hit, it runs code every few ticks (you can in/decrease the frequency in the config) and that is not the best approach for doing this, but it's the only that works in beta. Using it with `ticksBetweenUpdate: 1` does not seem to change the performance in any way. The specifications for the computer used for the tests:
```Host: 83AF IdeaPad 1 14IAU7
CPU: 12th Gen Intel i5-1235U (12) @ 1.300GHz
GPU: Intel Alder Lake-UP3 GT2 [Iris Xe Graphics]
Memory: 10097MiB / 15709MiB```

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

View file

@ -13,11 +13,15 @@ layout: "base.njk"
}
</style>
<p>Welcome to neoBeta's search, here you can search through our whole database of plugins, mods and authors. You may want to filter out the results using the dropdown menu below. The search is done on your device using <a href="https://github.com/weixsong/elasticlunr.js">elasticlunr</a>.</p>
<div style="display: flex; gap: .5em;">
<input type="text" id="search" placeholder="Search..." style="flex-grow: 1;"/>
<select name="Search mode" id="searchMode">
<option value="plugin" selected>Plugins</option>
<option value="all" selected>All</option>
<option value="plugin">Plugins</option>
<option value="mod">Mods</option>
<option value="author">Authors</option>
</select>
</div>
<div id="searchResults" style="display: flex; gap: .5em; flex-direction: column;"></div>
<div id="searchResults" style="display: flex; gap: 1em; flex-direction: column;"></div>