This commit is contained in:
syuilo 2017-12-17 01:41:22 +09:00
parent b563a67b8a
commit 0769566408
24 changed files with 65 additions and 42 deletions

View file

@ -24,7 +24,7 @@ Note that Misskey uses following subdomains:
* **api**.*{primary domain}* * **api**.*{primary domain}*
* **auth**.*{primary domain}* * **auth**.*{primary domain}*
* **about**.*{primary domain}* * **docs**.*{primary domain}*
* **ch**.*{primary domain}* * **ch**.*{primary domain}*
* **stats**.*{primary domain}* * **stats**.*{primary domain}*
* **status**.*{primary domain}* * **status**.*{primary domain}*

View file

@ -25,7 +25,7 @@ Misskeyは以下のサブドメインを使います:
* **api**.*{primary domain}* * **api**.*{primary domain}*
* **auth**.*{primary domain}* * **auth**.*{primary domain}*
* **about**.*{primary domain}* * **docs**.*{primary domain}*
* **ch**.*{primary domain}* * **ch**.*{primary domain}*
* **stats**.*{primary domain}* * **stats**.*{primary domain}*
* **status**.*{primary domain}* * **status**.*{primary domain}*

View file

@ -9,7 +9,6 @@ import * as gulp from 'gulp';
import * as gutil from 'gulp-util'; import * as gutil from 'gulp-util';
import * as ts from 'gulp-typescript'; import * as ts from 'gulp-typescript';
import tslint from 'gulp-tslint'; import tslint from 'gulp-tslint';
import * as es from 'event-stream';
import cssnano = require('gulp-cssnano'); import cssnano = require('gulp-cssnano');
import * as uglifyComposer from 'gulp-uglify/composer'; import * as uglifyComposer from 'gulp-uglify/composer';
import pug = require('gulp-pug'); import pug = require('gulp-pug');
@ -74,16 +73,10 @@ gulp.task('build:ts', () => {
}); });
gulp.task('build:copy', () => gulp.task('build:copy', () =>
es.merge(
gulp.src([ gulp.src([
'./src/**/assets/**/*', './src/**/assets/**/*',
'!./src/web/app/**/assets/**/*' '!./src/web/app/**/assets/**/*'
]).pipe(gulp.dest('./built/')) as any, ]).pipe(gulp.dest('./built/'))
gulp.src([
'./src/web/about/**/*',
'!./src/web/about/**/*.pug'
]).pipe(gulp.dest('./built/web/about/')) as any
)
); );
gulp.task('test', ['lint', 'mocha']); gulp.task('test', ['lint', 'mocha']);

View file

@ -38,7 +38,6 @@
"@types/debug": "0.0.30", "@types/debug": "0.0.30",
"@types/deep-equal": "1.0.1", "@types/deep-equal": "1.0.1",
"@types/elasticsearch": "5.0.19", "@types/elasticsearch": "5.0.19",
"@types/event-stream": "3.3.33",
"@types/eventemitter3": "2.0.2", "@types/eventemitter3": "2.0.2",
"@types/express": "4.0.39", "@types/express": "4.0.39",
"@types/gm": "1.17.33", "@types/gm": "1.17.33",
@ -99,7 +98,6 @@
"diskusage": "0.2.4", "diskusage": "0.2.4",
"elasticsearch": "14.0.0", "elasticsearch": "14.0.0",
"escape-regexp": "0.0.1", "escape-regexp": "0.0.1",
"event-stream": "3.3.4",
"eventemitter3": "3.0.0", "eventemitter3": "3.0.0",
"exif-js": "2.3.0", "exif-js": "2.3.0",
"express": "4.16.2", "express": "4.16.2",

View file

