From e2425b5c6dfafd43ba6b72d9475257162990b6c5 Mon Sep 17 00:00:00 2001 From: bigeagle Date: Sat, 10 Oct 2015 17:40:29 +0800 Subject: [PATCH] added news --- gulpfile.js | 7 ++++--- src/index.tpl.html | 16 ++++++++-------- src/js/news.js | 13 +++++++++++++ src/news/index.tpl.html | 36 ++++++++++++++++++++++++++++++++++++ src/news/news.md | 32 ++++++++++++++++++++++++++++++++ src/scss/style.scss | 5 +++++ 6 files changed, 98 insertions(+), 11 deletions(-) create mode 100644 src/js/news.js create mode 100644 src/news/index.tpl.html create mode 100644 src/news/news.md diff --git a/gulpfile.js b/gulpfile.js index 06ed2fe..7965458 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,7 +7,7 @@ var gulp = require('gulp'), var path = { HTML_TPL: './src/**/*.tpl.html', HTML: './src/**/*.html', - HELP_MD: './src/help/*.md', + MD_FILES: './src/**/*.md', JS_FILES: './src/js/*.js', SCSS_FILES: './src/scss/*.scss', IMG: './src/img/*', @@ -33,8 +33,8 @@ gulp.task('copy-img', function(){ gulp.task('copy-html', function(){ gulp.src(path.ROBOTS) .pipe(gulp.dest(path.DEST)); - gulp.src(path.HELP_MD) - .pipe(gulp.dest(path.DEST+"/help")); + gulp.src(path.MD_FILES) + .pipe(gulp.dest(path.DEST)); gulp.src(path.HTML_TPL) .pipe(fileinclude()) @@ -49,6 +49,7 @@ gulp.task('copy-html', function(){ gulp.task('watch', function() { gulp.watch(path.HTML, ['copy-html']); + gulp.watch(path.MD_FILES, ['copy-html']); gulp.watch(path.IMG, ['copy-img']); gulp.watch(path.SCSS_FILES, ['scss-build']); gulp.watch(path.JS_FILES, ['js-build']); diff --git a/src/index.tpl.html b/src/index.tpl.html index 2e2478b..6a05bf7 100644 --- a/src/index.tpl.html +++ b/src/index.tpl.html @@ -37,18 +37,18 @@
-
-

新闻公告

+
+

新闻公告

- more + more

域名选择

    -
  • http://mirrors.tuna.tsinghua.edu.cn/ 支持 IPv4/IPv6
  • +
  • http://mirrors.tuna.tsinghua.edu.cn/ 自动选择
  • http://mirrors.6.tuna.tsinghua.edu.cn/ 只解析 IPv6
  • http://mirrors.4.tuna.tsinghua.edu.cn/ 只解析 IPv4
  • http://mirrors.i.tuna.tsinghua.edu.cn/ 只解析清华 IP
  • @@ -79,8 +79,8 @@ {{if is_new}}new{{/if}} {{if help}}{{/if}} - {{last_update}} - {{if show_status}}{{/if}} + + {{last_update}} {{if show_status}}{{/if}} {{/mirrors}} diff --git a/src/js/news.js b/src/js/news.js new file mode 100644 index 0000000..757cd4b --- /dev/null +++ b/src/js/news.js @@ -0,0 +1,13 @@ +$(document).ready(() => { + + $.get("/news/news.md", function(data) { + var rendered = marked(data); + $("#news-content") + .html(rendered) + .find('table') + .addClass("table table-bordered table-striped"); + $('#spinner').addClass('hidden'); + }); + +}); +// vim: ts=2 sts=2 sw=2 noexpandtab diff --git a/src/news/index.tpl.html b/src/news/index.tpl.html new file mode 100644 index 0000000..f047b58 --- /dev/null +++ b/src/news/index.tpl.html @@ -0,0 +1,36 @@ + + + @@include('../include/_head.html') + + @@include('../include/_nav.html') + +
    +
    +
    +
    +
    +
    +
    + +
    载入中
    +
    +
    +

    镜像站新闻

    +
    +
    +
    +
    +
    +
    +
    +
    + + @@include('../include/_footer.html') + + + + + + diff --git a/src/news/news.md b/src/news/news.md new file mode 100644 index 0000000..f8663f2 --- /dev/null +++ b/src/news/news.md @@ -0,0 +1,32 @@ +### # Docker APT/YUM 镜像更新 + 2015-10-10 + +Docker 官方部署了[新的 docker 源](https://blog.docker.com/2015/07/new-apt-and-yum-repos/), 我们也对 +docker 镜像作出相应调整。 + +现在的镜像地址为: + +- APT: http://mirrors.tuna.tsinghua.edu.cn/docker/apt/repo +- YUM: http://mirrors.tuna.tsinghua.edu.cn/docker/yum/repo + +请根据 [docker镜像帮助](/help/#docker) 调整至正确的打开方式。 + +---- + +### # AOSP 镜像调整 + 2015-10-09 + +国庆长假后,AOSP镜像业务量激增,造成 mirrors 服务器严重超载。 + +我们尝试了如下策略降低服务器负载: + +- 将服务更改为对 https://android.googlesource.com/ 的反向代理,但一段时间后即被 Google 做了流量限制 +- 更新 Git 版本,使用 Git 2.0+ 引入的 Bitmap 索引对所有仓库进行了一次 repack + +经过接近两天的折腾,Bitmap 索引显著降低了服务器负载,在 10 月 10 日 AOSP 占满服务器带宽的情况下,Git 服务 +的CPU和内存占用率都在合理范围内。 + +目前 AOSP 镜像业务已完全恢复。 + +我们顺便完善了 AOSP 镜像的文档,如果你是团队用户,我们强烈建议你通过 TUNA 镜像建立次级镜像,减小 TUNA mirrors +负载。详情请参考 [AOSP 镜像帮助](/help/#AOSP)。 diff --git a/src/scss/style.scss b/src/scss/style.scss index c6a662a..3ecf295 100644 --- a/src/scss/style.scss +++ b/src/scss/style.scss @@ -86,6 +86,11 @@ $font_default: 'Lato', 'Heiti SC', 'Hiragino Sans GB', 'STHeiti', 'Source Han Sa color: #234961; } } + #news { + li > a { + color: #384452 + } + } } #help-page {