working up digital sketeches and thingiverse modifying
the current nginx config auto-indexes by html and i need it to serve JSON for the svelte ImageGallery component.
simply connect to webservices and edit the nginx config for the files subdomain to include the autoindex format directive
remember to add the add_header Access-Control-Allow-Origin
option
server {
server_name files.digitalsketches.io;
root files/digitalsketches.io;
autoindex on;
autoindex_format json;
add_header Access-Control-Allow-Origin *;
}
now it's working nicely - i changed up some of digital sketches aesthetics cause yes. patterns are cool.
i want to record my process for the turbine that craig sent me on thingiverse
the key to daynotes is to have text and images ready for copying to a website for publishing.
added a getting started to the readme for day notes.
adding the right subdomain, and updating the certs, and finally pointing to the prod/build location
server {
server_name notes.bil.dev;
root prod/day-notes/svelte-day-notes/build;
index index.html;
}
looks like everything is running
Adding new websites
Created a new website to aggregate quotes. This is going to live at quotes.fuzzybench.com and is nicely fitting into the development pattern.
the dev folder is now used the way i want to use it. it represents explorations and testing. now that i have ironed out most of my thoughts - it will move into the svelte
dir and actually go live and be worked on.
this makes me think that i need to add an end-of-life dir archive
that can house all of the live* projects that get sunset. this works for dev projects that never make it to prod and live projects that either get replaced or retired.
the new workflow goes roughly as:
dev
and add the code framework (here was svelte npm create)there is a version of this for writing up the code or the project and posting to the relevant blog with data. i.e the henderson cat stickers
following the same process, dropping a dev folder with the domain name as the dir name. then following the guides in the ref section of pacstrap to make it ready for static site generation.
the goal of this new site is to support having a page where a video can be hosted, text sections can be written with notes and thoughts, and images of specfic slides can be added and referenced.
i need a fast way to get screenshots made and posted into the webservices computer
currently leaving the project in progress. i am going to get the right examples in the files.fuzzybench dir so that i can test out the layout with a video and screenshots of the slides that i like
Working through the new webservices
i got around to tinkering with bil.dev and found that i had left a placeholder for a gallery svelte component. since i last worked on these sites i had been hard importing files and building and copying files that was overkill
my new nginx configuration with subdomains has separated these problems out. this allows me to write svelte entirely in plaintext and improve buildtime and speed
the gallery component was written assuming that i have access to a json directory from and nginx hosted uri
reference svelte component below
<script>
import { onMount } from "svelte";
const baseUri = "https://files.bil.dev/";
const imageFolder = "hender-code-sticker/";
let photos = [];
onMount(async () => {
const res = await fetch('baseUri/imageFolder');
photos = await res.json();
});
</script>
{#each photos as photo}
<div class="gallery">
<a target="_blank" href={'photo.name'}>
<img src={'photo.name}'} alt="" />
</a>
</div>
{:else}
<p><em>loading...</em></p>
{/each}
<style>
div.gallery {
margin: 5px;
float: left;
width: 180px;
box-shadow: 2px 1px 1px rgb(194, 194, 194);
}
div.gallery:hover {
transition: all 0.3s ease-out;
margin-left: 0.3rem;
box-shadow: 8px 6px 6px rgb(194, 194, 194);
border-radius: 1rem;
}
div.gallery img {
width: 100%;
height: auto;
}
</style>
first i need to get the subdomains organized. i am getting rid of the gallery subdomain and switching to the standard files subdomain on squarespace.
first updated load balancer and re-cert'ed with certbot. then updated the webservices entry to autoindex files in json format
server {
server_name files.hendersoncat.com;
root /home/bil/files/hendersoncat.com;
autoindex on;
autoindex_format json;
add_header Access-Control-Allow-Origin *;
}
this is all working correctly
now i need to patch in the uri first
this worked easier than i thought. i can load up the references in a string which means i can use array and array indexing
adding onmount function to pull a fetch request like the one in the gallery component on bil.dev
this drop in worked so perfectly
now i can just dump hendersoncat images into the files.hendersoncat.com folder and have them be part of the