fixed comments, added documentation

This commit is contained in:
legitnull 2023-04-12 06:29:36 -06:00
parent 00c65f5480
commit b99ddd2bfb
4 changed files with 61 additions and 4 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
data/
comments.db/

View File

@ -2,6 +2,43 @@ H0wdy!!!
feel free to commit, leave suggestions, issues, or really anything <3
## SETUP
**For a normal user you can follow this process:**
First clone the repo:
```bash
git clone https://git.tcp.direct/S4D/tcp-wiki.git
```
Then you have to cd into the repo's folder and run/compile:
```bash
cd tcp-wiki/src
go run .
```
Then you goto your browser and visit: http://127.0.0.1:8080/
**For a develeper setup you can follow this process:**
First clone the repo:
```bash
git clone ssh://git@git.tcp.direct:2222/S4D/tcp-wiki.git
```
Then cd and run dev.sh
```bash
cd tcp-wiki
bash dev.sh
```
Then you goto your browser and visit: http://127.0.0.1:8080/
This method just adds in some handy symlinks for development purposes
### Use with your own repo?
All you have to do is modify the main.go file:
```go
const repoURL = "https://git.tcp.direct/S4D/tcp-wiki.git"
```
Change this line to your repo link, and enjoy!
## TODO
- [ ] MANY FUCKING THINGS
@ -13,14 +50,17 @@ feel free to commit, leave suggestions, issues, or really anything <3
- [ ] last edited
- [ ] last editor/commit
- [ ] pgp signed intergration
- [-] comments using bitcast - almost there! - generated in comments.db/
- [x] comments using bitcask - generated in comments.db/
- [ ] verification - no login pgp
- [ ] captcha
- [ ] sub rating system
- [ ] sort by date etc
- [ ] reply to replies
- [ ] set security controls per page
- [ ] dynamically generated links for all avaiable pages
- [ ] sitemap
- [ ] anti robot shit here
- [ ] acual working pages!?
- [ ] post quantum intergration and verification
- [ ] BUILD UP THAT MARKDOWN SUPPORT
- [ ] fix whatever i did to fuck up design/layout/css???

View File

@ -28,20 +28,21 @@
<h2>Comments</h2>
{{ range .Comments }}
<div class="comment">
<p>{{ .Body }}</p>
<p><small>{{ .Author }} at {{ .CreatedAt }}</small></p>
<p>{{ .Content }}</p>
<p><small>{{ .Author }} at {{ .Date }}</small></p>
</div>
{{ end }}
</div>
</main>
<form method="POST" action="/submit_comment">
<input type="hidden" name="path" value="{{ .Path }}">
<div class="form-group">
<label for="author">Name:</label>
<input type="text" id="author" name="author">
</div>
<div class="form-group">
<label for="body">Comment:</label>
<textarea id="body" name="body"></textarea>
<textarea id="content" name="content"></textarea>
</div>
<button type="submit">Submit</button>
</form>

14
dev.sh Normal file
View File

@ -0,0 +1,14 @@
#/bin/bash
# this sets up super annoying shit like hard symlinks and whatever else
# Eventually front end will be in a seperate branch for production
# but for now we can manage by editing via hardlinks.
# This sets up your local readme as the main page and the files in assets as public
cd src && go run .
rm ../data/assets/*
ln ../assets/_layout.html ../data/assets/_layout.html
ln ../assets/main.css ../data/assets/main.css
rm ../data/README.md
ln ./README.md ../data/README.md
echo "Developer setup ready!"
echo "Goto: http://127.0.0.1:8080"