Skip to content

Commit

Permalink
🎉 feat: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshKapadia2 committed Dec 24, 2021
0 parents commit 3b1ce2d
Show file tree
Hide file tree
Showing 31 changed files with 1,069 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build-deploy-website.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and deploy website

on:
push:
branches:
- main
paths:
- ".github/workflows/**"
- "src/**"
- build.sh
pull_request:
branches:
- main
paths:
- ".github/workflows/**"
- "src/**"
- build.sh
workflow_dispatch: # Allows manual execution of workflow

jobs:
build-website:
if: startsWith(github.ref, 'refs/pull/')
runs-on: ubuntu-latest
container: "docker://asciidoctor/docker-asciidoctor:latest"
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build site using Asciidoctor
run: |
# Give execution permission to buildscript
chmod +x build.sh
# Run buildscript
./build.sh
build-deploy-website:
if: startsWith(github.ref, 'refs/heads/')
runs-on: ubuntu-latest
container: "docker://asciidoctor/docker-asciidoctor:latest"
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build site using Asciidoctor
run: |
# Give execution permission to buildscript
chmod +x build.sh
# Run buildscript
./build.sh
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
27 changes: 27 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"cursorOffset": -1,
"embeddedLanguageFormatting": "auto",
"endOfLine": "auto",
"filepath": "",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"overrides": [],
"plugins": [],
"pluginSearchDirs": [],
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"rangeEnd": null,
"rangeStart": 0,
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "none",
"useTabs": true,
"vueIndentScriptAndStyle": false
}
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] - 2021-12-25

### Added

- `index.adoc` and other `.adoc` files for the website content.
- A buildscript to build the Asciidoctor site.
- A service worker, webmanifest and icons to convert the site to a PWA.
- A 'back to top' button.
- A theme switcher.
- A `robots.txt` file.
- Images for the demo site.
- A GitHub Actions workflow to build the site (for PRs) and to build and deploy the site to GitHub Pages (on merges and pushes).
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Contributing to _Asciidoctor Jet_

