Fixed featured projects in home page.

This commit is contained in:
天クマ 2025-10-26 14:18:41 -03:00
commit bb218c9c12
11 changed files with 47 additions and 97 deletions

20
_includes/featured.njk Normal file
View file

@ -0,0 +1,20 @@
{% macro projectShowcase(projects, c) %}
<div id="featured">
<div id="featuredHelper">
{% for project in projects %}
{% for item in c %}
{% if item.fileSlug == project %}
{% set projectData = item %}
<div class="featuredProject">
<a href="/projects/{{ project }}">
<img src="{% if projectData.data.logoName and projectData.data.logoExtension %}/projects/{{project}}/{{ projectData.data.logoName }}.{{ projectData.data.logoExtension }}{% else %}/assets/mod-placeholder.png{% endif %}">
</a>
<p class="featuredProjectName">{{ projectData.data.name }}</p>
<p>by <a href="/authors/{{ projectData.data.author }}/">{{ projectData.data.author }}</a></p>
</div>
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>
{% endmacro %}

View file

@ -17,7 +17,7 @@
<div id="projectTitleSubtitle"> <div id="projectTitleSubtitle">
<div id="projectTitleAuthor"> <div id="projectTitleAuthor">
<h1 id="projectTitle">{{ name }}</h1> <h1 id="projectTitle">{{ name }}</h1>
<p id="projectAuthor">by {{ author }}</p> <p id="projectAuthor">by <a href="/authors/{{ author }}">{{ author }}</a></p>
</div> </div>
<p id="projectSubtitle">{{ subtitle }}</p> <p id="projectSubtitle">{{ subtitle }}</p>
</div> </div>

View file

@ -1,28 +0,0 @@
const featuredHelper = document.querySelector("#featuredHelper");
async function getFeaturedJSON() {
const response = await fetch(`/assets/featured.json`);
if (!response.ok) {
featuredHelper.innerHTML = `
<p>;( Oopsie! Could not load featured projects...</p>
`
throw new Error("Failed to fetch featured projects JSON");
}
const data = await response.json();
data.forEach(project => {
const featuredDiv = document.createElement("div");
featuredDiv.classList.add("featuredProject");
featuredDiv.id = `featured-${project}`;
featuredDiv.innerHTML = `
<a href="project.html?id=${project}">
<img src="/projects/${project}/logo.png">
<p>${project}</p>
</a>
`;
featuredHelper.appendChild(featuredDiv);
});
}
getFeaturedJSON();

View file

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

View file

@ -1,11 +0,0 @@
const featuredHelper = document.querySelector("#featuredHelper")
async function loadFeatured() {
const response = await fetch(`bananas.json`);
if (!response.ok) {
featuredHelper.innerHTML = `
<p>Oops! Failed to fetch featured projects...</p>
`
throw new Error("Failed to fetch featured projects JSON");
}
}

BIN
assets/mod-placeholder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -65,6 +65,10 @@ p, ul {
padding-bottom: .6em; padding-bottom: .6em;
} }
img {
image-rendering: pixelated;
}
#linksBox { #linksBox {
padding: 10px; padding: 10px;
display: flex; display: flex;
@ -102,9 +106,6 @@ p, ul {
} }
#featured { #featured {
margin-top: 20px;
border: 2px solid greenyellow;
padding: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
@ -117,20 +118,19 @@ p, ul {
.featuredProject { .featuredProject {
transition: .2s; transition: .2s;
height: fit-content;
width: 15%; width: 15%;
font-size: smaller; font-size: smaller;
padding: 4px; padding: 4px;
overflow: hidden; overflow: hidden;
} }
.featuredProject:hover { .featuredProjectName {
transition: .2s; margin-top: auto;
outline: 4px solid gray;
} }
.featuredProject img { .featuredProject img {
width: 100%; width: 100%;
border: medium solid yellowgreen;
} }
.featuredProject p { .featuredProject p {
@ -159,11 +159,12 @@ p, ul {
padding-top: 20px; padding-top: 20px;
gap: 20px; gap: 20px;
display: flex; display: flex;
/* text-shadow: 2px 2px gray; */
} }
#downloadButton { #downloadButton {
border: 2px solid gray; border: none;
background: linear-gradient(yellowgreen, green);
border-radius: 2px;
} }
#downloadLink { #downloadLink {

View file

@ -11,6 +11,11 @@ export default function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("authors/**/*.jpg"); eleventyConfig.addPassthroughCopy("authors/**/*.jpg");
eleventyConfig.addPassthroughCopy("authors/**/*.jpeg"); eleventyConfig.addPassthroughCopy("authors/**/*.jpeg");
eleventyConfig.addPassthroughCopy("assets"); eleventyConfig.addPassthroughCopy("assets");
eleventyConfig.addCollection("projects", function(collection) {
return collection.getFilteredByGlob("./projects/**/*.md");
});
eleventyConfig.addCollection('searchIndex', (collectionApi) => { eleventyConfig.addCollection('searchIndex', (collectionApi) => {
const result = collectionApi.getAll().map(item => { const result = collectionApi.getAll().map(item => {

View file

@ -1,28 +0,0 @@
---
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>
<div id="featuredHelper">
<!-- <div class="featuredProject">
<a href="project.html?id=aboukkit">
<img src="images/projects/aboukkit.png">
<p>Aboukkit</p>
<p>by tenkuma</p>
</a>
</div>
<div class="featuredProject">
<img src="images/projects/ghostsandstuff.png">
<p>Ghosts 'n Stuff</p>
<p>by tenkuma</p>
</div>
<div class="featuredProject">
<img src="images/projects/hats.png">
<p>Hats</p>
<p>by AleksandarHaralanov</p>
</div> -->
</div>
</div>

11
index.njk Normal file
View file

@ -0,0 +1,11 @@
---
layout: "base.njk"
---
{% import "featured.njk" as featured %}
<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>
<h2>Featured projects</h2>
{{ featured.projectShowcase(["aboukkit", "tenkumalib", "hangglidere", "devilwithin", "timekeeper", "tefreezer"], collections.projects) }}

View file

@ -1,19 +0,0 @@
---
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.