mirror of
https://github.com/SantaSpeen/santaspeen.ru-blog.git
synced 2025-07-01 23:36:26 +00:00
Optimize some moments in code
This commit is contained in:
parent
9f26a11327
commit
ea1478fd22
51
.github/workflows/deploy.yml
vendored
51
.github/workflows/deploy.yml
vendored
@ -1,51 +0,0 @@
|
|||||||
name: Deploy to GitHub Pages
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
name: Deploy to GitHub Pages
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
GOOGLE_ANALYTICS_TAG_ID: ${{ secrets.GOOGLE_ANALYTICS_TAG_ID }}
|
|
||||||
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
|
|
||||||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
|
||||||
ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 21
|
|
||||||
cache: npm
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm install --frozen-lockfile
|
|
||||||
- name: Build website
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: ./build
|
|
||||||
|
|
||||||
algolia:
|
|
||||||
needs: deploy
|
|
||||||
name: Algolia update index for search
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }}
|
|
||||||
API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Run Docker scraper
|
|
||||||
run: |
|
|
||||||
docker run -e APPLICATION_ID=$APPLICATION_ID -e API_KEY=$API_KEY -e "CONFIG=$(cat algolia_config.json | jq -r tostring)" algolia/docsearch-scraper
|
|
19
.github/workflows/test_manual_action.yml
vendored
19
.github/workflows/test_manual_action.yml
vendored
@ -1,19 +0,0 @@
|
|||||||
name: Manual action for testing
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test_algolia:
|
|
||||||
name: Algolia updates
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }}
|
|
||||||
API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Run Docker image
|
|
||||||
run: |
|
|
||||||
docker run -e APPLICATION_ID=$APPLICATION_ID -e API_KEY=$API_KEY -e "CONFIG=$(cat algolia_config.json | jq -r tostring)" algolia/docsearch-scraper
|
|
@ -5,12 +5,12 @@ description: Описание
|
|||||||
image: ./logo.png
|
image: ./logo.png
|
||||||
tags: [blog, javascript, nginx]
|
tags: [blog, javascript, nginx]
|
||||||
keywords: [docker, linux]
|
keywords: [docker, linux]
|
||||||
date: 2023-11-29
|
date: 2023-12-15
|
||||||
---
|
---
|
||||||
|
|
||||||
Описание для предварительного просмотра на главной странице
|
Описание для предварительного просмотра на главной странице
|
||||||
|
|
||||||
[](/blog/blog-setup)
|
[](/blog/blog-setup)
|
||||||
<!--truncate-->
|
<!--truncate-->
|
||||||
|
|
||||||
### Введение
|
### Введение
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 196 KiB |
116
nginx.conf
116
nginx.conf
@ -1,116 +0,0 @@
|
|||||||
user nginx;
|
|
||||||
worker_processes auto;
|
|
||||||
|
|
||||||
# number of file descriptors used for nginx
|
|
||||||
# the limit for the maximum FDs on the server is usually set by the OS.
|
|
||||||
# if you don't set FD's then OS settings will be used which is by default 2000
|
|
||||||
worker_rlimit_nofile 100000;
|
|
||||||
|
|
||||||
error_log /dev/stdout info;
|
|
||||||
pid /tmp/nginx.pid;
|
|
||||||
|
|
||||||
events {
|
|
||||||
# TODO: check values
|
|
||||||
worker_connections 4000;
|
|
||||||
use epoll;
|
|
||||||
multi_accept on;
|
|
||||||
}
|
|
||||||
|
|
||||||
http {
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
|
|
||||||
log_format json '{"remote_addr":"$remote_addr", "remote_user":"$remote_user", "time_local":"$time_local", "request":"$request", '
|
|
||||||
'"status":"$status", "body_bytes_sent":"$body_bytes_sent", "http_referer":"$http_referer", '
|
|
||||||
'"http_user_agent":"$http_user_agent", "http_x_forwarded_for":"$http_x_forwarded_for"}'; # -- POST body: $request_body
|
|
||||||
access_log /dev/stdout json;
|
|
||||||
error_log /dev/stdout error;
|
|
||||||
|
|
||||||
# cache informations about FDs, frequently accessed files
|
|
||||||
# can boost performance, but you need to test those values
|
|
||||||
open_file_cache max=200000 inactive=20s;
|
|
||||||
open_file_cache_valid 30s;
|
|
||||||
open_file_cache_min_uses 2;
|
|
||||||
open_file_cache_errors on;
|
|
||||||
|
|
||||||
send_timeout 2;
|
|
||||||
sendfile on;
|
|
||||||
tcp_nopush on;
|
|
||||||
tcp_nodelay on;
|
|
||||||
reset_timedout_connection on;
|
|
||||||
keepalive_timeout 30;
|
|
||||||
keepalive_requests 100;
|
|
||||||
client_max_body_size 100m;
|
|
||||||
client_body_timeout 120;
|
|
||||||
|
|
||||||
gzip on;
|
|
||||||
# gzip_static on;
|
|
||||||
gzip_min_length 10240;
|
|
||||||
gzip_comp_level 6;
|
|
||||||
gzip_vary on;
|
|
||||||
gzip_disable msie6;
|
|
||||||
gzip_proxied expired no-cache no-store private auth;
|
|
||||||
gzip_types
|
|
||||||
# text/html is always compressed by HttpGzipModule
|
|
||||||
text/css
|
|
||||||
text/javascript
|
|
||||||
text/xml
|
|
||||||
text/plain
|
|
||||||
text/x-component
|
|
||||||
application/javascript
|
|
||||||
application/x-javascript
|
|
||||||
application/json
|
|
||||||
application/xml
|
|
||||||
application/rss+xml
|
|
||||||
application/atom+xml
|
|
||||||
font/truetype
|
|
||||||
font/opentype
|
|
||||||
application/vnd.ms-fontobject
|
|
||||||
image/svg+xml;
|
|
||||||
|
|
||||||
client_body_temp_path /tmp/client_temp;
|
|
||||||
proxy_temp_path /tmp/proxy_temp_path;
|
|
||||||
fastcgi_temp_path /tmp/fastcgi_temp;
|
|
||||||
uwsgi_temp_path /tmp/uwsgi_temp;
|
|
||||||
scgi_temp_path /tmp/scgi_temp;
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 8000;
|
|
||||||
server_name 0.0.0.0;
|
|
||||||
|
|
||||||
# ssl_certificate $web_root/ssl/cert.crt;
|
|
||||||
# ssl_certificate_key $web_root/ssl/private.key;
|
|
||||||
# ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
|
|
||||||
|
|
||||||
root /srv/www;
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
# First attempt to serve request as file, then
|
|
||||||
# as directory, then fall back to redirecting to index.html
|
|
||||||
add_header Cache-Control no-cache;
|
|
||||||
expires 0;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Media: images, icons, video, audio, HTC
|
|
||||||
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc)$ {
|
|
||||||
expires 1M;
|
|
||||||
access_log off;
|
|
||||||
add_header Cache-Control "public";
|
|
||||||
}
|
|
||||||
|
|
||||||
# Javascript and CSS files
|
|
||||||
location ~* \.(?:css|js)$ {
|
|
||||||
try_files $uri =404;
|
|
||||||
expires 1y;
|
|
||||||
access_log off;
|
|
||||||
add_header Cache-Control "public";
|
|
||||||
}
|
|
||||||
|
|
||||||
# Any route containing a file extension (e.g. /devicesfile.js)
|
|
||||||
location ~ ^.+\..+$ {
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "akmalov.com",
|
"name": "santaspeen.ru",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"https": "https://akmalov.com",
|
"https": "https://santaspeen.ru",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"deploy-ghp": "gh-pages -d dist",
|
"deploy-ghp": "gh-pages -d dist",
|
||||||
"docusaurus": "docusaurus",
|
"docusaurus": "docusaurus",
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
/**
|
|
||||||
* CSS files with the .module.css suffix will be treated as CSS modules
|
|
||||||
* and scoped locally.
|
|
||||||
*/
|
|
||||||
|
|
||||||
.heroBanner {
|
|
||||||
padding: 4rem 0;
|
|
||||||
text-align: center;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 996px) {
|
|
||||||
.heroBanner {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
@ -1,13 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import clsx from 'clsx';
|
|
||||||
import Link from '@docusaurus/Link';
|
|
||||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
import Layout from '@theme/Layout';
|
import Layout from '@theme/Layout';
|
||||||
import TopicsSection from '../components/home/TopicsSection';
|
|
||||||
import HomeHeader from "../components/home/HomeHero";
|
|
||||||
import AboutSite from "../components/home/AboutSite";
|
|
||||||
|
|
||||||
import styles from './index.module.css';
|
|
||||||
|
|
||||||
export default function Home(): JSX.Element {
|
export default function Home(): JSX.Element {
|
||||||
const {siteConfig} = useDocusaurusContext();
|
const {siteConfig} = useDocusaurusContext();
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
title: Markdown page example
|
|
||||||
---
|
|
||||||
|
|
||||||
# Markdown page example
|
|
||||||
|
|
||||||
You don't need React to write simple standalone pages.
|
|
@ -2,6 +2,7 @@
|
|||||||
// This file is not used in compilation. It is here just for a nice editor experience.
|
// This file is not used in compilation. It is here just for a nice editor experience.
|
||||||
"extends": "@docusaurus/tsconfig",
|
"extends": "@docusaurus/tsconfig",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"jsx": "react",
|
||||||
"baseUrl": "."
|
"baseUrl": "."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user