Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Resources Section to community #192

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions website/.config/collections/resourceTags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

const resources = require('../../_data/resources.json');

/** @param {import("@11ty/eleventy/src/TemplateCollection")} api */
function resourceTags(api) {
let tags = [];

resources.forEach((resource) => {
if(resource.tags) {
tags.push(...resource.tags);
}
});

tags = tags.filter((value, index) => tags.indexOf(value) === index).sort();
return ['all'].concat(tags);
}

module.exports = resourceTags;
89 changes: 89 additions & 0 deletions website/_data/resources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[
{
"name": "b1",
"title": "Beginning C# Programming with MonoGame",
"author": "A.T. Chamillard",
"cover": "https://m.media-amazon.com/images/I/61LDsDJX8hL._SL1250_.jpg",
"url": "https://www.amazon.com/Beginning-Programming-MonoGame-T-Chamillard-ebook",
"pixelart": false,
"tags": [
"books"
]
},
{
"name": "b2",
"title": "Introduction to Programming with C#, XNA and MonoGame",
"author": "Robert Cook",
"cover": "https://m.media-amazon.com/images/I/819kOLVdDuL._SL1500_.jpg",
"url": "https://www.amazon.com/Introduction-Programming-MonoGame-Cooks-Books-ebook",
"pixelart": false,
"tags": [
"books"
]
},
{
"name": "b3",
"title": "Introduction to C# Cross-Development Programming by Creating 2D Games with Visual Studio 2022 and MonoGame (Japanese Edition)",
"author": "Yu Sasaki",
"cover": "https://m.media-amazon.com/images/I/616Dx92Vq6L._SL1413_.jpg",
"url": "https://www.amazon.com/Visual-MonoGame%E3%81%AE-2D%E3%82%B2%E3%83%BC%E3%83%A0%E4%BD%9C%E3%82%8A%E3%81%A7%E5%AD%A6%E3%81%B6-%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E5%85%A5%E9%96%80-Japanese",
"pixelart": false,
"tags": [
"books"
]
},
{
"name": "b4",
"title": "Game Development with MonoGame",
"author": "Micheal Fleischauer",
"cover": "https://gamefromscratch.com/wp-content/uploads/2020/07/Book_Cover.png",
"url": "https://gamefromscratch.com/free-monogame-e-book-cross-platform-game-development-with-monogame/",
"pixelart": false,
"tags": [
"books"
]
},
{
"name": "b5",
"title": "MonoGame Succinctly",
"author": "Jim Perry",
"cover": "https://gamefromscratch.com/wp-content/uploads/2020/07/Book_Cover.png",
"url": "https://freecomputerbooks.com/Monogame-Succinctly.html",
"pixelart": false,
"tags": [
"books"
]
},
{
"name": "b6",
"title": "MonoGame Role-Playing Game Development Succinctly",
"author": "Jim Perry & Charles Humphrey",
"cover": "https://gamefromscratch.com/wp-content/uploads/2020/07/Book_Cover.png",
"url": "https://freecomputerbooks.com/Monogame-Role-Playing-Game-Development-Succinctly.html",
"pixelart": false,
"tags": [
"books"
]
},
{
"name": "b7",
"title": "Game Development with Monogame: Build a 2D Game Using Your Own Reusable and Performant Game Engine",
"author": "Louis Salin & Rami Morrar",
"cover": "https://images.booksense.com/images/books/706/277/FC9781484277706.JPG",
"url": "https://freecomputerbooks.com/Monogame-Role-Playing-Game-Development-Succinctly.html",
"pixelart": false,
"tags": [
"books"
]
},
{
"name": "ui",
"title": "UI Libraries",
"cover": "resource-ui.png",
"url": "https://amazon.com",
"pixelart": false,
"tags": [
"ui"
]
}
]
7 changes: 6 additions & 1 deletion website/_data/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"label": "Bounties",
"url": "/bounties/"
},
{
"label": "Resources",
"url": "/resources/"
},
{
"label": "Store",
"url": "https://store.monogame.net"
Expand All @@ -45,7 +49,8 @@
},
{
"label": "Donate",
"url": "/donate/"
"url": "/donate/",
"type": "button"
}
],
"social": [
Expand Down
9 changes: 9 additions & 0 deletions website/_includes/partials/_topnav.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
{% for navlink in site.navigation %}
<li class="nav-item">
{% if navlink.type != "button" %}
<a class="hide-external-icon nav-link {{ 'active' if page.url === navlink.url }}" href="{{ navlink.url }}">
{{ navlink.label }}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% for navlink in site.navigation %}
{% if navlink.type == "button" %}
<a class="btn mg-patreon-button px-4" type="button" href="{{ navlink.url }}">
<i class="bi bi-heart"></i> {{ navlink.label }}
</a>
{% endif %}
{% endfor %}
{% include 'partials/_themeToggle.njk' %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion website/content/community.njk
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ title: Community
</section>

<section class="container-xxl mb-5">
<h2 id="communities" class="fw-bold">
<h2 id="socialnetworks" class="fw-bold">
Official Social Networks
</h2>
<div class="mg-item-grid">
Expand Down
2 changes: 1 addition & 1 deletion website/content/donate.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ title: Donate
<div class="row justify-content-center">
<div class="col-md-auto mb-2 mx-4">
<a class="btn mg-patreon-button px-4" type="button" href="https://github.com/sponsors/MonoGame" target="_blank">
<i class="bi bi-heart"></i> GitHub
{% include 'svgs/logos/github.svg'%} GitHub
</a>
</div>
<div class="col-md-auto mb-2 mx-4">
Expand Down
38 changes: 38 additions & 0 deletions website/content/resources.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Resources
pagination:
data: collections.resourceTags
size: 1
alias: category
permalink: resources/{{ (category | slugify) if category !== "all" }}/
---
{% extends "layouts/base.layout.njk" %}
{% from 'macros/create_category_filter.njk' import create_category_filter %}

{% block content %}
<section class="container-xxl my-5">
<h1 id="monogame-showcase" class="fw-bold"><a href="#monogame-showcase">MonoGame Resources</a></h1>
<p>
Here's a list of MonoGame resources that can help you on your journey.
</p>
</section>

{{ create_category_filter(collections.resourceTags, "/resources/", page.url) }}

<section class="container-xxl mb-5">
<div id="showcase-gallery" class="mg-item-grid">
{% for resource in resources %}
{% if category in resource.tags or category === "all" %}
<a class="mg-no-link hide-external-icon showcase-item" href="{{ resource.url }}" title="{{ resource.title }}">
<div class="mg-card mg-box-shadow d-flex flex-column">
<div class="mg-card-thumbnail"
style="background-image: url('{{ resource.cover }}');
</div>
by {{ resource.author }}
</div>
</a>
{% endif %}
{% endfor %}
</div>
</section>
{% endblock %}
Loading