This directory contains a Gatsby project that generates the official web site for Armeria.
- The build requirements in CONTRIBUTING.md
svgbob_cli
brew install svgbob
on Mac OS X
- Download and install
node
,npm
and other dependencies as well as generating the required.json
files into thegen-src
directory.$ ../gradlew generateSiteSources
- Run Gatsby in development mode.
or
$ ../gradlew develop
$ npm run develop
- Start updating the pages in
src/pages
. All changes will be visible at http://127.0.0.1:8000/.
Note that you can also use your local npm
or node
installation,
although you'll have to run ../gradlew generateSiteSources
to generate the .json
files into the gen-src
directory at least once.
It's often useful to define a short URL such as /s/slack
when you need
to:
- Shorten a long URL
- Manage a URL that changes often
Define a short URL in gatsby-config.js
. createPages
in gatsby-node.js
will create static redirect pages for it. For example, the following
configuration will create a redirect from /s/foo
to https://bar.com/
:
module.exports = {
siteMetadata: {
shortUrls: [
{
name: 'foo',
href: 'https://bar.com/',
},
],
},
// ...
};
- Perform a clean production build.
$ ../gradlew clean site
- Upload all files in the
public
directory into thegh-pages
branch, e.g.$ cd ../../site-armeria $ rm -fr * $ mv ../../armeria/site/public/* . $ git add -A . $ git commit --amend -m 'Deploy the web site' $ git push --force
$ npx npm-check-updates --target latest
Make sure the resource or component you're adding does not increase the
bundle size too much. You can check which component or page is taking
how much space using source-map-explorer
.
- Run
source-map
task usingnpm
.$ npm run source-map
- A web browser will show a tree map. See here to learn more about how to interpret the report.
$ npm run release-note <version>
Note that you might encounter an API rate limit exceeded error from the GitHub response.
Set GITHUB_ACCESS_TOKEN
environment variable with the token that you have
issued in https://github.com/settings/tokens to get a higher rate limit.