@ -0,0 +1,35 @@ |
|||
// sidebar.js
|
|||
// Copyright (C) 2021 Digital Telepresence, LLC
|
|||
// License: Apache-2.0
|
|||
|
|||
'use strict'; |
|||
|
|||
const { SiteService } = require('../../lib/site-lib'); |
|||
|
|||
class SidebarService extends SiteService { |
|||
|
|||
constructor (dtp) { |
|||
super(dtp, module.exports); |
|||
} |
|||
|
|||
middleware ( ) { |
|||
return async (req, res, next) => { |
|||
const { link: linkService, user: userService } = this.dtp.services; |
|||
try { |
|||
res.locals.popularLinks = await linkService.getPopular(3); |
|||
res.locals.recentLinks = await linkService.getRecent(3); |
|||
res.locals.recentUsers = await userService.getRecent(3); |
|||
return next(); |
|||
} catch (error) { |
|||
this.log.error('failed to populate sidebar', { error }); |
|||
return next(error); |
|||
} |
|||
}; |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
slug: 'sidebar', |
|||
name: 'sidebar', |
|||
create: (dtp) => { return new SidebarService(dtp); }, |
|||
}; |
@ -1,18 +1,15 @@ |
|||
extends layouts/main |
|||
extends layouts/main-sidebar |
|||
block content |
|||
|
|||
section.uk-section.uk-section-default |
|||
.uk-container |
|||
.uk-margin.uk-text-center |
|||
h1.uk-margin-remove= site.name |
|||
.uk-text-lead= site.description |
|||
.sr-only |
|||
h1.uk-margin-remove= site.name |
|||
.uk-text-lead= site.description |
|||
|
|||
p #{site.name} provides a landing page people can use to display a collection of links. These can be used for people to help others find them on social media, ways to donate and support them, and more. |
|||
|
|||
p We do not allow the promotion of pornography or linking to it. This is otherwise a free-speech online service and will not ban people for their social or political views. |
|||
.uk-margin |
|||
img(src=`/img/social-cards/${site.domainKey}.png`).responsive.uk-border-rounded |
|||
|
|||
div(uk-grid) |
|||
.uk-width-1-2 |
|||
a(href="/welcome/signup").uk-button.dtp-button-primary.uk-display-block Sign Up |
|||
.uk-width-1-2 |
|||
a(href="/welcome/login").uk-button.dtp-button-default.uk-display-block Login |
|||
.uk-margin |
|||
div #{site.name} provides a landing page you configure with your links on it. Use it as a springboard into all your social media profiles, streaming channels, websites, podcasts, stores, blogs, and whatever else you can link to using a valid URL. |
|||
|
|||
.uk-margin |
|||
a(href="/welcome").uk-button.dtp-button-primary.uk-display-block Get Started |
Before Width: | Height: | Size: 664 KiB |
Before Width: | Height: | Size: 326 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 248 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 860 KiB |