Skip to content
Snippets Groups Projects
Commit cda6861a authored by Ed Summers's avatar Ed Summers Committed by Null Flancian
Browse files

Redirect to new wiki

parent a74b8dfe
Branches
No related tags found
1 merge request!9Redirect to new wiki
# wiki.social.coop
[#](#) wiki.social.coop
## Overview
- Our wiki is hosted at https://wiki.social.coop
- The content for the wiki comes from the [social.coop/general wiki] here on git.coop (in
order to be easily editable by all)
- This repo uses the [metalsmith](https://github.com/segmentio/metalsmith)
static site generator to build the markdown into html
This repository contains a NodeJS server for serving up a (mostly) static site using Metalsmith. Prior to social.coop adopting Mediawiki at wiki.social.coop this repository would build Markdown pages that were stored in the https://git.coop/social.coop/general repository. After moving to Mediawiki this application was left running only to respond to registration requests for Mastodon on Meet.Coop.
## Content
......@@ -39,4 +35,16 @@
[server.playbook.yaml](https://git.coop/social.coop/tech/ansible/-/blob/master/server.playbook.yml)
to secrets encypted in [our pass repo](https://git.coop/social.coop/tech/pass)
## Development
```
$ git clone git@git.coop:social.coop/tech/wiki.social.coop.git
$ cd wiki.social.coop
$ git clone git@git.coop:social.coop/general.wiki src
$ cp example-config.json config.json
$ npm run serve
```
If you want to change the wiki source pages in `src` you will need to run `npm run build` afterwards to tell metalsmith to rebuild the static site.
[social.coop/general wiki]: https://git.coop/social.coop/general/-/wikis/home
This diff is collapsed.
......@@ -44,6 +44,38 @@ var fileOptions = {
}
};
/*
* All wiki content lives in mediawiki at wiki.social.coop, so we need to make
* sure all traffic for the old pages is redirected there.
*
* TODO: this app should have all wiki content gutted from it and should only be
* used for Mastodon and Meet.Coop registrations.
*/
var redirects = {
'/Governance': 'https://wiki.social.coop/wiki/Governance',
'/Operations': 'https://wiki.social.coop/wiki/Operations',
'/Platforms': 'https://wiki.social.coop/wiki/Platforms',
'/Tutorials': 'https://wiki.social.coop/wiki/Tutorials',
'/How-to-make-the-fediverse-your-own': 'https://wiki.social.coop/wiki/How_to_Make_the_Fediverse_Your_Own',
'/Social.coop-guide-to-Mastodon': 'https://wiki.social.coop/wiki/Social.coop_guide_to_Mastodon',
'/Make-a-proposal': 'https://wiki.social.coop/wiki/Make_a_proposal',
'/May-First': 'https://wiki.social.coop/wiki/May_First_Movement_Technology',
'/community-working-group/Community-Working-Group-Ops-Team': 'https://wiki.social.coop/wiki/Community_Working_Group_Ops_Team',
'/community-working-group/Community-Working-Group': 'https://wiki.social.coop/wiki/Community_Working_Group',
'/community-working-group/Conflict-resolution-guide': 'https://wiki.social.coop/wiki/Conflict_resolution_guide',
'/community-working-group/Guide-for-CWG-Ops-Team-"On-Call"': 'https://wiki.social.coop/wiki/Guide-for-CWG-Ops-Team-%22On-Call%22',
'/community-working-group/Reporting-guide': 'https://wiki.social.coop/wiki/Reporting_guide',
'/Getting-a-social.coop-GitLab-project-account': 'https://wiki.social.coop/wiki/Getting_a_GitLab_project_account',
'/docs/Bylaws': 'https://wiki.social.coop/wiki/Bylaws',
'/docs/Code-of-conduct': 'https://wiki.social.coop/wiki/Code_of_conduct',
'/docs/Defederation-of-instances': 'https://wiki.social.coop/wiki/Defederation_of_instances',
'/docs/Federation-Abuse-Policy': 'https://wiki.social.coop/wiki/Federation_abuse_policy',
'/docs/Partnership-with-Platform-6': 'https://wiki.social.coop/wiki/Partnership_with_Platform_6',
'/finance-working-group/Finance-Working-Group': 'https://wiki.social.coop/wiki/Finance_Working_Group',
'/legal-working-group/Legal-Working-Group': 'https://wiki.social.coop/wiki/Legal_Working_Group',
'/platforms/Calendars': 'https://wiki.social.coop/wiki/Calendars'
}
async function build() {
buildlog.info('starting build...')
metalsmith().build(function(err) {
......@@ -85,6 +117,14 @@ app.get(/^\/meet.coop-registration-form(.html)?/, ensureAuthenticated, (req, res
next();
});
app.get('*', (req, res, next) => {
// redirect to the new wiki using both bare and .html URLs
let redirectPath = req.path.replace(/\.html$/, '');
if (redirectPath in redirects) {
res.redirect(301, redirects[redirectPath]);
return;
}
var path = req.path+'/index.html';
if (fs.existsSync(fileOptions.root+path)) {
// Cater to the wiki's nested-indexes style
......
......@@ -32,10 +32,10 @@
</div>
<ul class="site-nav">
<li class="site-nav-item"><a class="js-ajax-link" title="Social.coop" href="https://social.coop/about/more">Social.coop</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="Governance" href="/Governance">Governance</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="Operations" href="/Operations">Operations</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="Platforms" href="/Platforms">Platforms</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="Tutorials" href="/Tutorials">Tutorials</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="Governance" href="https://wiki.social.coop/Governance">Governance</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="Operations" href="https://wiki.social.coop/Operations">Operations</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="Platforms" href="https://wiki.social.coop/Platforms">Platforms</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="Tutorials" href="https://wiki.social.coop/Tutorials">Tutorials</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="Join" href="/registration-form">Join</a></li>
</ul>
<div class="site-title-wrapper">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment