Doc website and landing page

This commit is contained in:
Joseph Garrone 2020-05-17 20:02:43 +02:00
parent c787a145e3
commit 3847308086
4 changed files with 60 additions and 16 deletions

View file

@ -38,7 +38,7 @@ jobs:
- name: Get version on branch 'latest' - name: Get version on branch 'latest'
id: v_latest id: v_latest
uses: garronej/github_actions_toolkit@master uses: garronej/github_actions_toolkit@v1
with: with:
action_name: get_package_json_version action_name: get_package_json_version
owner: ${{github.repository_owner}} owner: ${{github.repository_owner}}
@ -49,7 +49,7 @@ jobs:
- name: Get version on master - name: Get version on master
id: v_master id: v_master
uses: garronej/github_actions_toolkit@master uses: garronej/github_actions_toolkit@v1
with: with:
action_name: get_package_json_version action_name: get_package_json_version
owner: ${{github.repository_owner}} owner: ${{github.repository_owner}}
@ -59,7 +59,7 @@ jobs:
- name: 'Trigger the ''publish'' workflow if newer version' - name: 'Trigger the ''publish'' workflow if newer version'
if: ${{ !!env.PAT && steps.v_master.outputs.compare_result == '1' }} if: ${{ !!env.PAT && steps.v_master.outputs.compare_result == '1' }}
uses: garronej/github_actions_toolkit@master uses: garronej/github_actions_toolkit@v1
env: env:
GITHUB_TOKEN: ${{ secrets.PAT }} GITHUB_TOKEN: ${{ secrets.PAT }}
with: with:

View file

@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Synchronize package.json and package-lock.json version if needed. - name: Synchronize package.json and package-lock.json version if needed.
uses: garronej/github_actions_toolkit@master uses: garronej/github_actions_toolkit@v1
env: env:
GITHUB_TOKEN: ${{ secrets.PAT }} GITHUB_TOKEN: ${{ secrets.PAT }}
with: with:
@ -19,7 +19,7 @@ jobs:
commit_author_email: ts_ci@github.com commit_author_email: ts_ci@github.com
- name: Update CHANGELOG.md - name: Update CHANGELOG.md
if: ${{ !!github.event.client_payload.from_version }} if: ${{ !!github.event.client_payload.from_version }}
uses: garronej/github_actions_toolkit@master uses: garronej/github_actions_toolkit@v1
env: env:
GITHUB_TOKEN: ${{ secrets.PAT }} GITHUB_TOKEN: ${{ secrets.PAT }}
with: with:

View file

@ -7,7 +7,7 @@ jobs:
- name: Checking availability for module name ${{github.event.repository.name}} on NPM. - name: Checking availability for module name ${{github.event.repository.name}} on NPM.
id: id1 id: id1
uses: garronej/github_actions_toolkit@master uses: garronej/github_actions_toolkit@v1
with: with:
action_name: is_well_formed_and_available_module_name action_name: is_well_formed_and_available_module_name
module_name: ${{github.event.repository.name}} module_name: ${{github.event.repository.name}}
@ -32,7 +32,7 @@ jobs:
- run: mv LICENSE.template LICENSE - run: mv LICENSE.template LICENSE
- name : String replace - name : String replace
id: id2 id: id2
uses: garronej/github_actions_toolkit@master uses: garronej/github_actions_toolkit@v1
with: with:
action_name: string_replace action_name: string_replace
input_string: ${{github.event.repository.name}} input_string: ${{github.event.repository.name}}

View file

@ -9,7 +9,6 @@
--- ---
**NOTE**: You probably want to "Use this template" ( the green button ) instead of forking the repo.
# Presentation # Presentation
@ -17,7 +16,7 @@ This template automates the boring and tedious tasks of:
- Filling up the ``package.json`` - Filling up the ``package.json``
- Setting up Typescript. - Setting up Typescript.
- Writing a [README.md](https://github.com/garronej/denoify_ci/blob/dev/README.template.md) with decent presentation and instructions on how to install/import your module. - Writing a [README.md](https://github.com/garronej/denoify_ci/blob/dev/README.template.md) with decent presentation and instructions on how to install/import your module.
- Testing on multiple N``ode`` version before publishing. - Testing on multiple Node version before publishing.
- Maintaining a CHANGELOG. - Maintaining a CHANGELOG.
- Publishing on NPM and creating corresponding GitHub releases. - Publishing on NPM and creating corresponding GitHub releases.
@ -29,6 +28,14 @@ Besides, good stuff that comes with using this template:
- CDN distribution for importing from an ``.html`` file with a ``<script>`` tag. - CDN distribution for importing from an ``.html`` file with a ``<script>`` tag.
- A branch ``latest`` always in sync with the latest release. - A branch ``latest`` always in sync with the latest release.
# Important notices
- You probably want to "Use this template" ( the green button ) instead of forking the repo.
- The files to include in the NPM bundle are cherry-picked using the ``package.json`` ``files`` field.
If you don't want to bother and includes everything just remove the ``files`` field from the ``package.json``
otherwise remember, when you add a subdirectory in ``src/``, to update the ``package.json`` ``files``.
- If you are going to programmatically load files outside of the ``dis/`` directory ( like the ``package.json`` or files inside ``res/`` ) be mindful that the paths might not be the one you expect. [Details](#accessing-files-outside-the-dist-directory).
# How to use # How to use
## Fork it ( click use the template ) ## Fork it ( click use the template )
@ -41,9 +48,9 @@ Besides, good stuff that comes with using this template:
Once you've done that a GitHub action workflow will set up the ``README.md`` and the ``package.json`` for you, wait a couple of minutes for it to complete ( a bot will push ). You can follow the job advancement in the "Action" tab. Once you've done that a GitHub action workflow will set up the ``README.md`` and the ``package.json`` for you, wait a couple of minutes for it to complete ( a bot will push ). You can follow the job advancement in the "Action" tab.
Each time you will push changes ``npm test`` will be run on remote docker containers against multiple node versions if everything passes you will get a green ``ci`` badges on your readme. Each time you will push changes ``npm test`` will be run on remote docker containers against multiple node versions if everything passes you will get a green ``ci`` badges in your readme.
## Enable automatic publishing. ## Enable automatic publishing
Once you are ready to make your package available on NPM you Once you are ready to make your package available on NPM you
will need to provide two tokens so that the workflow can publish on your behalf: will need to provide two tokens so that the workflow can publish on your behalf:
@ -66,7 +73,7 @@ but don't forget to update your ``package.json`` ``main``, ``type`` and ``files`
A good way to host your repo image is to open an issue named ASSET in your project, close it, create a comment, drag and drop the picture you want to use and that's it. You have a link that you can replace in the ``README.md``. A good way to host your repo image is to open an issue named ASSET in your project, close it, create a comment, drag and drop the picture you want to use and that's it. You have a link that you can replace in the ``README.md``.
While you are at it submit this image as *social preview* in your repos github page's settings so that when you share on While you are at it submit this image as *social preview* in your repos github page's settings so that when you share on
Twitter or Reddit you don't get your GitHub profile picture to shows up. Twitter or Reddit you don't get your GitHub profile picture to show up.
## Disable CDN build ## Disable CDN build
@ -77,7 +84,7 @@ If your project does not target the browser or if you are not interested in offe
- Remove ``/dist/esm/`` entry from ``files`` in ``package.json`` - Remove ``/dist/esm/`` entry from ``files`` in ``package.json``
- Remove ``simplifyify`` and ``terser`` from dev dependencies. - Remove ``simplifyify`` and ``terser`` from dev dependencies.
## Remove unwanted dev dependencies. ## Remove unwanted dev dependencies
Dev dependencies that are not required by the template ( you can safely remove them if you don't use them ): Dev dependencies that are not required by the template ( you can safely remove them if you don't use them ):
@ -93,9 +100,46 @@ Must keep:
## Customizing the Badges ## Customizing the Badges
You can [shields.io](https://shields.io) to create badges on metrics you would like to showcase. You can use [shields.io](https://shields.io) to create badges on metrics you would like to showcase.
# WARNINGS: # Creating a documentation website for your project:
I recommend [GitBook](https://www.gitbook.com), It enables you to write your documentation in markdown from their
website and get the markdown files synchronized with in your repo.
They will provide you with a nice website for which you can customize the domain name.
All this is covered by their free tier.
Example:
- [repo](https://github.com/garronej/evt)
- [GitBook documentation website](https://docs.evt.land)
I advise you to have a special directory at the root of your project where the markdown documentation files
are stored. It is configured by placing a ``.netbook.yaml`` file at the root of the repo containing, for example:
``root: ./docs/``
PS: I am not affiliated with GitBook in any way.
# Creating a landing page for your project.
Beside the documentation website, you might want to have a catchy landing page to share on social networks.
You can use [GitHub pages](https://pages.github.com) to host it.
If you like the landing page of EVT, [evt.land](http://evt.land), you can fork the [repo](https://github.com/garronej/evt.land) and adapt it for your module.
You'll just have to go to settings and enable Pages.
![image](https://user-images.githubusercontent.com/6702424/82155402-0aeb2680-9875-11ea-9159-f6167ee2928e.png)
And update your DNS:
![image](https://user-images.githubusercontent.com/6702424/82155473-7e8d3380-9875-11ea-9bba-115cbb3ef162.png)
I personally use [Hurricane Electric](https://dns.he.net) free DNS servers because they support a lot of record types.
If your provider does not support ``ALIAS``, however, you can use ``A`` records and manually enter the IP of GitHub servers.
I let you consult the [GitHub Pages Documentation](https://help.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site#configuring-an-apex-domain).
# Accessing files outside the ``dist/`` directory
- The template does not support ``.npmignore`` use ``package.json`` ``files`` instead. - The template does not support ``.npmignore`` use ``package.json`` ``files`` instead.
- The template does not support ``.npmrc`` - The template does not support ``.npmrc``