Add astro framework and update nodejs
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -4,10 +4,13 @@
|
||||
.config/
|
||||
.home/
|
||||
|
||||
output_*
|
||||
node_modules/
|
||||
dist/
|
||||
.astro/
|
||||
|
||||
# Legacy (удалить после завершения миграции)
|
||||
output_*
|
||||
var/
|
||||
vendor/
|
||||
|
||||
.php_cs.cache
|
||||
.php-cs-fixer.cache
|
||||
|
||||
76
Taskfile.yml
76
Taskfile.yml
@@ -9,103 +9,39 @@ vars:
|
||||
sh: id -g
|
||||
|
||||
PROJECT: "homepage"
|
||||
PHP_IMAGE: "{{.PROJECT}}-php"
|
||||
NODE_IMAGE: "{{.PROJECT}}-node"
|
||||
NODE_IMAGE: "{{.PROJECT}}-node"
|
||||
|
||||
DOCKER_COMMON_OPTS: >-
|
||||
--rm
|
||||
--interactive
|
||||
--tty
|
||||
--user {{.USER_ID}}:{{.GROUP_ID}}
|
||||
--volume /etc/passwd:/etc/passwd:ro
|
||||
--volume /etc/group:/etc/group:ro
|
||||
--volume "./:/srv/app"
|
||||
--workdir "/srv/app"
|
||||
-e XDG_CONFIG_HOME=/srv/app/.config
|
||||
-e XDG_CACHE_HOME=/srv/app/.cache
|
||||
-e HOME=/srv/app/.home
|
||||
|
||||
tasks:
|
||||
|
||||
build-docker:
|
||||
cmds:
|
||||
- docker build --file docker/php/Dockerfile --tag "{{.PHP_IMAGE}}" .
|
||||
- docker build --file docker/node/Dockerfile --tag "{{.NODE_IMAGE}}" .
|
||||
|
||||
composer:
|
||||
cmds:
|
||||
- docker run {{.DOCKER_COMMON_OPTS}} "{{.PHP_IMAGE}}" composer {{.CLI_ARGS}}
|
||||
|
||||
npm:
|
||||
cmds:
|
||||
- docker run {{.DOCKER_COMMON_OPTS}} "{{.NODE_IMAGE}}" npm {{.CLI_ARGS}}
|
||||
|
||||
sculpin:
|
||||
install:
|
||||
cmds:
|
||||
- docker run {{.DOCKER_COMMON_OPTS}} "{{.PHP_IMAGE}}" ./vendor/bin/sculpin {{.CLI_ARGS}}
|
||||
|
||||
shell-node:
|
||||
cmds:
|
||||
- docker run {{.DOCKER_COMMON_OPTS}} "{{.NODE_IMAGE}}" bash
|
||||
|
||||
install-dependencies:
|
||||
cmds:
|
||||
- task: composer
|
||||
vars: { CLI_ARGS: "install" }
|
||||
- task: npm
|
||||
vars: { CLI_ARGS: "install" }
|
||||
|
||||
format-pages:
|
||||
dev:
|
||||
cmds:
|
||||
- task: npm
|
||||
vars: { CLI_ARGS: 'run format-md' }
|
||||
|
||||
format-assets:
|
||||
cmds:
|
||||
- task: npm
|
||||
vars: { CLI_ARGS: 'run format-webpack' }
|
||||
- task: npm
|
||||
vars: { CLI_ARGS: 'run format-js' }
|
||||
- task: npm
|
||||
vars: { CLI_ARGS: 'run format-vue' }
|
||||
- task: npm
|
||||
vars: { CLI_ARGS: 'run format-style' }
|
||||
|
||||
format-php:
|
||||
cmds:
|
||||
- docker run {{.DOCKER_COMMON_OPTS}} "{{.PHP_IMAGE}}" php-cs-fixer fix
|
||||
|
||||
build-dev:
|
||||
vars:
|
||||
APP_OUTPUT_DIR: output_dev
|
||||
NPM_SCRIPT: build
|
||||
APP_ENV: dev
|
||||
APP_URL: homepage.site
|
||||
cmds:
|
||||
- rm -rf ./{{.APP_OUTPUT_DIR}}/*
|
||||
- task: npm
|
||||
vars: { CLI_ARGS: 'run {{.NPM_SCRIPT}}' }
|
||||
- task: sculpin
|
||||
vars: { CLI_ARGS: 'generate --env="{{.APP_ENV}}" --url="{{.APP_URL}}" --no-interaction -vv' }
|
||||
- docker run {{.DOCKER_COMMON_OPTS}} -p 4321:4321 "{{.NODE_IMAGE}}" npm run dev
|
||||
|
||||
build-prod:
|
||||
vars:
|
||||
APP_OUTPUT_DIR: output_prod
|
||||
NPM_SCRIPT: build-prod
|
||||
APP_ENV: prod
|
||||
APP_URL: https://vakhrushev.me
|
||||
cmds:
|
||||
- rm -rf ./{{.APP_OUTPUT_DIR}}/*
|
||||
- task: npm
|
||||
vars: { CLI_ARGS: 'run {{.NPM_SCRIPT}}' }
|
||||
- task: sculpin
|
||||
vars: { CLI_ARGS: 'generate --env="{{.APP_ENV}}" --url="{{.APP_URL}}" --no-interaction -vv' }
|
||||
|
||||
make-post:
|
||||
vars:
|
||||
POST_DATE:
|
||||
sh: date +'%Y-%m-%d'
|
||||
cmd: touch "source/_articles/{{.POST_DATE}}-new-post.md"
|
||||
- docker run {{.DOCKER_COMMON_OPTS}} "{{.NODE_IMAGE}}" npm run build
|
||||
|
||||
deploy:
|
||||
vars:
|
||||
@@ -123,7 +59,7 @@ tasks:
|
||||
|
||||
deploy-with-ansible:
|
||||
internal: true
|
||||
requires:
|
||||
requires:
|
||||
vars: [DOCKER_IMAGE]
|
||||
dir: '/home/av/projects/private/pet-project-server'
|
||||
cmds:
|
||||
|
||||
12
astro.config.mjs
Normal file
12
astro.config.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
import { defineConfig } from 'astro/config';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import vue from '@astrojs/vue';
|
||||
import sitemap from '@astrojs/sitemap';
|
||||
|
||||
export default defineConfig({
|
||||
site: 'https://vakhrushev.me',
|
||||
integrations: [vue(), sitemap()],
|
||||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
},
|
||||
});
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM nginx:stable
|
||||
|
||||
COPY output_prod /usr/share/nginx/html
|
||||
COPY dist /usr/share/nginx/html
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
FROM node:12
|
||||
|
||||
ENV npm_config_fund=false
|
||||
ENV npm_config_update_notifier=false
|
||||
FROM node:22-slim
|
||||
|
||||
WORKDIR /srv/app
|
||||
|
||||
14706
package-lock.json
generated
14706
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
59
package.json
59
package.json
@@ -1,49 +1,22 @@
|
||||
{
|
||||
"name": "homepage",
|
||||
"author": "Anton Vakhrushev",
|
||||
"license": "",
|
||||
"version": "1.0.0",
|
||||
"description": "Homepage",
|
||||
"devDependencies": {
|
||||
"@anwinged/predictor": "^0.2.1",
|
||||
"@babel/core": "^7.14.6",
|
||||
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
||||
"@babel/plugin-transform-runtime": "^7.14.5",
|
||||
"@babel/preset-env": "^7.14.7",
|
||||
"@babel/runtime": "^7.14.6",
|
||||
"autoprefixer": "^9.8.6",
|
||||
"babel-loader": "^8.2.2",
|
||||
"css-loader": "^2.1.1",
|
||||
"glob": "^7.1.7",
|
||||
"mini-css-extract-plugin": "^0.6.0",
|
||||
"node-sass": "^4.14.1",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"prettier": "^1.19.1",
|
||||
"sass-loader": "^7.3.1",
|
||||
"style-loader": "^0.23.1",
|
||||
"underscore": "^1.13.1",
|
||||
"vue": "^2.6.14",
|
||||
"vue-loader": "^15.9.7",
|
||||
"vue-style-loader": "^4.1.3",
|
||||
"vue-template-compiler": "^2.6.14",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
},
|
||||
"version": "2.0.0",
|
||||
"type": "module",
|
||||
"description": "Anton Vakhrushev homepage",
|
||||
"scripts": {
|
||||
"watch": "",
|
||||
"build": "webpack --config webpack.config.js --progress",
|
||||
"build-prod": "webpack --config webpack.config.js --env.production",
|
||||
"format-webpack": "prettier --single-quote --trailing-comma es5 --write \"./webpack.config.js\"",
|
||||
"format-js": "prettier --single-quote --trailing-comma es5 --write \"./source/_assets/**/*.js\"",
|
||||
"format-vue": "prettier --single-quote --trailing-comma es5 --write \"./source/_assets/**/*.vue\"",
|
||||
"format-style": "prettier --single-quote --write \"source/_assets/**/*.scss\"",
|
||||
"format-md": "prettier --print-width=80 --parser=markdown --write \"source/**/*.md\""
|
||||
"dev": "astro dev --host 0.0.0.0",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview --host 0.0.0.0"
|
||||
},
|
||||
"dependencies": {},
|
||||
"browserslist": [
|
||||
"last 5 version",
|
||||
"> 1%",
|
||||
"maintained node versions",
|
||||
"not dead"
|
||||
]
|
||||
"dependencies": {
|
||||
"astro": "^5",
|
||||
"@astrojs/vue": "^5",
|
||||
"@astrojs/sitemap": "^3",
|
||||
"@astrojs/rss": "^4",
|
||||
"@astrojs/mdx": "^4",
|
||||
"vue": "^3",
|
||||
"tailwindcss": "^4",
|
||||
"@tailwindcss/vite": "^4"
|
||||
}
|
||||
}
|
||||
|
||||
13
src/pages/index.astro
Normal file
13
src/pages/index.astro
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
---
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Антон Вахрушев</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Антон Вахрушев</h1>
|
||||
<p>Сайт в процессе обновления.</p>
|
||||
</body>
|
||||
</html>
|
||||
12
src/styles/global.css
Normal file
12
src/styles/global.css
Normal file
@@ -0,0 +1,12 @@
|
||||
@import 'tailwindcss';
|
||||
|
||||
@theme {
|
||||
--font-serif: 'PT Serif', serif;
|
||||
--font-mono: 'Source Code Pro', monospace;
|
||||
|
||||
--color-text: #24292e;
|
||||
--color-link: #0366d6;
|
||||
--color-rule: #e6e6e6;
|
||||
|
||||
--breakpoint-content: 740px;
|
||||
}
|
||||
3
tsconfig.json
Normal file
3
tsconfig.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "astro/tsconfigs/strict"
|
||||
}
|
||||
Reference in New Issue
Block a user