@ -101,7 +101,7 @@ type Mixin = {
secondary_scheme: string; secondary_scheme: string;
api_url: string; api_url: string;
auth_url: string; auth_url: string;
about_url: string; docs_url: string;
ch_url: string; ch_url: string;
stats_url: string; stats_url: string;
status_url: string; status_url: string;
@ -131,7 +131,7 @@ export default function load() {
mixin.auth_url = `${mixin.scheme}://auth.${mixin.host}`; mixin.auth_url = `${mixin.scheme}://auth.${mixin.host}`;
mixin.ch_url = `${mixin.scheme}://ch.${mixin.host}`; mixin.ch_url = `${mixin.scheme}://ch.${mixin.host}`;
mixin.dev_url = `${mixin.scheme}://dev.${mixin.host}`; mixin.dev_url = `${mixin.scheme}://dev.${mixin.host}`;
mixin.about_url = `${mixin.scheme}://about.${mixin.host}`; mixin.docs_url = `${mixin.scheme}://docs.${mixin.host}`;
mixin.stats_url = `${mixin.scheme}://stats.${mixin.host}`; mixin.stats_url = `${mixin.scheme}://stats.${mixin.host}`;
mixin.status_url = `${mixin.scheme}://status.${mixin.host}`; mixin.status_url = `${mixin.scheme}://status.${mixin.host}`;
mixin.drive_url = `${mixin.secondary_scheme}://file.${mixin.secondary_host}`; mixin.drive_url = `${mixin.secondary_scheme}://file.${mixin.secondary_host}`;

View file

@ -3,7 +3,7 @@
<h1>Misskeyとは</h1> <h1>Misskeyとは</h1>
<p><ruby>Misskey<rt>みすきー</rt></ruby>は、<a href="http://syuilo.com" target="_blank">syuilo</a>が2014年くらいから<a href="https://github.com/syuilo/misskey" target="_blank">オープンソースで</a>開発・運営を行っている、ミニブログベースのSNSです。</p> <p><ruby>Misskey<rt>みすきー</rt></ruby>は、<a href="http://syuilo.com" target="_blank">syuilo</a>が2014年くらいから<a href="https://github.com/syuilo/misskey" target="_blank">オープンソースで</a>開発・運営を行っている、ミニブログベースのSNSです。</p>
<p>無料で誰でも利用でき、広告も掲載していません。</p> <p>無料で誰でも利用でき、広告も掲載していません。</p>
<p><a href={ _ABOUT_URL_ } target="_blank">もっと知りたい方はこちら</a></p> <p><a href={ _DOCS_URL_ } target="_blank">もっと知りたい方はこちら</a></p>
</article> </article>
<style> <style>
:scope :scope

View file

@ -1,7 +1,10 @@
<mk-nav-links> <mk-nav-links>
<a href={ _ABOUT_URL_ }>%i18n:common.tags.mk-nav-links.about%</a><i></i><a href={ _STATS_URL_ }>%i18n:common.tags.mk-nav-links.stats%</a><i></i><a href={ _STATUS_URL_ }>%i18n:common.tags.mk-nav-links.status%</a><i></i><a href="http://zawazawa.jp/misskey/">%i18n:common.tags.mk-nav-links.wiki%</a><i></i><a href="https://github.com/syuilo/misskey/blob/master/DONORS.md">%i18n:common.tags.mk-nav-links.donors%</a><i></i><a href="https://github.com/syuilo/misskey">%i18n:common.tags.mk-nav-links.repository%</a><i></i><a href={ _DEV_URL_ }>%i18n:common.tags.mk-nav-links.develop%</a><i></i><a href="https://twitter.com/misskey_xyz" target="_blank">Follow us on %fa:B twitter%</a> <a href={ aboutUrl }>%i18n:common.tags.mk-nav-links.about%</a><i></i><a href={ _STATS_URL_ }>%i18n:common.tags.mk-nav-links.stats%</a><i></i><a href={ _STATUS_URL_ }>%i18n:common.tags.mk-nav-links.status%</a><i></i><a href="http://zawazawa.jp/misskey/">%i18n:common.tags.mk-nav-links.wiki%</a><i></i><a href="https://github.com/syuilo/misskey/blob/master/DONORS.md">%i18n:common.tags.mk-nav-links.donors%</a><i></i><a href="https://github.com/syuilo/misskey">%i18n:common.tags.mk-nav-links.repository%</a><i></i><a href={ _DEV_URL_ }>%i18n:common.tags.mk-nav-links.develop%</a><i></i><a href="https://twitter.com/misskey_xyz" target="_blank">Follow us on %fa:B twitter%</a>
<style> <style>
:scope :scope
display inline display inline
</style> </style>
<script>
this.aboutUrl = `${_DOCS_URL_}/${_LANG_}/about`;
</script>
</mk-nav-links> </mk-nav-links>

View file

@ -34,7 +34,7 @@
</label> </label>
<label class="agree-tou"> <label class="agree-tou">
<input name="agree-tou" type="checkbox" autocomplete="off" required="required"/> <input name="agree-tou" type="checkbox" autocomplete="off" required="required"/>
<p><a href="https://github.com/syuilo/misskey/blob/master/src/docs/tou.md" target="_blank">利用規約</a>に同意する</p> <p><a href={ touUrl } target="_blank">利用規約</a>に同意する</p>
</label> </label>
<button onclick={ onsubmit }>%i18n:common.tags.mk-signup.create%</button> <button onclick={ onsubmit }>%i18n:common.tags.mk-signup.create%</button>
</form> </form>
@ -182,6 +182,8 @@
this.passwordRetypeState = null; this.passwordRetypeState = null;
this.recaptchaed = false; this.recaptchaed = false;
this.aboutUrl = `${_DOCS_URL_}/${_LANG_}/tou`;
window.onRecaptchaed = () => { window.onRecaptchaed = () => {
this.recaptchaed = true; this.recaptchaed = true;
this.update(); this.update();

View file

@ -1,5 +1,5 @@
<mk-twitter-setting> <mk-twitter-setting>
<p>%i18n:common.tags.mk-twitter-setting.description%<a href={ _ABOUT_URL_ + '/link-to-twitter' } target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p> <p>%i18n:common.tags.mk-twitter-setting.description%<a href={ _DOCS_URL_ + '/link-to-twitter' } target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p>
<p class="account" if={ I.twitter } title={ 'Twitter ID: ' + I.twitter.user_id }>%i18n:common.tags.mk-twitter-setting.connected-to%: <a href={ 'https://twitter.com/' + I.twitter.screen_name } target="_blank">@{ I.twitter.screen_name }</a></p> <p class="account" if={ I.twitter } title={ 'Twitter ID: ' + I.twitter.user_id }>%i18n:common.tags.mk-twitter-setting.connected-to%: <a href={ 'https://twitter.com/' + I.twitter.screen_name } target="_blank">@{ I.twitter.screen_name }</a></p>
<p> <p>
<a href={ _API_URL_ + '/connect/twitter' } target="_blank" onclick={ connect }>{ I.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }</a> <a href={ _API_URL_ + '/connect/twitter' } target="_blank" onclick={ connect }>{ I.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }</a>

View file

@ -150,7 +150,7 @@
</mk-entrance> </mk-entrance>
<mk-entrance-signin> <mk-entrance-signin>
<a class="help" href={ _ABOUT_URL_ + '/help' } title="お困りですか?">%fa:question%</a> <a class="help" href={ _DOCS_URL_ + '/help' } title="お困りですか?">%fa:question%</a>
<div class="form"> <div class="form">
<h1><img if={ user } src={ user.avatar_url + '?thumbnail&size=32' }/> <h1><img if={ user } src={ user.avatar_url + '?thumbnail&size=32' }/>
<p>{ user ? user.name : 'アカウント' }</p> <p>{ user ? user.name : 'アカウント' }</p>

View file

@ -248,7 +248,7 @@
<li><a href="/i/settings">%fa:cog%%i18n:mobile.tags.mk-ui-nav.settings%%fa:angle-right%</a></li> <li><a href="/i/settings">%fa:cog%%i18n:mobile.tags.mk-ui-nav.settings%%fa:angle-right%</a></li>
</ul> </ul>
</div> </div>
<a href={ _ABOUT_URL_ }><p class="about">%i18n:mobile.tags.mk-ui-nav.about%</p></a> <a href={ aboutUrl }><p class="about">%i18n:mobile.tags.mk-ui-nav.about%</p></a>
</div> </div>
<style> <style>
:scope :scope
@ -359,6 +359,8 @@
this.connection = this.stream.getConnection(); this.connection = this.stream.getConnection();
this.connectionId = this.stream.use(); this.connectionId = this.stream.use();
this.aboutUrl = `${_DOCS_URL_}/${_LANG_}/about`;
this.on('mount', () => { this.on('mount', () => {
this.connection.on('read_all_notifications', this.onReadAllNotifications); this.connection.on('read_all_notifications', this.onReadAllNotifications);
this.connection.on('read_all_messaging_messages', this.onReadAllMessagingMessages); this.connection.on('read_all_messaging_messages', this.onReadAllMessagingMessages);

View file

@ -0,0 +1,3 @@
h1 About Misskey
p Misskey is a mini blog SNS.

View file

@ -0,0 +1,3 @@
h1 Misskeyについて
p MisskeyはミニブログSNSです。

View file

@ -2,7 +2,7 @@ extends ../../layout.pug
include ../mixins include ../mixins
block meta block meta
link(rel="stylesheet" href="/assets/docs/api/endpoints/style.css") link(rel="stylesheet" href="/assets/api/endpoints/style.css")
block main block main
h1= endpoint h1= endpoint

View file

@ -2,7 +2,7 @@ extends ../../layout.pug
include ../mixins include ../mixins
block meta block meta
link(rel="stylesheet" href="/assets/docs/api/entities/style.css") link(rel="stylesheet" href="/assets/api/entities/style.css")
block main block main
h1= name h1= name

View file

@ -14,13 +14,13 @@ mixin propTable(props)
if prop.kind == 'id' if prop.kind == 'id'
if prop.entity if prop.entity
| ( | (
a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity a(href=`/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
| ID) | ID)
else else
| (ID) | (ID)
else if prop.kind == 'entity' else if prop.kind == 'entity'
| ( | (
a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity a(href=`/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
| ) | )
else if prop.kind == 'object' else if prop.kind == 'object'
if prop.def if prop.def

View file

@ -70,5 +70,5 @@ gulp.task('doc:styles', () =>
gulp.src('./src/web/docs/**/*.styl') gulp.src('./src/web/docs/**/*.styl')
.pipe(stylus()) .pipe(stylus())
.pipe((cssnano as any)()) .pipe((cssnano as any)())
.pipe(gulp.dest('./built/web/assets/docs/')) .pipe(gulp.dest('./built/web/docs/assets/'))
); );

View file

@ -6,9 +6,9 @@ html(lang= lang)
meta(name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no") meta(name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no")
title title
| #{title} | Misskey Docs | #{title} | Misskey Docs
link(rel="stylesheet" href="/assets/docs/style.css") link(rel="stylesheet" href="/assets/style.css")
block meta block meta
base(href=`/docs/${lang}/`) base(href=`/${lang}/`)
body body
nav nav

21
src/web/docs/server.ts Normal file
View file

@ -0,0 +1,21 @@
/**
* Docs Server
*/
import * as express from 'express';
/**
* Init app
*/
const app = express();
app.disable('x-powered-by');
app.use('/assets', express.static(`${__dirname}/assets`));
/**
* Routing
*/
app.get(/^\/([a-z_\-\/]+?)$/, (req, res) =>
res.sendFile(`${__dirname}/${req.params[0]}.html`));
module.exports = app;

3
src/web/docs/tou.ja.pug Normal file
View file

@ -0,0 +1,3 @@
h1 利用規約
p 公序良俗に反する行為はおやめください。

View file

@ -1,4 +0,0 @@
利用規約
================================================================
公序良俗に反する行為はおやめください。

View file

@ -10,6 +10,9 @@ import * as express from 'express';
import * as bodyParser from 'body-parser'; import * as bodyParser from 'body-parser';
import * as favicon from 'serve-favicon'; import * as favicon from 'serve-favicon';
import * as compression from 'compression'; import * as compression from 'compression';
import vhost = require('vhost');
import config from '../conf';
/** /**
* Init app * Init app
@ -17,6 +20,8 @@ import * as compression from 'compression';
const app = express(); const app = express();
app.disable('x-powered-by'); app.disable('x-powered-by');
app.use(vhost(`docs.${config.host}`, require('./docs/server')));
app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json({ app.use(bodyParser.json({
type: ['application/json', 'text/plain'] type: ['application/json', 'text/plain']
@ -63,12 +68,6 @@ app.get('/manifest.json', (req, res) =>
*/ */
app.get(/\/api:url/, require('./service/url-preview')); app.get(/\/api:url/, require('./service/url-preview'));
/**
* Docs
*/
app.get(/^\/docs\/([a-z_\-\/]+?)$/, (req, res) =>
res.sendFile(`${__dirname}/docs/${req.params[0]}.html`));
/** /**
* Routing * Routing
*/ */

View file

@ -4,7 +4,7 @@ certbot certonly --standalone\
-d $1\ -d $1\
-d api.$1\ -d api.$1\
-d auth.$1\ -d auth.$1\
-d about.$1\ -d docs.$1\
-d ch.$1\ -d ch.$1\
-d stats.$1\ -d stats.$1\
-d status.$1\ -d status.$1\

View file

@ -16,7 +16,7 @@ export default lang => {
_VERSION_: version, _VERSION_: version,
_STATUS_URL_: config.status_url, _STATUS_URL_: config.status_url,
_STATS_URL_: config.stats_url, _STATS_URL_: config.stats_url,
_ABOUT_URL_: config.about_url, _DOCS_URL_: config.docs_url,
_API_URL_: config.api_url, _API_URL_: config.api_url,
_DEV_URL_: config.dev_url, _DEV_URL_: config.dev_url,
_CH_URL_: config.ch_url, _CH_URL_: config.ch_url,