blob: c5efb6a38fc6e174dbf5206239563eb72c2916f1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# hn
[hn](https://hn.cleberg.net) is a simple front-end alternative for Hacker
News, focusing on privacy and simplicity.
## Getting Started
These instructions will get you a copy of the project up and running on your
local machine for development and testing purposes. See deployment for notes on
how to deploy the project on a live system.
### Prerequisites
- A web server (e.g., Nginx or Apache)
- PHP
### Installing
Install the dependencies, using the web server of your choice:
```
sudo apt install nginx-full php
```
Clone the repo:
```
git clone https://git.sr.ht/~cmc/hn/
```
## Deployment
Deployment is as easy as copying the code to your webroot. No special packages
or tools required.
To deploy, ensure you have a publicly-available web server and configure it to
fallback with all errors to the `index.php` file rather than returning a `404`
error.
For nginx, include the following snippet in your website's conf file:
```conf
location / {
# First attempt to serve request as file, then
# as directory then fall back to index.php
try_files $uri $uri/ /index.php?$args;
}
```
For Apache, you can include the following snippet in a `.htaccess` file within
the directory you're serving the PHP file from:
```conf
FallbackResource /index.php
```
## Built With
* [PHP](https://www.php.net/) - The scripting language
* [HTML](https://html.spec.whatwg.org/multipage/) - The markup language
## Contributing
Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of
conduct, and the process for submitting pull requests to us.
## Versioning
This project currently doesn't use versioning. See the git log instead.
## Authors
* **CMC** - *Literally everything* - [cmc](https://sr.ht/~cmc/)
## License
This project is licensed under the Unlicense - see the
[LICENSE.md](LICENSE.md) file for details.
## Acknowledgments
* Hat tip to anyone whose code was used
* Inspiration
* etc
------------------------------------
# hn
## TODO
A scratch pad of ideas that may be useful to implement:
- [ ] Add functionality to view item-specific page with comments.
- [ ] Add functionality to view a user's profile.
- [ ] Add functionality to load more items or paginate?
- [ ] Add minimal CSS.
## Development
This just uses plain PHP and HTML, no special package managers or development
tools needed. Just start editing the files with your favorite editor and use a
server with PHP if you want to view the results or deploy your own version.
## Deployment
|