Browse Source

cleaned up for git

master
trav 2 months ago
parent
commit
0ee791361e
  1. 34
      README.md
  2. 23
      template.conf

34
README.md

@ -1,31 +1,33 @@
this page details the script that is used to update sexoskeleton.com. It's basically a cron-ed bash script that makes a "blog" from a folder of images and text. It is not perfect by any means, it is a blog by the simplest means. If you have questions feel free to email hello@sexoskeleton.com
# bashblog
It's basically a cron-ed bash script that makes a "blog" from a folder of images and text. It is not perfect by any means, it is a blog by the simplest means. If you have questions feel free to email hello@sexoskeleton.com
first of all, the full script can be downloaded here
## setup
to set it up: you've got to have a webadd directory and a webdir directory. Webdir is the site, webadd is images and text to be added. We have these setup in the user's root directory. You may need to tweak.
1. create a `webadd` directory and a `webdir` directory. Webdir is the site, webadd is images and text to be added.
we have webadd shared over syncthing so that all we have to do is drag a file from our local machine, it syncs and within an hour will be posted.
2. you might like to share the `webadd` directory to be able to collaborate with people. [Syncthing](https://syncthing.net/) is recommended.
ok so, I'll walk through some important parts of the script:
3. Within the script:
```
MAXINDEX=70
MAXLOG=1000
```
`MAXINDEX` sets how long, in # of lines, you want the index.html to be before being archived to another page.
these variables set how long, in # of lines, you want the index.html and log file to get before they are archived or deleted. By default everytime sexoskeleton.sh is run it stores most of its output into ~/cronlog.log which isn't precisely a cronlog. But that's what it's called
when index.html gets bigger than `MAXINDEX`, index.html is renamed `$currentdate`.html and linked to from archive.html. Then `~/template.conf` is copied to create a new index.html. Template.conf is basically the header and footer minus all the content in the middle. The template.conf for sexoskeleton.com is included for example.
when index.html gets bigger than MAXINDEX, index.html is renamed $currentdate.html and linked to on archive.html. Then ~/template.conf is copied to create a new index.html. Template.conf is basically the header and footer minus all the content in the middle
`MAXLOG` sets how many lines of the script log you want to hold onto before it is deleted.
By default everytime sexoskeleton.sh is run it stores most of its output into `~/cronlog.log` which isn't precisely a cronlog. But that's what it's called.
so then the script iterates through any files in the webadd directory. Anything ending in .gif, .jpg, .png or .txt will be picked up. .txt files can contain html but you need to escape your own slashes. Which is to say if you put in / in a .txt add a \ before it.
## when the script is run
The script iterates through files in the `webadd` directory. Anything ending in .gif, .jpg, .png or .txt will be picked up. .txt files can contain html but you need to escape your own slashes. Which is to say if you put in / in a .txt add a \ before it.
also of note, image files are moved from webadd to webdir under a unique filename to avoid conflicts and .txt files are DELETED after being appended to the index.
also of note, image files are moved from `webadd` to `webdir` under a unique filename to avoid conflicts and .txt files are *DELETED* after being appended to the index.
the script looks for
inside index.html and adds the new content just below that line. I couldn't figure out adding below the line so it actually replaces
and then adds it back in....
the script looks for `<!--posts-->` inside index.html and adds the new content just below that line. I couldn't figure out adding below the line so it actually replaces `<!--posts-->` and then adds it back in.
if nothing has changed the site is not re-uploaded
if something has changed, the script runs surge to upload the site.
if something has changed, the script runs [surge](https://surge.sh) to upload the site. You'll need to configure Surge before running all this. Or just share `webdir` with a webserver.
and that's it. This script was written by [trav](https://teafry.me)
This script was written by [trav](https://teafry.me)

23
template.conf

@ -0,0 +1,23 @@
<html><head><title>Sexoskeleton</title>
<style>
a:link {
color: black;
background-color: white;
}
a:visited {
color: black;
background-color: white;
}
a:hover {
color: white;
background-color: black;
}
</style>
</head><body>
<p><h1><I>SEXOSKELETON.COM</I><br>
<i><a href="inquiries.html">INQUIRIES</a> // <a href="archive.html">ARCHIVE</a> </i></H1></p>
<!--posts-->
</body></html>
Loading…
Cancel
Save