service:cms
Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версия | ||
service:cms [14.08.2023 19:04] – [Расчёт размера картинок в галерее] viacheslav | service:cms [10.09.2024 14:49] (текущий) – [Установка] viacheslav | ||
---|---|---|---|
Строка 1: | Строка 1: | ||
+ | Требования: | ||
+ | - Подсветка кода - powershell, bash, yaml, dos | ||
+ | - Таблицы | ||
+ | - Галереи картинок | ||
+ | - Плейлист аудио | ||
+ | ====== Datenstrom Yellow ====== | ||
+ | https:// | ||
+ | https:// | ||
+ | [[https:// | ||
+ | |||
+ | ===== Настройки ===== | ||
+ | |||
+ | Page settings | ||
+ | |||
+ | The following settings can be configured at the top of a page: | ||
+ | < | ||
+ | Title = page title | ||
+ | TitleContent = page title shown in content | ||
+ | TitleNavigation = page title shown in navigation | ||
+ | TitleHeader = page title shown in web browser | ||
+ | TitleSlug = page title used for saving the page | ||
+ | Description = page description | ||
+ | Author = page author(s), comma separated | ||
+ | Email = email of page author | ||
+ | Language = page language, e.g. en | ||
+ | Layout = page layout | ||
+ | LayoutNew = page layout for creating a new page | ||
+ | Theme = page theme | ||
+ | Parser = page content parser | ||
+ | Status = page status, supported status values | ||
+ | Redirect = redirect to a new page or URL | ||
+ | Image = page image | ||
+ | ImageAlt = description of the page image | ||
+ | Modified = page modification date, YYYY-MM-DD format | ||
+ | Published = page publication date, YYYY-MM-DD format | ||
+ | Tag = page tag(s) for categorisation, | ||
+ | Generate = page option(s) for generating a static website, comma separated | ||
+ | Comment = page option(s) for showing comments, comma separated | ||
+ | </ | ||
+ | The following page status values are supported: | ||
+ | < | ||
+ | public = page is a normal page | ||
+ | private = page is not visible, user needs to enter password, requires private extension | ||
+ | draft = page is not visible, user needs to log in, requires draft extension | ||
+ | unlisted = page is not visible, but can be accessed with the correct link | ||
+ | shared = page is not visible, but can be included in other pages | ||
+ | </ | ||
+ | ===== Плагины ===== | ||
+ | https:// | ||
+ | https:// | ||
+ | https:// | ||
+ | ==== Установка ==== | ||
+ | Способ 1 (для официальных расширений): | ||
+ | Способ 2: Скопировать zip в system\extensions и обновить страницу сайта, архив сам распакуется и установится. | ||
+ | |||
+ | <code bash> | ||
+ | curl -L https:// | ||
+ | </ | ||
+ | ==== Картинки ==== | ||
+ | Одиночные: | ||
+ | |||
+ | '' | ||
+ | |||
+ | Name = file name\\ | ||
+ | Alt = description of the image, wrap multiple words into quotes\\ | ||
+ | Style = image style, e.g. left, center, right (или прочерк для значения по умолчанию)\\ | ||
+ | Width = image width, pixel or percent\\ | ||
+ | Height = image height, pixel or percent | ||
+ | |||
+ | Слайдер: | ||
+ | |||
+ | '' | ||
+ | |||
+ | Pattern = file name as regular expression\\ | ||
+ | Sorting = gallery sorting, e.g. name, modified, size\\ | ||
+ | Style = gallery style, e.g. loop, fade, slide\\ | ||
+ | Size = image size, pixel or percent\\ | ||
+ | Autoplay = play images automatically, | ||
+ | |||
+ | Галерея: | ||
+ | |||
+ | '' | ||
+ | |||
+ | Pattern = file name as regular expression\\ | ||
+ | Sorting = gallery sorting, e.g. name, modified, size\\ | ||
+ | Style = gallery style, e.g. zoom, simple\\ | ||
+ | Size = image size, pixel or percent | ||
+ | |||
+ | === Расчёт размера картинок в галерее === | ||
+ | <code powershell> | ||
+ | $width = 879 | ||
+ | $border = 4 | ||
+ | $row = read-host " | ||
+ | ($width - $border * ($row - 1)) / $row | ||
+ | </ | ||
+ | ==== Аудиоплеер ==== | ||
+ | https:// | ||
+ | {{: | ||
+ | < | ||
+ | [sound my_song.mp3] | ||
+ | [sound violin/ | ||
+ | [sound album=2214@funkwhale.it] | ||
+ | [sound track=3VM35337X7Ro1tesUHnZ95] | ||
+ | [sound playlist.m3u] | ||
+ | </ | ||
+ | ==== Подсветка синтаксиса ==== | ||
+ | Установка: | ||
+ | https:// | ||
+ | Языки: https:// | ||
+ | ==== Youtube ==== | ||
+ | Установка: | ||
+ | https:// | ||
+ | |||
+ | ==== Video ==== | ||
+ | https:// | ||
+ | |||
+ | ==== RSS feed ==== | ||
+ | Установка: | ||
+ | https:// | ||
+ | |||
+ | / | ||
+ | < | ||
+ | <a href="<? | ||
+ | </ | ||
+ | |||
+ | / | ||
+ | < | ||
+ | FeedFilter: blog | ||
+ | </ | ||
+ | https:// | ||
+ | |||
+ | ==== Typography ==== | ||
+ | https:// | ||
+ | |||
+ | ===== Обновление ===== | ||
+ | <code bash> | ||
+ | docker exec -it yellow-php php82 yellow.php update | ||
+ | Blog 0.8.28 | ||
+ | Copenhagen 0.8.15 | ||
+ | Core 0.8.123 | ||
+ | Edit 0.8.76 | ||
+ | Feed 0.8.21 | ||
+ | Markdown 0.8.26 | ||
+ | Search 0.8.29 | ||
+ | Update 0.8.95 | ||
+ | Yellow update: Updates are available. Please type 'php yellow.php update all'. | ||
+ | |||
+ | docker exec -it yellow-php php82 yellow.php update all | ||
+ | Yellow update: Website updated, 8 extensions updated | ||
+ | </ | ||
+ | |||
+ | ====== Ghost ====== | ||
+ | https:// | ||
+ | https:// | ||
+ | |||
+ | Доступ к админке: | ||
+ | |||
+ | ====== HTMLy ====== | ||
+ | https:// | ||
+ | https:// | ||
+ | ====== Pico ====== | ||
+ | https:// | ||
+ | https:// | ||
+ | |||
+ | ++++ Дерево каталогов проекта | | ||
+ | <code bash> | ||
+ | ├── docker-compose.yml | ||
+ | ├── nginx | ||
+ | │ ├── default.conf.template | ||
+ | │ └── Dockerfile | ||
+ | ├── php | ||
+ | │ └── Dockerfile | ||
+ | └── www # распакованный pico-release-v3.0.0-alpha.2.tar.gz | ||
+ | ├── assets | ||
+ | ├── CHANGELOG.md | ||
+ | ├── composer.json | ||
+ | ├── composer.lock | ||
+ | ├── config | ||
+ | ├── content | ||
+ | ├── CONTRIBUTING.md | ||
+ | ├── index.php | ||
+ | ├── LICENSE | ||
+ | ├── plugins | ||
+ | ├── README.md | ||
+ | ├── themes | ||
+ | └── vendor | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | ++++ docker-compose.yml | | ||
+ | <code yaml> | ||
+ | version: ' | ||
+ | |||
+ | services: | ||
+ | cmspico: | ||
+ | container_name: | ||
+ | depends_on: | ||
+ | - cmspico-php | ||
+ | build: ./nginx | ||
+ | restart: unless-stopped | ||
+ | environment: | ||
+ | NGINX_ROOT: / | ||
+ | NGINX_FASTCGI_PASS: | ||
+ | ports: | ||
+ | - 80:80 | ||
+ | volumes: | ||
+ | - ./ | ||
+ | |||
+ | cmspico-php: | ||
+ | container_name: | ||
+ | build: ./php | ||
+ | restart: unless-stopped | ||
+ | volumes: | ||
+ | - ./ | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | ++++ php/ | ||
+ | <code bash> | ||
+ | FROM alpine:3.18 | ||
+ | # ADD --chown=82: | ||
+ | WORKDIR / | ||
+ | |||
+ | RUN apk add --no-cache \ | ||
+ | php82 \ | ||
+ | php82-fpm \ | ||
+ | php82-mbstring \ | ||
+ | php82-dom && \ | ||
+ | addgroup -g 82 -S www-data || true && \ | ||
+ | adduser -u 82 -D -S -G www-data www-data || true && \ | ||
+ | sed -i '/ | ||
+ | chown -R 82: / | ||
+ | # tar -xf pico-release-v2.1.4.tar.gz && \ | ||
+ | # rm pico-release-v2.1.4.tar.gz && \ | ||
+ | |||
+ | EXPOSE 9000 | ||
+ | USER 82 | ||
+ | CMD [" | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | ++++ nginx | | ||
+ | <file bash Dockerfile> | ||
+ | FROM nginx: | ||
+ | |||
+ | WORKDIR / | ||
+ | |||
+ | COPY default.conf.template / | ||
+ | #COPY --chown=82: | ||
+ | </ | ||
+ | <file bash default.conf.template> | ||
+ | server { | ||
+ | listen 80; | ||
+ | index index.php index.html; | ||
+ | root ${NGINX_ROOT}; | ||
+ | |||
+ | location ~ \.php$ { | ||
+ | try_files $uri =404; | ||
+ | fastcgi_split_path_info ^(.+\.php)(/ | ||
+ | fastcgi_pass ${NGINX_FASTCGI_PASS}: | ||
+ | fastcgi_index index.php; | ||
+ | include fastcgi_params; | ||
+ | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
+ | fastcgi_param PATH_INFO $fastcgi_path_info; | ||
+ | } | ||
+ | |||
+ | location / { | ||
+ | try_files $uri $uri/ / | ||
+ | gzip_static on; | ||
+ | } | ||
+ | |||
+ | location ~ / | ||
+ | deny all; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | ====== Wordpress ====== | ||
+ | ===== Установка ===== | ||
+ | [[https:// | ||
+ | <code bash> | ||
+ | # Скачать последнюю версию | ||
+ | wget https:// | ||
+ | # Распаковать | ||
+ | unzip latest-ru_RU.zip | ||
+ | # Скопировать в корень веб-каталога | ||
+ | mv wordpress/* / | ||
+ | # Дать права веб-серверу | ||
+ | chown -R www-data: | ||
+ | # Сделать базу под названием wordpress: | ||
+ | mysql -u root -p -e " | ||
+ | </ | ||
+ | Далее зайти на веб-интерфейс и пройти пошаговую установку. | ||
+ | ===== Настройка ===== | ||
+ | <code bash> | ||
+ | # Симлинки - нужны, чтобы освободить место на системной флешке. | ||
+ | # После переноса папки wp-content на отдельную карточку SD, создаётся симлинк, | ||
+ | # чтобы Wordpress думал, что он кладёт данные туда же, куда и раньше. | ||
+ | # сделать симлинк на первый путь со второго | ||
+ | ln -s / | ||
+ | |||
+ | # заменить владельца симлинка на веб-сервер | ||
+ | chown -h www-data: | ||
+ | # рекурсивно заменить владельца файлов в новом расположении | ||
+ | chown -R www-data: | ||
+ | |||
+ | # Настроить максимальный размер файла на закачку в PHP | ||
+ | # Проверить версию PHP и путь к используемому php.ini, например, | ||
+ | # / | ||
+ | # / | ||
+ | sed -i ' | ||
+ | / | ||
+ | / | ||
+ | |||
+ | # Отключить листинг каталогов сайта | ||
+ | echo " | ||
+ | </ | ||
+ | |||
+ | ==== Воспроизведение аудиофайлов в браузере в Ubuntu ==== | ||
+ | Для этого нужно поставить кодеки: | ||
+ | <code bash> | ||
+ | sudo apt-get install ubuntu-restricted-extras | ||
+ | </ | ||
+ | |||
+ | ===== Миграция ===== | ||
+ | https:// | ||
+ | https:// | ||
+ | https:// | ||
+ | |||
+ | ==== Миграция на статику ==== | ||
+ | В Wordpress: Инструменты -> Экспорт -> Всё содержимое | ||
+ | |||
+ | <code bash> | ||
+ | docker run --rm --name node -it -v / | ||
+ | cd /app | ||
+ | wget https:// | ||
+ | unzip master.zip | ||
+ | cd wordpress-export-to-markdown-master/ | ||
+ | npm install && node index.js | ||
+ | |||
+ | Starting wizard... | ||
+ | ? Path to WordPress export file? ../ | ||
+ | ? Path to output folder? output | ||
+ | ? Create year folders? No | ||
+ | ? Create month folders? No | ||
+ | ? Create a folder for each post? Yes | ||
+ | ? Prefix post folders/ | ||
+ | ? Save images attached to posts? Yes | ||
+ | ? Save images scraped from post body content? Yes | ||
+ | ? Include custom post types and pages? No | ||
+ | |||
+ | Parsing... | ||
+ | 621 posts found. | ||
+ | 643 attached images found. | ||
+ | 525 images scraped from post body content. | ||
+ | |||
+ | Saving 621 posts (0 already exist)... | ||
+ | [OK] post-1 | ||
+ | [OK] post-2 | ||
+ | [OK] post-3 | ||
+ | ... | ||
+ | Done, got them all! | ||
+ | |||
+ | Downloading and saving 906 images (0 already exist)... | ||
+ | [OK] 0_35843_228d6bb_L.jpg | ||
+ | [OK] 0_35833_ef4db138_L.jpg | ||
+ | [OK] 0_35842_b0b48f84_L.jpg | ||
+ | ... | ||
+ | Done, but with 3 failed. | ||
+ | |||
+ | All done! | ||
+ | Look for your output files in: / | ||
+ | </ | ||
+ | https:// | ||
+ | https:// | ||
+ | |||
+ | |||
+ | |||
+ | ===== Полезные плагины ===== | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | |||
+ | ==== Использование SyntaxHighlighter Evolved ==== | ||
+ | [code lang=%%" | ||
+ | your code here\\ | ||
+ | [/code] | ||
+ | |||
+ | Если язык не указывать, | ||
+ | |||
+ | Список поддерживаемых языков: | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP half column> | ||
+ | * actionscript3 | ||
+ | * bash | ||
+ | * clojure | ||
+ | * coldfusion | ||
+ | * cpp | ||
+ | * csharp | ||
+ | * css | ||
+ | * delphi | ||
+ | * diff | ||
+ | * erlang | ||
+ | * fsharp | ||
+ | * groovy | ||
+ | * html | ||
+ | * java | ||
+ | * javafx | ||
+ | </ | ||
+ | |||
+ | <WRAP half column> | ||
+ | * javascript | ||
+ | * latex (you can also render LaTeX) | ||
+ | * matlab (keywords only) | ||
+ | * objc | ||
+ | * perl | ||
+ | * php | ||
+ | * powershell | ||
+ | * python | ||
+ | * r | ||
+ | * ruby | ||
+ | * scala | ||
+ | * sql | ||
+ | * text | ||
+ | * vb | ||
+ | * xml | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | https:// | ||
+ | ===== Хитрости ===== | ||
+ | ==== Как сделать название аудиофайла рядом с треком ==== | ||
+ | В данном случае название будет курсивом | ||
+ | <code html> | ||
+ | <p style=" | ||
+ | [audio mp3=" | ||
+ | </ | ||
+ | [[https:// | ||
+ | |||
+ | ==== Якоря в тексте ==== | ||
+ | Откуда: | ||
+ | <code html> | ||
+ | <a href="# | ||
+ | </ | ||
+ | Куда: | ||
+ | <code html> | ||
+ | <h3 id=" | ||
+ | </ | ||
+ | |||
+ | ==== Вставить приветствие на странице в зависимости от времени суток ==== | ||
+ | <code javascript daytime.js> | ||
+ | <script language=" | ||
+ | date = new Date(); | ||
+ | date = date.getHours(); | ||
+ | if (date >= 0 && date < 6) {document.write(" | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | ==== Код встраивания роликов с Youtube без лишних функций ==== | ||
+ | Заменить qhRL6SBHMsQ в коде на нужное значение | ||
+ | <code html youtube.html> | ||
+ | <iframe width=" | ||
+ | </ | ||
+ | |||
+ | ==== HTML и таблицы ==== | ||
+ | Пример таблицы для корректного отображения в Wordpress: | ||
+ | <code html> | ||
+ | <table style=" | ||
+ | < | ||
+ | <col style=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | [[https:// | ||
+ | |||
+ | ===== Решение проблем ===== | ||
+ | ==== " | ||
+ | Добавить в '' | ||
+ | <code php> | ||
+ | // Только не в конец файла, а сразу после настроек базы | ||
+ | $_SERVER[' | ||
+ | </ | ||
+ | |||
+ | https:// | ||
+ | |||
+ | ==== Array and string offset access syntax with curly braces is no longer supported ==== | ||
+ | После обновления PHP с 7.4 до 8.2 сайт не работает, | ||
+ | <code bash> | ||
+ | 2023/06/18 20:05:42 [error] 31#31: *451 FastCGI sent in stderr: "PHP message: PHP Fatal error: | ||
+ | Array and string offset access syntax with curly braces is no longer supported in | ||
+ | / | ||
+ | while reading response header from upstream, client: 172.18.0.11, | ||
+ | request: "GET / | ||
+ | upstream: " | ||
+ | </ | ||
+ | Решение: | ||
+ | <code php> | ||
+ | // Было | ||
+ | echo($str{0}); | ||
+ | // Стало | ||
+ | echo($str[0]); | ||
+ | </ | ||
+ | https:// | ||
+ | ===== Полезные ресурсы ===== | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | |||
+ | ====== Литература ====== | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | https:// |