- Please check the [issues tab](https://github.com/HarshKapadia2/asciidoctor-jet/issues) for things to work on.
- Please [raise an issue](https://github.com/HarshKapadia2/asciidoctor-jet/issues) to request a feature/modification or for reporting a bug, if it has not already been raised.

## Tech Stack

- Front end: Asciidoctor, HTML, CSS, JS
- CI/CD: GitHub Actions

## Local Setup

- Fork this repo. (Top right corner.)
- Clone the forked repo using the [`git clone` command](https://harshkapadia2.github.io/git_basics/#_git_clone).
- `cd` into the cloned repo directory.
- Install [Asciidoctor](https://asciidoctor.org/#installation).
- Run the command `sh build.sh` in the root directory of the project to build the site to the `build` directory.
- [Serve the built site locally](https://harshkapadia2.github.io/asciidoctor-jet/#_serving_the_site_locally) to check if all is good.
- Write meaningful commit messages and include the number (#) of the issue being resolved (if any) at the end of the commit message.

Example: `:bug: fix: Resolve 'isCorrect' function error (#0)`

[Commit message format](https://harshkapadia2.github.io/git_basics/#_commit_messagetitle)

- Open a Pull Request (PR).
- [Learn how to open a PR.](https://github.com/firstcontributions/first-contributions)
- Solve one issue per PR, without any extra changes.
- Include extra changes in a separate PR.

## Further Help

If any further help is needed, do not hesitate to contact the author ([Harsh Kapadia](https://harshkapadia.me)) via Twitter [@harshgkapadia](https://twitter.com/harshgkapadia), [LinkedIn](https://www.linkedin.com/in/harshgkapadia) or e-mail ([[email protected]](mailto:[email protected])). An [issue](https://github.com/HarshKapadia2/asciidoctor-jet/issues) can be raised as well.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Harsh Kapadia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# _Asciidoctor Jet_

A ready-to-use jet black themed template for building static websites using [Asciidoctor](https://asciidoctor.org) with [features and fonts added](https://harshkapadia2.github.io/asciidoctor-jet/#_features) to the default Asciidoctor template.

[**Live demo and more details.**](https://harshkapadia2.github.io/asciidoctor-jet)

[Getting started](https://harshkapadia2.github.io/asciidoctor-jet/#_getting_started) is very straightforward!

## Changelogs

The changelog has been maintained in the [`CHANGELOG.md` file](CHANGELOG.md).

## Contributing

- Contributors are welcome!
- Please read the [`CONTRIBUTING.md` file](CONTRIBUTING.md) for contributing guidelines and the local setup guide.

## Code of Conduct

Please be mindful of the [Code of Conduct](CODE_OF_CONDUCT.md) while contributing and interacting.
29 changes: 29 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

set -eu;

script_dir=$(dirname "${0}");

# Create the 'build' directory if it doesn't exist
mkdir -p "${script_dir}/build";

# Remove all files from the 'build' directory to prevent residual files
rm -rf "${script_dir}/build/"*;

# Copy files to the 'build' directory
for path in \
"static" \
"manifest.webmanifest" \
"robots.txt" \
"service-worker.js" \
; do
cp -r "${script_dir}/src/${path}" "${script_dir}/build";
done;

# Build site
asciidoctor "${script_dir}/src/index.adoc" -a webfonts! -o "${script_dir}/build/index.html";

# Lazy load images
sed -i -e 's/<img/<img loading="lazy"/g' "${script_dir}/build/index.html";

echo "Asciidoctor Jet static site build complete.";
8 changes: 8 additions & 0 deletions src/content/adding-content.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* link:https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference[Asciidoctor syntax^] is supported.
* The `index.adoc` file is the entry point for Asciidoctor.
* Create a file in the `content` directory and include it in `index.adoc` using the `include::path/to/file.adoc[]` link:https://docs.asciidoctor.org/asciidoc/latest/directives/include[include directive^].
** Feel free to customize the project structure as per needs, but make sure to make corresponding changes to the link:https://github.com/HarshKapadia2/asciidoctor-jet/blob/main/.github/workflows/build-website.yaml[`.github/workflows/build-website.yaml` file^] in the repository, so that GitHub Actions is able to build and deploy the website properly.
* Images can be added using the link:https://docs.asciidoctor.org/asciidoc/latest/macros/images[image macro^].
** Example:
image::icon-192.png[]
9 changes: 9 additions & 0 deletions src/docinfo-footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div id="footer">
Created using
<a
href="https://github.com/HarshKapadia2/asciidoctor-jet"
target="_blank"
rel="noreferrer"
><i>Asciidoctor Jet</i></a
>.
</div>
39 changes: 39 additions & 0 deletions src/docinfo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<meta
name="keywords"
content="asciidoctor, template, pitch black, jet black, black, adoc, dark mode"
/>
<meta name="description" content="A jet black Asciidoctor template." />
<meta name="theme-color" content="#000000" />
<meta property="og:site_name" content="Asciidoctor Jet" />
<meta property="og:title" content="Asciidoctor Jet" />
<meta property="og:type" content="website" />
<meta property="og:description" content="A jet black Asciidoctor template." />
<meta
property="og:url"
content="https://harshkapadia2.github.io/asciidoctor-jet"
/>
<meta
property="og:image"
content="https://harshkapadia2.github.io/asciidoctor-jet/static/img/icon-512.png"
/>
<meta property="og:image:width" content="512" />
<meta property="og:image:height" content="512" />
<meta
property="twitter:image"
content="https://harshkapadia2.github.io/asciidoctor-jet/static/img/icon-512.png"
/>

<script defer src="static/js/script.js"></script>

<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=PT+Mono&family=Montserrat&display=swap"
rel="stylesheet"
/>

<link rel="stylesheet" href="static/css/style.css" />

<link rel="apple-touch-icon" href="static/img/icon-192.png" />

<link rel="manifest" href="manifest.webmanifest" />
Loading

0 comments on commit 3b1ce2d

Please sign in to comment.