Compare commits

..

No commits in common. "f826107e583bac4ec83947228982aac866aad5ee" and "b5535b9b038f0366f7d1108b24c4b033fbc6a941" have entirely different histories.

8 changed files with 13 additions and 99 deletions

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
dst/ dst/
site/
update
swege
.manifest .manifest

View File

@ -4,9 +4,9 @@ DESTINATION = dst
PYHTON = python3 PYHTON = python3
PORT = 8000 PORT = 8000
BIND = 127.0.0.1 BIND = 127.0.0.1
RS_USER = neko RS_USER = root
RS_HOST = darkn.space RS_HOST = darkn.space
RS_PATH = /home/neko/cyancat_net RS_PATH = /var/www/html
CSSDIR = ${SOURCE}/assets/styles CSSDIR = ${SOURCE}/assets/styles
SCRIPTS_DIR = ./scripts SCRIPTS_DIR = ./scripts

View File

@ -1,42 +0,0 @@
#!/usr/bin/env perl
# Minifies CSS files, that is removes all whitespace characters.
# Usage: `ls /path/to/css/files | /path/to/this/script`
use v5.14;
use CSS::Packer;
use warnings;
use strict;
# It leaves the copyright in place if it encounters the word 'copyright', this
# adds 'license' word as a trigger.
#
# I have already sent a pull request for that: https://github.com/leejo/css-packer-perl/pull/12.
$CSS::Packer::COPYRIGHT_COMMENT = '\/\*((?>[^*]|\*[^/])*(?:license|copyright)(?>[^*]|\*[^/])*)\*\/';
# There is no matching cleanup function to call afterwards.
my $packer = CSS::Packer->init();
my $fh;
my $mincss_path;
my $content;
my $min;
while (my $css_path = <>) {
chomp $css_path;
$mincss_path = $css_path =~ s/.css$/.min.css/r;
# Read CSS file.
open($fh, '<', $css_path) or die "Cannot open $css_path: $!";
$content = do { local $/; <$fh> };
close $fh;
# Minify CSS.
$min = $packer->minify(\$content, {compress => 'minify'});
# Write minified CSS down.
open($fh, '>', $mincss_path) or die "Cannot open $mincss_path: $!";
print $fh $min;
close $fh;
say "$css_path -> $mincss_path";
}

View File

@ -1,50 +0,0 @@
#!/usr/bin/env perl
# Creates a new website post, appends its link to the index.
use v5.14;
use autodie;
use warnings;
use strict;
use Tie::File;
use Time::Piece;
# '/' is both prepended, and appended.
my $post_url_dir = 'posts';
my $posts_dir = "./src/$post_url_dir";
my $index_file = './src/index.md';
my $post_title;
my $post_filename;
print "Post title: ";
$post_title = <>;
print "Post file name, without extension: ";
$post_filename = <>;
chomp $post_title;
chomp $post_filename;
die "File already exists" if -e "$posts_dir/$post_filename.md";
# Create a post file and insert the title.
open (my $fh, '>', "$posts_dir/$post_filename.md");
say $fh "# $post_title";
close $fh;
# Append a post URL to the index.
tie my @index_lines, 'Tie::File', $index_file;
my $posts_found = 0;
for (@index_lines) {
if ($posts_found) {
$_ .= "\n* [$post_title](/$post_url_dir/$post_filename.html)";
last;
}
$posts_found = 1 if ($_ =~ /and such:/i);
}
untie @index_lines;
my @cmd = ($ENV{EDITOR}, "$posts_dir/$post_filename.md");
system @cmd;

View File

@ -1,6 +1,9 @@
<div> <hr>
<a href="https://sakhmatd.ee/software/swege.html"><img src="/assets/badges/swege.gif" alt="Created with swege" title="Created with swege"></a> <p class="f7">
<a href="https://darkn.space"><img src="/assets/badges/hosted_ds.gif" alt="Hosted by Darkn.Space" title="Hosted by Darkn.Space"></a> &copy; 2022
</div> <a href="/">Darkn Neko</a>&nbsp;&mdash;
<a href="https://creativecommons.org/licenses/by/4.0/">CC-BY 4.0 License</a></br>
Built with <a href="https://github.com/sakhmatd/swege">swege and some catgirls</a></br>
</p>
</body> </body>
</html> </html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

View File

@ -1,5 +1,5 @@
title:Darkn Neko title:Darkn Neko
source:src source:src
destination:dst destination:site
header:src/_header.html header:src/_header.html
footer:src/_footer.html footer:src/_footer.html