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

@ -101,7 +101,7 @@ type Mixin = {
secondary_scheme: string;
api_url: string;
auth_url: string;
about_url: string;
docs_url: string;
ch_url: string;
stats_url: string;
status_url: string;
@ -131,7 +131,7 @@ export default function load() {
mixin.auth_url = `${mixin.scheme}://auth.${mixin.host}`;
mixin.ch_url = `${mixin.scheme}://ch.${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.status_url = `${mixin.scheme}://status.${mixin.host}`;
mixin.drive_url = `${mixin.secondary_scheme}://file.${mixin.secondary_host}`;

View File

@ -3,7 +3,7 @@
<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>無料で誰でも利用でき、広告も掲載していません。</p>
<p><a href={ _ABOUT_URL_ } target="_blank">もっと知りたい方はこちら</a></p>
<p><a href={ _DOCS_URL_ } target="_blank">もっと知りたい方はこちら</a></p>
</article>
<style>
:scope

View File

@ -1,7 +1,10 @@
<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>
:scope
display inline
</style>
<script>
this.aboutUrl = `${_DOCS_URL_}/${_LANG_}/about`;
</script>
</mk-nav-links>

View File

@ -34,7 +34,7 @@
</label>
<label class="agree-tou">
<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>
<button onclick={ onsubmit }>%i18n:common.tags.mk-signup.create%</button>
</form>
@ -182,6 +182,8 @@
this.passwordRetypeState = null;
this.recaptchaed = false;
this.aboutUrl = `${_DOCS_URL_}/${_LANG_}/tou`;
window.onRecaptchaed = () => {
this.recaptchaed = true;
this.update();

View File

@ -1,5 +1,5 @@
<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>
<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-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">
<h1><img if={ user } src={ user.avatar_url + '?thumbnail&size=32' }/>
<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>
</ul>
</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>
<style>
:scope
@ -359,6 +359,8 @@
this.connection = this.stream.getConnection();
this.connectionId = this.stream.use();
this.aboutUrl = `${_DOCS_URL_}/${_LANG_}/about`;
this.on('mount', () => {
this.connection.on('read_all_notifications', this.onReadAllNotifications);
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
block meta
link(rel="stylesheet" href="/assets/docs/api/endpoints/style.css")
link(rel="stylesheet" href="/assets/api/endpoints/style.css")
block main
h1= endpoint

View File

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

View File

@ -14,13 +14,13 @@ mixin propTable(props)
if prop.kind == 'id'
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)
else
| (ID)
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'
if prop.def

View File

@ -70,5 +70,5 @@ gulp.task('doc:styles', () =>
gulp.src('./src/web/docs/**/*.styl')
.pipe(stylus())
.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")
title
| #{title} | Misskey Docs
link(rel="stylesheet" href="/assets/docs/style.css")
link(rel="stylesheet" href="/assets/style.css")
block meta
base(href=`/docs/${lang}/`)
base(href=`/${lang}/`)
body
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 favicon from 'serve-favicon';
import * as compression from 'compression';
import vhost = require('vhost');
import config from '../conf';
/**
* Init app
@ -17,6 +20,8 @@ import * as compression from 'compression';
const app = express();
app.disable('x-powered-by');
app.use(vhost(`docs.${config.host}`, require('./docs/server')));
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json({
type: ['application/json', 'text/plain']
@ -63,12 +68,6 @@ app.get('/manifest.json', (req, res) =>
*/
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
*/