trying to make category searching work
This commit is contained in:
13
.session
13
.session
@@ -13,7 +13,7 @@ if &shortmess =~ 'A'
|
|||||||
else
|
else
|
||||||
set shortmess=aoO
|
set shortmess=aoO
|
||||||
endif
|
endif
|
||||||
badd +100 posts/site.norg
|
badd +116 posts/site.norg
|
||||||
argglobal
|
argglobal
|
||||||
%argdel
|
%argdel
|
||||||
edit posts/site.norg
|
edit posts/site.norg
|
||||||
@@ -30,12 +30,16 @@ setlocal foldenable
|
|||||||
sil! normal! zo
|
sil! normal! zo
|
||||||
31
|
31
|
||||||
sil! normal! zo
|
sil! normal! zo
|
||||||
let s:l = 100 - ((26 * winheight(0) + 27) / 54)
|
93
|
||||||
|
sil! normal! zo
|
||||||
|
108
|
||||||
|
sil! normal! zo
|
||||||
|
let s:l = 116 - ((28 * winheight(0) + 27) / 54)
|
||||||
if s:l < 1 | let s:l = 1 | endif
|
if s:l < 1 | let s:l = 1 | endif
|
||||||
keepjumps exe s:l
|
keepjumps exe s:l
|
||||||
normal! zt
|
normal! zt
|
||||||
keepjumps 100
|
keepjumps 116
|
||||||
normal! 0111|
|
normal! 07|
|
||||||
tabnext 1
|
tabnext 1
|
||||||
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
|
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
|
||||||
silent exe 'bwipe ' . s:wipebuf
|
silent exe 'bwipe ' . s:wipebuf
|
||||||
@@ -48,6 +52,7 @@ if filereadable(s:sx)
|
|||||||
exe "source " . fnameescape(s:sx)
|
exe "source " . fnameescape(s:sx)
|
||||||
endif
|
endif
|
||||||
let &g:so = s:so_save | let &g:siso = s:siso_save
|
let &g:so = s:so_save | let &g:siso = s:siso_save
|
||||||
|
nohlsearch
|
||||||
doautoall SessionLoadPost
|
doautoall SessionLoadPost
|
||||||
unlet SessionLoad
|
unlet SessionLoad
|
||||||
" vim: set ft=vim :
|
" vim: set ft=vim :
|
||||||
|
|||||||
19
categories.norg
Normal file
19
categories.norg
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
@document.meta
|
||||||
|
title: Categories
|
||||||
|
description:
|
||||||
|
authors: [
|
||||||
|
user01
|
||||||
|
]
|
||||||
|
categories: [
|
||||||
|
meta
|
||||||
|
]
|
||||||
|
created: 2026-03-21T15:58:11+00:00
|
||||||
|
updated: 2026-03-21T16:01:39+0100
|
||||||
|
draft: false
|
||||||
|
layout: categories
|
||||||
|
version: 1.1.1
|
||||||
|
@end
|
||||||
|
|
||||||
|
* Categories
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
|
||||||
|
labore et dolore magna aliqua. Lobortis scelerisque fermentum dui faucibus in ornare.
|
||||||
19
category.norg
Normal file
19
category.norg
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
@document.meta
|
||||||
|
title: Category
|
||||||
|
description:
|
||||||
|
authors: [
|
||||||
|
user01
|
||||||
|
]
|
||||||
|
categories: [
|
||||||
|
meta
|
||||||
|
]
|
||||||
|
created: 2026-03-21T16:03:17+00:00
|
||||||
|
updated: 2026-03-21T16:03:40+0100
|
||||||
|
draft: false
|
||||||
|
layout: category
|
||||||
|
version: 1.1.1
|
||||||
|
@end
|
||||||
|
|
||||||
|
* Category
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
|
||||||
|
labore et dolore magna aliqua. Lobortis scelerisque fermentum dui faucibus in ornare.
|
||||||
@@ -101,4 +101,60 @@ version: 1.1.1
|
|||||||
In order for such a service to be viable, I don't want to have to manage it manually. Instead, I can use a webhook to pull the html
|
In order for such a service to be viable, I don't want to have to manage it manually. Instead, I can use a webhook to pull the html
|
||||||
repo whenever there is a new commit. This could also be on a timer, but instant gratification is better.
|
repo whenever there is a new commit. This could also be on a timer, but instant gratification is better.
|
||||||
|
|
||||||
Unfortunately, nothing ever goes to plan when linux is involved.
|
Unfortunately, nothing ever goes to plan when linux is involved. The first indicator that my system wasn't going to work out was the fact
|
||||||
|
that when you rebuilt the site, the repo within the public folder was erased. This is nonsense, and I have already opened an issue so
|
||||||
|
that when it's fixed I have an excuse to remake the whole system.
|
||||||
|
|
||||||
|
*** Nginx Tangent
|
||||||
|
Nginx config is at the same time overly-complex and too basic.
|
||||||
|
It's like python. It looks easy on the surface, but when you get into it, does things in the most roundabout way possible.
|
||||||
|
Complaints about python aside, nginx is a nightmare to deal with on a usual basis. This is exactly why there are an infinite number
|
||||||
|
of management solutions for it, one of which I am literally using to host this site (shoutout nginx proxy manager my love).
|
||||||
|
Unfortunately not all of these solutions can host files at the raw level like I intend to, so here we are, once again, having
|
||||||
|
to waste hours figuring out why the css is being denied.
|
||||||
|
For future reference, the nginx config I'm using is as follows:
|
||||||
|
@code nginx
|
||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
listen [::]:80 default_server;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /config/www/public;
|
||||||
|
index index.html index.htm index.php;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
autoindex on;
|
||||||
|
autoindex_exact_size off; # Displays file sizes in KB/MB/GB instead of bytes
|
||||||
|
autoindex_format html; # The standard web view
|
||||||
|
autoindex_localtime on; # Uses the server's local time for file dates
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
To any experienced web developer, such as not myself, this would look like a war crime. Because it is.
|
||||||
|
This is 100% succeptible to every form of exploit one can think of. However, because I'm running this through nginx proxy manager,
|
||||||
|
I don't have to worry about such trivial things as "security" and "ssl". Everything is managed in a different docker container!
|
||||||
|
Thanks NPM.
|
||||||
|
|
||||||
|
*** Git tangent
|
||||||
|
Earlier, I said I wanted this to be automatic. And currently, it is. So, how?
|
||||||
|
I host my own shit. That's everything. Including Git.
|
||||||
|
|
||||||
|
Gitea is the least complex option that everyone seems to like enough to tolerate. It also has webhooks. And I have n8n. N8n is an
|
||||||
|
automation engine, that uses flows to achieve what can be done with basic intuition in a systemd service, or an assistant. Sadly, I
|
||||||
|
have neither the time nor money to hire someone to update git repositories for me, so I guess we're doing it with bullshit.
|
||||||
|
Gitea has the ability to trigger webhooks on a push event to a repo, and n8n can trigger commands when a webhook is triggered.
|
||||||
|
This has the side effect of letting me have a repo that, if pushed to, can trigger a webhook that opens firefox on my pc. As you can
|
||||||
|
tell, I shouldn't have permission to use automation tools. By hooking (no pun intended) n8n into gitea, I can run a command over ssh
|
||||||
|
every time the repo is pushed to, so the changes are pulled to the server automatically. The only caveat is that you can't minify
|
||||||
|
the build output, because if you do, any change will rewrite the whole file, which leads to truly insane git diffs. Such is git.
|
||||||
|
|
||||||
|
** The Final Result
|
||||||
|
Everything starts on my local machine. There is a folder in my Documents that contains the repo for the site. This is also set in my nvim
|
||||||
|
config as a Neorg workspace, so that I can make links between files, if I so wished. When I've written a post, I can build the site
|
||||||
|
on my local machine, an endeavor that takes a tenth of a second, and commit, with such entertaining messages as "initial" and "changes".
|
||||||
|
When said commit is pushed to my gitea repo, a webhook is triggered, telling n8n to ssh into server02 and pull the repo into the
|
||||||
|
www folder in the nginx docker container. Because nginx isn't 50 years old, all files update on the fly, and the new article appears
|
||||||
|
on the public facing instance.
|
||||||
|
|
||||||
|
See? web development is simple.
|
||||||
|
|||||||
Reference in New Issue
Block a user