mirror of
https://github.com/alvierahman90/gronk.git
synced 2026-06-16 16:30:41 +00:00
Compare commits
3 Commits
c64214b0cc
...
92948f517c
| Author | SHA1 | Date | |
|---|---|---|---|
|
92948f517c
|
|||
|
7a8c56056f
|
|||
|
d80ff07aa1
|
@@ -2,3 +2,4 @@
|
||||
.env
|
||||
env
|
||||
**/__pycache__
|
||||
out
|
||||
|
||||
22
gronk.py
22
gronk.py
@@ -623,15 +623,25 @@ def main(args):
|
||||
elapsed_time = time.time() - start_time
|
||||
print(f"generated notes {elapsed_time=}")
|
||||
|
||||
with open(args.output_dir.joinpath("fart.json"), "w+") as fp:
|
||||
json.dump(
|
||||
{
|
||||
k: {prop: str(propval) for prop, propval in v.items()}
|
||||
#with open(args.output_dir.joinpath("data.json"), "w+") as fp:
|
||||
# json.dump(
|
||||
# {
|
||||
# k: {prop: str(propval) for prop, propval in v.items()}
|
||||
# for k, v in FILEMAP._map.items()
|
||||
# },
|
||||
# fp,
|
||||
# )
|
||||
|
||||
with open(args.output_dir.joinpath("urls.txt"), "w") as fp:
|
||||
fp.write(
|
||||
"\n".join([
|
||||
f"/permalink?uuid={v['uuid']} {v['dst_path']['web']}"
|
||||
for k, v in FILEMAP._map.items()
|
||||
},
|
||||
fp,
|
||||
if v.get('uuid')
|
||||
])
|
||||
)
|
||||
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
20
readme.md
20
readme.md
@@ -44,6 +44,26 @@ Set the following environment variables (or create a .env file) and run `docker
|
||||
0. Install [Pandoc](https://pandoc.org/index.html) and [Pip](https://github.com/pypa/pip), python3-dev, and a C compiler
|
||||
1. `sudo make install`
|
||||
|
||||
## JavaScriptless Permalink Redirects
|
||||
|
||||
By default, gronk uses JavaScript to redirect permalinks to their corresponding pages.
|
||||
This allows the whole website to be a static site.
|
||||
|
||||
JavaScript can be avoided by hosting an instance of
|
||||
[urls-txt](https://pls.cx/urls-txt) with the `urls.txt` generated in the output folder.
|
||||
Then redirect `/permalink` requests otherwise going to gronk to this urls-txt instance.
|
||||
For NGINX, a minimal config may look like:
|
||||
|
||||
```
|
||||
location / {
|
||||
root /var/run/html/notes.alv.cx;
|
||||
|
||||
location /permalink {
|
||||
proxy_pass http://localhost:3000;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Other Things to Know
|
||||
|
||||
- gronk indexes [ATX-style headings](https://pandoc.org/MANUAL.html#atx-style-headings) for
|
||||
|
||||
Reference in New Issue
Block a user