From ee6fd55f1e76175752bcaf8206d6e84f85f87e7f Mon Sep 17 00:00:00 2001 From: Bendy Zhang Date: Sun, 21 Apr 2019 23:17:21 +0800 Subject: [PATCH] feat: add version changelog to project site --- CHANGELOG.md | 0 README.md | 4 ++-- site/index.html | 8 ++++++++ site/script.js | 5 +++++ site/style.css | 11 +++++++++++ tools/gh-pages-prepare.ts | 1 + 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 127a5e9..e4aa7a2 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ This starter project will standardize coding and publishing for your library, an - :school_satchel: Include all packages for coding, linting, testing and building - :art: Compile sass to css using node-sass, autoprefixer and postcss - :inbox_tray: Build library to UMD and CommonJS modules -- :blue_book: Generate documentation of your TypeScript files automatically +- :blue_book: Generate API documentation of your TypeScript files automatically - :heavy_check_mark: Check your commit message when `git commit ...` - :cl: Default CI scripts for [Travis CI](https://travis-ci.com/) includes release and publish automatically -- :running: Script for publishing documentation to your gh-pages branch by CI - :bookmark: Generate CHANGELOG.md according to your commits in CI publishing process - :book: Publish your unit tests report to [coveralls.io](https://coveralls.io/) by CI +- :earth_asia: Publish API documentation, converage, demo and changelog to your gh-pages branch as your project site by CI - :package: Release to NPM automatically by CI ## Start your library diff --git a/site/index.html b/site/index.html index a1e1b4b..0e39a7c 100644 --- a/site/index.html +++ b/site/index.html @@ -65,6 +65,7 @@ @@ -94,6 +95,13 @@

Hello, world!

Example

TODO...

+ +
+

Changelog

+
+ Generated by CI automatically. +
+
diff --git a/site/script.js b/site/script.js index 5d89aa6..1a1aaa0 100644 --- a/site/script.js +++ b/site/script.js @@ -1,4 +1,9 @@ axios.get("../README.md").then(function(response) { var converter = new showdown.Converter(); document.getElementById("readme").innerHTML = converter.makeHtml(response.data); +}); + +axios.get("../CHANGELOG.md").then(function(response) { + var converter = new showdown.Converter(); + document.getElementById("changelog-body").innerHTML = converter.makeHtml(response.data); }); \ No newline at end of file diff --git a/site/style.css b/site/style.css index d8be477..a66d8c9 100644 --- a/site/style.css +++ b/site/style.css @@ -18,9 +18,20 @@ main section { padding-top: 15px; margin-bottom: 20px; } +main section h1 { + margin-bottom: 1rem; +} + .forkme { position: fixed; right: 0; top: 0; z-index: 9999; +} + +#changelog-body h1 { + margin-bottom: 0; +} +#changelog-body h3 { + margin: 0.5rem 0; } \ No newline at end of file diff --git a/tools/gh-pages-prepare.ts b/tools/gh-pages-prepare.ts index e58f469..908a614 100644 --- a/tools/gh-pages-prepare.ts +++ b/tools/gh-pages-prepare.ts @@ -5,6 +5,7 @@ sh.echo("⚑ gh-pages preparing..."); sh.mkdir("-p", "./docs"); sh.cp("README.md", "./docs/README.md"); +sh.cp("CHANGELOG.md", "./docs/CHANGELOG.md"); sh.rm("-rf", "./docs/coverage-report"); sh.cp("-R", "./coverage/lcov-report", "./docs/coverage-report");