Skip to content

Commit dc8e2e3

Browse files
committed
Initial commit
Signed-off-by: Kolja Nolte <kolja.nolte@gmail.com>
1 parent 83d4e59 commit dc8e2e3

28 files changed

+1461
-66
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
.idea/

README.md

Lines changed: 146 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,173 @@
11
# Modern HTML Error Docs
22

3+
![License](https://img.shields.io/badge/License-MIT-yellow.svg) ![GitHub Stars](https://img.shields.io/github/stars/thaikolja/html-error-docs.svg?style=flat) ![GitHub Forks](https://img.shields.io/github/forks/YOUR_USERNAME/YOUR_REPOSITORY.svg?style=flat)
34

5+
A collection of modern, responsive, and brandable HTML error pages (e.g., 404, 500) designed to turn frustrating moments into memorable, on-brand experiences—with optional doses (customizable) of sarcasm, irony, and humor. Built for teams that want simple customization and a clean structure for deploying custom error docs across their web servers.
46

5-
## Getting started
7+
**Example for the error code 503:**
68

7-
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
9+
![screenshot](https://p.ipic.vip/k018xl.jpg)
810

9-
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
11+
## Features
1012

11-
## Add your files
13+
- ⚡️ **Responsive Design:** Optimized for various screen sizes, from mobile devices to large desktops.
14+
- 📦 **Single Source of Truth:** All error docs are managed in a central `messages.json` file for easy updates.
15+
- 🛟 **Fallback Mechanism:** Content is displayed even if JavaScript is disabled in the browser.
16+
- 🧹 **Organized Structure:** Clear separation of CSS, JavaScript, and image assets.
17+
- ⚒️ **Customizable:** Easily modify docs, styling, and robot images to match your brand.
1218

13-
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14-
- [ ] [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
19+
## Getting Started
1520

16-
```
17-
cd existing_repo
18-
git remote add origin https://gitlab.com/thaikolja/modern-html-error-docs.git
19-
git branch -M main
20-
git push -uf origin main
21-
```
22-
23-
## Integrate with your tools
24-
25-
- [ ] [Set up project integrations](https://gitlab.com/thaikolja/modern-html-error-docs/-/settings/integrations)
26-
27-
## Collaborate with your team
28-
29-
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30-
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31-
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32-
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33-
- [ ] [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
34-
35-
## Test and Deploy
36-
37-
Use the built-in continuous integration in GitLab.
21+
Although the error docs have been built for Linux servers, please note that the following paths and folders may not be accurate for your specific distribution.
3822

39-
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
40-
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41-
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42-
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43-
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
23+
### Prerequisites
4424

45-
***
25+
- A server running Linux
26+
- An installed web server, e.g., Apache or Nginx
27+
- Root access or enough permissions to change default error docs
28+
- A modern web browser
4629

47-
# Editing this README
48-
49-
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
50-
51-
## Suggestions for a good README
52-
53-
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
54-
55-
## Name
56-
Choose a self-explaining name for your project.
30+
## Installation
5731

58-
## Description
59-
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
32+
> [!NOTE]
33+
>
34+
> For both installation versions, a Debian 12 server running Plesk, Apache, and Nginx is used. Some file paths may not be the same with your distribution.
35+
36+
### Built Installation
37+
38+
Already built version that only has to be moved to the server.
39+
40+
1. Log in to your server as the root user
41+
42+
2. Change into the directory where the error message files are being stored:
43+
44+
```bash
45+
cd /var/www/vhosts/.skel/0
46+
```
47+
48+
3. Create a backup of the default error docs folder:
49+
50+
```bash
51+
zip -r error-docs-backup.zip error_docs
52+
```
53+
54+
4. Use `curl` or `wget` to download the built files as a .zip archive:
55+
56+
```bash
57+
# Using wget
58+
wget https://github.com/thaikolja/modern-html-error-docs/archive/refs/heads/main.zip
59+
60+
# Using curl
61+
curl -0 https://github.com/thaikolja/modern-html-error-docs/archive/refs/heads/main.zip
62+
```
63+
64+
5. Unzip the downloaded file `main.zip`:
65+
66+
```bash
67+
unzip main.zip
68+
```
69+
70+
6. Delete the folder `error-docs` and rename your extracted `main`:
71+
72+
```bash
73+
rm -r error-docs && mv main error-docs
74+
```
75+
76+
7. `cd` into `error-docs` and use `ls -la`. You should see the following file structure:
77+
78+
```bash
79+
├── assets
80+
│ ├── css
81+
│ │ └── main.min.css
82+
│ ├── data
83+
│ │ └── docs.json
84+
│ ├── img
85+
│ │ ├── robot-blue.avif
86+
│ │ ├── robot-blue.png
87+
│ │ ├── robot-blue.webp
88+
│ │ ├── robot-red.avif
89+
│ │ ├── robot-red.png
90+
│ │ ├── robot-red.webp
91+
│ │ ├── robot-yellow.avif
92+
│ │ ├── robot-yellow.png
93+
│ │ └── robot-yellow.webp
94+
│ └── js
95+
│ └── scripts.min.js
96+
├── bad_gateway.html
97+
├── bad_request.html
98+
├── forbidden.html
99+
├── internal_server_error.html
100+
├── maintenance.html
101+
├── method_not_allowed.html
102+
├── not_acceptable.html
103+
├── not_found.html
104+
├── not_implemented.html
105+
├── precondition_failed.html
106+
├── proxy_authentication_required.html
107+
├── request-uri_too_long.html
108+
├── unauthorized.html
109+
└── unsupported_media_type.html
110+
```
111+
112+
8. To change the docs for each template, open `assets/data/docs.json` and adjust them there.
113+
114+
9. Restart your Apache or Nginx server or create a new website in your Plesk interface:
115+
116+
```bash
117+
# Apache
118+
sudo systemctl restart apache2
119+
120+
# Nginx
121+
sudo systemctl restart nginx
122+
```
123+
124+
10. 🥳 Your Modern HTML Error Docs are successfully installed!
125+
126+
## Customization
127+
128+
### Error docs
129+
130+
All error docs are stored in `assets/data/docs.json`. You can edit this file to change the titles, descriptions, and robot speech for each error code.
131+
132+
```json
133+
{
134+
"404": {
135+
"title": "Page Not Found",
136+
"meta_description": "404 Page Not Found - Oops! The page you're looking for has vanished into the digital void.",
137+
"robot_speech": "In a shocking turn of events, the page you're looking for has ceased to be. The internet is a cruel mistress, indeed.",
138+
"main_message": "The page you're looking for has vanished into the digital void.",
139+
"sub_message": "This robot is here to remind you that sometimes things just don't work out."
140+
}
141+
// ... other error codes
142+
}
143+
```
60144

61-
## Badges
62-
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
145+
### Styling
63146

64-
## Visuals
65-
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
147+
Modify the `assets/css/main.css` file to change the visual appearance of the error pages. The CSS uses nesting for better readability and maintainability.
66148

67-
## Installation
68-
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
149+
### Images
69150

70-
## Usage
71-
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
151+
Replace or add new robot images in the `assets/img/` directory. Ensure you update the `srcset` and `src` attributes in the respective HTML files if you change the image filenames.
72152

73-
## Support
74-
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
153+
### JavaScript
75154

76-
## Roadmap
77-
If you have ideas for releases in the future, it is a good idea to list them in the README.
155+
The `assets/js/scripts.js` file handles the dynamic loading of docs from `docs.json` and can be extended for additional client-side functionality.
78156

79157
## Contributing
80-
State if you are open to contributions and what your requirements are for accepting them.
81158

82-
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
159+
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
160+
161+
1. Fork the Project
162+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
163+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
164+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
165+
5. Open a Pull Request
83166

84-
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
167+
## Author
85168

86-
## Authors and acknowledgment
87-
Show your appreciation to those who have contributed to the project.
169+
* Kolja Nolte (kolja.nolte@gmail.com)
88170

89171
## License
90-
For open source projects, say how it is licensed.
91172

92-
## Project status
93-
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
173+
Distributed under the MIT License. See `LICENSE` for more information.

0 commit comments

Comments
 (0)