From be1125dcb92d8c6e972e00ac4697e136d0fec2bd Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 15 Dec 2018 23:19:04 +0900 Subject: OGP向けにインスタンスのバナー画像を提供するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.ts | 52 +--------------------- package.json | 3 -- src/client/app/base.pug | 45 ------------------- .../app/common/views/components/analog-clock.vue | 4 +- src/client/app/config.ts | 1 - src/const.json | 4 +- src/server/web/index.ts | 12 ++--- src/server/web/views/base.pug | 44 ++++++++++++++++++ src/server/web/views/note.pug | 8 ++-- src/server/web/views/user.pug | 10 +++-- webpack.config.ts | 1 - 11 files changed, 65 insertions(+), 119 deletions(-) delete mode 100644 src/client/app/base.pug create mode 100644 src/server/web/views/base.pug diff --git a/gulpfile.ts b/gulpfile.ts index 7aa582abf9..08175914a1 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -11,14 +11,12 @@ import tslint from 'gulp-tslint'; const cssnano = require('gulp-cssnano'); const stylus = require('gulp-stylus'); import * as uglifyComposer from 'gulp-uglify/composer'; -import pug = require('gulp-pug'); import * as rimraf from 'rimraf'; import chalk from 'chalk'; const imagemin = require('gulp-imagemin'); import * as rename from 'gulp-rename'; import * as mocha from 'gulp-mocha'; import * as replace from 'gulp-replace'; -import * as htmlmin from 'gulp-htmlmin'; const uglifyes = require('uglify-es'); const locales = require('./locales'); @@ -34,8 +32,6 @@ if (isDebug) { console.warn(chalk.yellow.bold(' built script will not be compressed.')); } -const constants = require('./src/const.json'); - gulp.task('build', [ 'build:ts', 'build:copy', @@ -109,7 +105,7 @@ gulp.task('default', ['build']); gulp.task('build:client', [ 'build:ts', 'build:client:script', - 'build:client:pug', + 'build:client:styles', 'copy:client' ]); @@ -148,52 +144,6 @@ gulp.task('copy:client', [ .pipe(gulp.dest('./built/client/assets/')) ); -gulp.task('build:client:pug', [ - 'copy:client', - 'build:client:script', - 'build:client:styles' -], () => - gulp.src('./src/client/app/base.pug') - .pipe(pug({ - locals: { - themeColor: constants.themeColor - } - })) - .pipe(htmlmin({ - // 真理値属性の簡略化 e.g. - // to - // - collapseBooleanAttributes: true, - - // テキストの一部かもしれない空白も削除する e.g. - //

foo

to - //

foo

- collapseWhitespace: true, - - // タグ間の改行を保持する - preserveLineBreaks: true, - - // (できる場合は)属性のクォーテーション削除する e.g. - //

foo

to - //

foo

- removeAttributeQuotes: true, - - // 省略可能なタグを省略する e.g. - //

yo

ro - //

yo

- removeOptionalTags: true, - - // 属性の値がデフォルトと同じなら省略する e.g. - // to - // - removeRedundantAttributes: true, - - // CSSも圧縮する - minifyCSS: true - })) - .pipe(gulp.dest('./built/client/app/')) -); - gulp.task('locales', () => gulp.src('./locales/*.yml') .pipe(yaml({ schema: 'DEFAULT_SAFE_SCHEMA' })) diff --git a/package.json b/package.json index 8ea7773def..e88fe20323 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@types/elasticsearch": "5.0.29", "@types/file-type": "5.2.2", "@types/gulp": "3.8.36", - "@types/gulp-htmlmin": "1.3.32", "@types/gulp-mocha": "0.0.32", "@types/gulp-rename": "0.0.33", "@types/gulp-replace": "0.0.31", @@ -120,10 +119,8 @@ "fuckadblock": "3.2.1", "gulp": "3.9.1", "gulp-cssnano": "2.1.3", - "gulp-htmlmin": "5.0.1", "gulp-imagemin": "4.1.0", "gulp-mocha": "6.0.0", - "gulp-pug": "4.0.1", "gulp-rename": "1.4.0", "gulp-replace": "1.0.0", "gulp-sourcemaps": "2.6.4", diff --git a/src/client/app/base.pug b/src/client/app/base.pug deleted file mode 100644 index ee9d4b6f6d..0000000000 --- a/src/client/app/base.pug +++ /dev/null @@ -1,45 +0,0 @@ -block vars - -doctype html - -!= '\n\n' - -html - - head - meta(charset='utf-8') - meta(name='application-name' content='Misskey') - meta(name='theme-color' content=themeColor) - meta(name='referrer' content='origin') - meta(property='og:site_name' content='Misskey') - link(rel='manifest' href='/manifest.json') - - title - block title - | Misskey - - block desc - meta(name='description' content='A planet of fediverse') - - block meta - - style - include ./../../../built/client/assets/init.css - script - include ./../../../built/client/assets/boot.js - - script - include ./../../../built/client/assets/safe.js - - //- FontAwesome style - style #{facss} - - body - noscript: p - | JavaScriptを有効にしてください - br - | Please turn on your JavaScript - div#ini. - - - diff --git a/src/client/app/common/views/components/analog-clock.vue b/src/client/app/common/views/components/analog-clock.vue index 43ae2ca933..8795076bb3 100644 --- a/src/client/app/common/views/components/analog-clock.vue +++ b/src/client/app/common/views/components/analog-clock.vue @@ -32,7 +32,7 @@