Skip to content

Commit

Permalink
feat: add version changelog to project site
Browse files Browse the repository at this point in the history
  • Loading branch information
bndynet committed Apr 21, 2019
1 parent b914f52 commit ee6fd55
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2 deletions.
Empty file added CHANGELOG.md
Empty file.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<div id="sub-navs" class="list-group">
<a class="list-group-item list-group-item-action" href="#readme">Read me</a>
<a class="list-group-item list-group-item-action" href="#example">Example</a>
<a class="list-group-item list-group-item-action" href="#changelog">Changelog</a>
</div>
</aside>

Expand Down Expand Up @@ -94,6 +95,13 @@ <h1 class="display-4">Hello, world!</h1>
<h1>Example</h1>
<p>TODO...</p>
</section>

<section id="changelog">
<h1>Changelog</h1>
<div id="changelog-body" class="markdown-body">
<em>Generated by CI automatically.</em>
</div>
</section>
</main>
<script type="text/javascript" src="./script.js"></script>
</body>
Expand Down
5 changes: 5 additions & 0 deletions site/script.js
Original file line number Diff line number Diff line change
@@ -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);
});
11 changes: 11 additions & 0 deletions site/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions tools/gh-pages-prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit ee6fd55

Please sign in to comment.