The main feature is the repopulate-database function which clears out the
Meilisearch DB index containing this site's searchable information and
repopulates it with the site's nera.db information.
I, also, added a delete-index function (also in search package) but that is
mostly a convenience feature. It allows me to quickly delete any index in the
Meilisearch DB which I made by mistake (E.G. wrong name, change of plan) and
remove old indexes from other projects which are no longer in use (on local
dev. machine mostly).
I'm sure I will need to update this at some point. I didn't spend too much time
on it, just jotted things down as a I came across routes in web.lisp. The
Sitemap URL will need to change, the closer the site goes into production and an
domain name has been bought/finalised.
These functions are mostly aimed at the site's XML-generated site map. The piece
together the site's URL from lack's request struct. I don't know if there is a
pre-built string containing this information (I.E. http://localhost:5000 and
http://localhost:5000/testing) which is why I have written these functions.
When uploading a file to /storage the database stored the un-formatted name and
the file was stored with the formated name. This meant when anyone tried to
download or rename the file, the website would produce an error. This commit
fixes this and has the database and file storage system store the files name in
the formatted way (all lowercase with no whitespace).
This file has been in the repo. for a while -- I copied it over from my co-web
project. But, I hadn't touched it or integrated into this website until
now. The changes in this commit are mostly minor changes which bring the URL's
for the Meilisearch instance this website connects to and change the CSS classes
to match the ones used in this project (and not my co-web) project.
Because I copied over the code from my co-web project, the code in this file has
CSS classes referring to that project. This commit updates those classes to fall
in-line with the CSS/design of this website.
I will need to update this as I go along. I copied the code over from my co-web
project so the webpages have been rendering with that style/design until
now. This commit has removed as much of it as possible and added/updated the
style rules to fall in-line with the design of this website.
I will need to update this as I go along. I copied the code over from my co-web
project so the webpages have been rendering with that style/design until
now. This commit has removed as much of it as possible and added/updated the
style rules to fall in-line with the design of this website.
I was faffing in this file and had Emacs do a quick re-indentation (with
web-mode) enabled. I don't think I have touched this file since installing
web-mode.
This allows you to change the order the search results are returned in. The main
purpose why you would want to use this function in this context is to make sure
the list of results is ordered by the year the artworks where published/created.
This will need updating. I copied over a quick-list section from another
template. I'm off home after this commit (got one more commit to enter after
this). Thought I would get something in before I left, though.
Only 'Month' and 'Year' are used because 'Day' is not relevant -- at time of
writing. You might see an change to this form in a later commit if requirements change.
The publish date refers to when the artwork was publish which differs from the
'Created At' date. That refers to when the entry was added to the database.
This update is in the nera package. It is part of a refactoring of functionality
to have a seperate 'Publish' date and a 'Created At' date within this site's
database. The 'Created at' date refers to when the entry was added to the
database. The 'Publish' date is the date of the artwork.
This code is intended to be used mostly in the 'index' pages (Pages and
Archive). These pages are mostly going to act as a back-up for when the
Meilisearch service goes down or if the user has a poor internet
connection. This filtering behaviour allows the user to filter the entries in
the Index they are viewing (Pages or Archive). There are no images and no
repeated calls back to the server. Each index lists just the text (Titles,
publish info. Etc.) and from there the viewer can filter the results on the
page by entering text into the text box in the Index-base HTML templates.
From Nic's point-of-view, these Index pages will not be included in the
nav. menu but if the Meilisearch service goes down (at this site is still
operational), she can swap out the 'search' page for these (really it's just the
Archive Index) so people can still have some form of search/filtering ability
whilst viewing the website.
This defroute doesn't change anything relevant in the Meilisearch DB so it
doesn't need updating. I've left a comment (mostly for future me) to remind me
not to think I've missed a defroute and try to integrate the Meilisearch stuff
into it.
The defroute to update the thumbnail doesn't need to change but I added a
comment to make it clear in the future -- I can see me forgetting it doesn't
need updating and try to add code which doesn't need to exist.
I, also, did a bit of updating to the layout of the code is parts -- mostly when
setting the alert message.
The re-direct to /search when the user has set /search as the site's home page
is part of a list of other hard-coded re-directs in this site's '/' defroute.
The site now deletes the Archive Entry from the Meilisearch database alongside
the files in the /storage directory and the nera database.
These functions are helper functions to manage the Meiliseach database from
a Common Lisp perspective. The intention is to work them into the website's
back-end so the user can reset or re-populate the database from the website
without me (or someone else) having to SSH into the VM and do fix/restore things
manually. For now, they allow you to manage the database from SLIME.