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

Modifying theme to add a resources button #42

Open
wants to merge 3 commits into
base: f24
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Controllers.osd = require('./osd');
Controllers['404'] = require('./404');
Controllers.errors = require('./errors');
Controllers.composer = require('./composer');

Controllers.resourcesButton = require('./resources-button');
Controllers.write = require('./write');

Controllers.reset = async function (req, res) {
Expand Down
12 changes: 12 additions & 0 deletions src/controllers/resources-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

const controllers = {};

controllers.getResourcesButtonPage = async (req, res) => {
// Render the resources-button template
res.render('resources-button', {
title: 'Resources Page', // You can customize the title or add more data as needed
});
};

module.exports = controllers;
2 changes: 2 additions & 0 deletions src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const express = require('express');

const meta = require('../meta');
const controllers = require('../controllers');
const resourcesButtonController = require('../controllers/resources-button');
const controllerHelpers = require('../controllers/helpers');
const plugins = require('../plugins');

Expand Down Expand Up @@ -80,6 +81,7 @@ _mounts.categories = (app, name, middleware, controllers) => {
setupPageRoute(app, '/recent', [], controllers.recent.get);
setupPageRoute(app, '/top', [], controllers.top.get);
setupPageRoute(app, '/unread', [middleware.ensureLoggedIn], controllers.unread.get);
setupPageRoute(app, '/resources-button', [], resourcesButtonController.getResourcesButtonPage);
};

_mounts.category = (app, name, middleware, controllers) => {
Expand Down
22 changes: 22 additions & 0 deletions src/views/resources-button.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{title}}</title>
</head>
<body>
<div class="container">
<h1>Resources</h1>
<p>Welcome to the resources page! Here you can find various links and materials.</p>

<h2>Useful Links</h2>
<ul>
<li><a href="https://example.com" target="_blank">Example Link 1</a></li>
<li><a href="https://example.com" target="_blank">Example Link 2</a></li>
<li><a href="https://example.com" target="_blank">Example Link 3</a></li>
</ul>
<!-- Add more sections as needed -->
</div>
</body>
</html>
Loading