Compare commits
5 Commits
b5fdef0827
...
60516347b0
Author | SHA1 | Date | |
---|---|---|---|
60516347b0 | |||
c7d3874daf | |||
1fa39a180f | |||
4823924e3c | |||
0204baf6ee |
@ -1,12 +0,0 @@
|
||||
## Deploy
|
||||
|
||||
Ой, это ебаный костыль :)
|
||||
|
||||
```sh
|
||||
deploy.py
|
||||
```
|
||||
|
||||
Python скрипт, который запускает Hugo, создаёт архив, загружает его на сервер,
|
||||
и дёргает на сервере PHP скрипт, который распаковывает `.zip` архив.
|
||||
|
||||
**NOTE:** Потом нужно перенести все картинки в `/static/images/` и загружать их отдельно.
|
@ -1,48 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import uuid
|
||||
import ftplib
|
||||
import urllib.request
|
||||
|
||||
HOST = 'blog.iiiypuk.me'
|
||||
USER = 'alpopov94_blog-iiiypuk-me'
|
||||
PASSWORD = sys.argv[1]
|
||||
|
||||
def make_zip_www():
|
||||
archive_name = str(uuid.uuid4()).replace('-', '')
|
||||
shutil.make_archive(archive_name, 'zip', './public')
|
||||
|
||||
return '{0}.zip'.format(archive_name)
|
||||
|
||||
|
||||
def upload_by_ftps(archive):
|
||||
ftp = ftplib.FTP_TLS(host=HOST, user=USER, passwd=PASSWORD)
|
||||
|
||||
# ftp.delete('posts')
|
||||
|
||||
if ftp.pwd() == '/':
|
||||
with open(archive, 'rb') as f:
|
||||
ftp.storbinary('STOR {0}'.format(archive), f)
|
||||
os.remove(archive)
|
||||
|
||||
with open('unpack.php', 'rb') as f:
|
||||
ftp.storbinary('STOR unpack.php', f)
|
||||
|
||||
|
||||
def get_unpack(archive):
|
||||
f = urllib.request.urlopen('https://blog.iiiypuk.me/unpack.php?f={0}'.format(archive))
|
||||
f.read()
|
||||
|
||||
ftp = ftplib.FTP_TLS(host=HOST, user=USER, passwd=PASSWORD)
|
||||
ftp.delete('unpack.php')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
os.system('rm -rf ./public/ &> /dev/null') # FIXIT
|
||||
os.system('hugo &> /dev/null')
|
||||
archive = make_zip_www() # ..
|
||||
upload_by_ftps(archive) # ..
|
||||
get_unpack(archive) # ..
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
$zipFile = $_GET['f'];
|
||||
$zip = new ZipArchive;
|
||||
|
||||
if ($zip->open($zipFile) === TRUE) {
|
||||
$zip->extractTo('.');
|
||||
$zip->close();
|
||||
|
||||
unlink(zipFile);
|
||||
}
|
||||
?>
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,5 +1,8 @@
|
||||
static/content/
|
||||
public/
|
||||
public.tar.xz
|
||||
|
||||
# Executable
|
||||
hugo
|
||||
hugo.exe
|
||||
.hugo_build.lock
|
||||
|
0
.gitmodules
vendored
0
.gitmodules
vendored
@ -1 +1 @@
|
||||
Download [Hugo](https://github.com/gohugoio/hugo/releases/tag/v0.119.0).
|
||||
|
||||
|
11
deploy.sh
Executable file
11
deploy.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
IN=./public/
|
||||
DIR=Sites/iiiypuk.me/www/
|
||||
|
||||
./hugo && rsync -avz --delete \
|
||||
# --exclude 'test' \
|
||||
# --exclude 'file.txt' \
|
||||
${IN} kvm5:~/${DIR}
|
||||
|
||||
exit 0
|
12
make.sh
12
make.sh
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# remove old generated files
|
||||
rm ./public*.tar.xz
|
||||
rm -rf ./public/
|
||||
|
||||
# generate new public files
|
||||
hugo
|
||||
|
||||
# make public data archive
|
||||
#cd ./public/
|
||||
#tar -cJf "../public.tar.xz" .
|
60
scripts/colors.sh
Normal file
60
scripts/colors.sh
Normal file
@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script is used to define colors for bash scripts
|
||||
# Git: https://git.a2s.su/iiiypuk/colors.sh
|
||||
# Author: Alexander Popov
|
||||
# License: MIT
|
||||
# Update: 28 Mar 2024
|
||||
|
||||
# Usage:
|
||||
#
|
||||
# source colors.sh
|
||||
# echo -e "This is ${RED}red text${NC}"
|
||||
|
||||
# Black and white
|
||||
export BLACK='\033[0;30m'
|
||||
export WHITE='\033[0;37m'
|
||||
export GRAY='\033[0;90m'
|
||||
export NC='\033[0m' # reset color
|
||||
|
||||
# Bold black and white
|
||||
export BLACK_B='\033[1;30m'
|
||||
export WHITE_B='\033[1;37m'
|
||||
export GRAY_B='\033[1;90m'
|
||||
|
||||
# Basic colors
|
||||
export RED='\033[0;31m'
|
||||
export GREEN='\033[0;32m'
|
||||
export BLUE='\033[0;34m'
|
||||
export YELLOW='\033[0;33m'
|
||||
export MAGENTA='\033[0;35m'
|
||||
export CYAN='\033[0;36m'
|
||||
|
||||
# Bold basic colors
|
||||
export RED_B='\033[1;31m'
|
||||
export GREEN_B='\033[1;32m'
|
||||
export BLUE_B='\033[1;34m'
|
||||
export YELLOW_B='\033[1;33m'
|
||||
export MAGENTA_B='\033[1;35m'
|
||||
export CYAN_B='\033[1;36m'
|
||||
|
||||
# Bright colors
|
||||
export BRIGHT_RED='\033[0;91m'
|
||||
export BRIGHT_GREEN='\033[0;92m'
|
||||
export BRIGHT_BLUE='\033[0;94m'
|
||||
export BRIGHT_YELLOW='\033[0;93m'
|
||||
export BRIGHT_MAGENTA='\033[0;95m'
|
||||
export BRIGHT_CYAN='\033[0;96m'
|
||||
|
||||
# Bold bright colors
|
||||
export BRIGHT_RED_B='\033[1;91m'
|
||||
export BRIGHT_GREEN_B='\033[1;92m'
|
||||
export BRIGHT_BLUE_B='\033[1;94m'
|
||||
export BRIGHT_YELLOW_B='\033[1;93m'
|
||||
export BRIGHT_MAGENTA_B='\033[1;95m'
|
||||
export BRIGHT_CYAN_B='\033[1;96m'
|
||||
|
||||
# Styles
|
||||
export BOLD='\033[1m'
|
||||
export UNDERLINE='\033[4m'
|
||||
export BLINK='\033[5m'
|
15
scripts/update-static.sh
Executable file
15
scripts/update-static.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# include colors.sh
|
||||
SCRIPT=$(readlink -f $0)
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
source $SCRIPTPATH/colors.sh
|
||||
|
||||
CDN_PATH=https://cdn.a2s.su/blog/assets/bootstrap/5.3.3
|
||||
|
||||
echo -e "${BRIGHT_CYAN}Download ${BRIGHT_CYAN_B}Bootstrap...${NC}"
|
||||
|
||||
wget -nv "$CDN_PATH/bootstrap.min.css" -O themes/papercut/static/css/bootstrap.min.css
|
||||
wget -nv "$CDN_PATH/bootstrap.min.js" -O themes/papercut/static/js/bootstrap.min.js
|
||||
|
||||
echo -e "${BRIGHT_GREEN}Complete...${NC}"
|
@ -1,6 +1,9 @@
|
||||
/* SITE */
|
||||
Last Updated: Tue Sep 03 12:39 AM MSK 2022
|
||||
Components: Hugo, Bootstrap 5.2.0
|
||||
Last Updated: Thu Mar 28 2024
|
||||
Components:
|
||||
Hugo
|
||||
Bootstrap 5.3.3
|
||||
Ubuntu font family
|
||||
|
||||
/* TEAM */
|
||||
Chef: Alexander Popov
|
||||
|
@ -5,5 +5,6 @@
|
||||
<a class="border-bottom border-primary text-decoration-none py-1 mx-1" target="_blank" href="http://a2s.su:8000/">Micro blog</a>
|
||||
<a class="border-bottom border-primary text-decoration-none py-1 mx-1" target="_blank" href="irc://iiiypuk.me:6667/admin">IRC</a>
|
||||
<a class="border-bottom border-primary text-decoration-none py-1 mx-1" target="_blank" href="gemini://a2s.su">Gemini</a>
|
||||
<a class="border-bottom border-primary text-decoration-none py-1 mx-1" target="_blank" href="https://t.me/db_o_qp">Telegram</a>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -5,28 +5,30 @@
|
||||
<span class="fw-bold">📕 Languages & frameworks:</span>
|
||||
|
||||
<span class="border-bottom p-1">Pure C</span>,
|
||||
<span class="border-bottom p-1">C++</span>,
|
||||
<span class="border-bottom p-1">Crystal</span>,
|
||||
<span class="border-bottom p-1">JavaScript</span>,
|
||||
<span class="border-bottom p-1">Python</span>,
|
||||
<span class="border-bottom p-1">PHP</span>,
|
||||
<span class="border-bottom p-1 text-nowrap">OpenCV 4</span>,
|
||||
<span class="border-bottom p-1 text-nowrap">SFML</span>,
|
||||
<span class="border-bottom p-1 text-nowrap">Bootstrap 5</span>
|
||||
</p>
|
||||
|
||||
<p class="text-center lh-lg">
|
||||
<span class="fw-bold">🧰 Tools:</span>
|
||||
|
||||
<span class="border-bottom p-1 text-nowrap">Arch Linux</span>,
|
||||
<span class="border-bottom p-1">L4T</span>,
|
||||
<span class="border-bottom p-1">Porteus</span>,
|
||||
<span class="border-bottom p-1 text-nowrap">Alpine Linux</span>,
|
||||
<span class="border-bottom p-1">OpenBSD</span>,
|
||||
<span class="border-bottom p-1 text-nowrap">Arch Linux</span>,
|
||||
<span class="border-bottom p-1 text-nowrap">Windows 11</span>,
|
||||
<span class="border-bottom p-1 text-nowrap">Sublime Text 4</span>,
|
||||
<span class="border-bottom p-1 text-nowrap">Windows Terminal</span>,
|
||||
<span class="border-bottom p-1">CorelDRAW</span>,
|
||||
<span class="border-bottom p-1">GameMaker</span>,
|
||||
<span class="border-bottom p-1">EditorConfig</span>,
|
||||
<span class="border-bottom p-1">Gitea</span>,
|
||||
<span class="border-bottom p-1">Git</span>,
|
||||
<span class="border-bottom p-1">Tmux</span>
|
||||
</p>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
@font-face {
|
||||
font-family: 'Ubuntu Mono';
|
||||
src: url('/fonts/UbuntuMono-Regular.woff2') format('woff2'),
|
||||
url('/fonts/UbuntuMono-Regular.woff') format('woff');
|
||||
src: url('//cdn.a2s.su/blog/assets/fonts/UbuntuMono-Regular.woff2') format('woff2'),
|
||||
url('//cdn.a2s.su/blog/assets/fonts/UbuntuMono-Regular.woff') format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
@ -9,8 +9,8 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'Ubuntu';
|
||||
src: url('/fonts/Ubuntu-Bold.woff2') format('woff2'),
|
||||
url('/fonts/Ubuntu-Bold.woff') format('woff');
|
||||
src: url('//cdn.a2s.su/blog/assets/fonts/Ubuntu-Bold.woff2') format('woff2'),
|
||||
url('//cdn.a2s.su/blog/assets/fonts/Ubuntu-Bold.woff') format('woff');
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
@ -18,8 +18,8 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'Ubuntu';
|
||||
src: url('/fonts/Ubuntu-BoldItalic.woff2') format('woff2'),
|
||||
url('/fonts/Ubuntu-BoldItalic.woff') format('woff');
|
||||
src: url('//cdn.a2s.su/blog/assets/fonts/Ubuntu-BoldItalic.woff2') format('woff2'),
|
||||
url('//cdn.a2s.su/blog/assets/fonts/Ubuntu-BoldItalic.woff') format('woff');
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
font-display: swap;
|
||||
@ -27,8 +27,8 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'Ubuntu';
|
||||
src: url('/fonts/Ubuntu-Italic.woff2') format('woff2'),
|
||||
url('/fonts/Ubuntu-Italic.woff') format('woff');
|
||||
src: url('//cdn.a2s.su/blog/assets/fonts/Ubuntu-Italic.woff2') format('woff2'),
|
||||
url('//cdn.a2s.su/blog/assets/fonts/Ubuntu-Italic.woff') format('woff');
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
font-display: swap;
|
||||
@ -36,8 +36,8 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'Ubuntu';
|
||||
src: url('/fonts/Ubuntu.woff2') format('woff2'),
|
||||
url('/fonts/Ubuntu.woff') format('woff');
|
||||
src: url('//cdn.a2s.su/blog/assets/fonts/Ubuntu.woff2') format('woff2'),
|
||||
url('//cdn.a2s.su/blog/assets/fonts/Ubuntu.woff') format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
|
Loading…
Reference in New Issue
Block a user