diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5462e83 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +public +.hugo_build.lock diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..5c9f949 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,33 @@ +name: Build and Deploy + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Login to registry + run: | + echo "${{ secrets.GIT_PASS }}" | \ + docker login git.ada-dev.ru -u ${{ secrets.GIT_USER }} --password-stdin + + - name: Build and push + run: | + docker build -t git.ada-dev.ru/${{ gitea.repository }}:latest . + docker push git.ada-dev.ru/${{ gitea.repository }}:latest + + - name: Deploy container + run: | + docker stop ada-dev-ru 2>/dev/null || true + docker rm ada-dev-ru 2>/dev/null || true + docker run -d \ + --name ada-dev-ru \ + --restart unless-stopped \ + -p 8081:80 \ + git.ada-dev.ru/${{ gitea.repository }}:latest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8dd6d56 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +public/ +.hugo_build.lock diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7983bb3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM hugomods/hugo:exts AS builder +WORKDIR /site +COPY . . +RUN hugo --minify + +FROM nginx:alpine +COPY --from=builder /site/public /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..25b6752 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +date = '{{ .Date }}' +draft = true +title = '{{ replace .File.ContentBaseName "-" " " | title }}' ++++ diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..70e1383 --- /dev/null +++ b/content/_index.md @@ -0,0 +1,7 @@ ++++ ++++ + +
+ Projects + Notes +
diff --git a/content/posts/_index.md b/content/posts/_index.md new file mode 100644 index 0000000..7d018e5 --- /dev/null +++ b/content/posts/_index.md @@ -0,0 +1,3 @@ ++++ +title = "Notes" ++++ diff --git a/content/projects/_index.md b/content/projects/_index.md new file mode 100644 index 0000000..5f62ad6 --- /dev/null +++ b/content/projects/_index.md @@ -0,0 +1,3 @@ ++++ +title = "Projects" ++++ diff --git a/content/projects/neural-network.md b/content/projects/neural-network.md new file mode 100644 index 0000000..9643589 --- /dev/null +++ b/content/projects/neural-network.md @@ -0,0 +1,7 @@ ++++ +title = "Hopfield & Hemming Platground" +description = "Визуализация работы сетей Хопфилда и Хэмминга" +tags = ["ruby", "math", "ml"] +externalUrl = "https://projects.ada-dev.ru/neural" +weight = 1 ++++ diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..6353e09 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,114 @@ +baseURL = 'https://ada-dev.ru/' +locale = 'ru-ru' +title = 'Dmitry Antipenko' +theme = "gokarna" +enableRobotsTXT = true + +[params] + avatarURL = "/images/avatar.webp" + avatarAltText = "Dmitry" + showBackToTopButton = true + + customHeadHTML = """ + + """ + + customFooterHTML = """ + + """ + + socialIcons = [ + {name = "github", url = "https://github.com/ada-dmitry"}, + {name = "telegram", url = "https://t.me/moonlosk"}, + {name = "email", url = "mailto:ada.dmitry@gmail.com"} + ] + +[menu] + [[menu.main]] + identifier = "github" + pre = "" + url = "https://github.com/ada-dmitry" + weight = 3 + [menu.main.params] + NewPage = true + +[markup] + [markup.goldmark.renderer] + unsafe = true + [markup.tableOfContents] + startLevel = 1 + endLevel = 4 + ordered = false + +[minify] + minifyOutput = true diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..9bed66b --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,59 @@ +{{ define "main" }} +
+
+ {{ if isset .Site.Params "avatarurl" }} + {{ .Site.Params.AvatarAltText | default + {{ end }} +
+ +

{{ .Site.Title }}

+ {{ if isset .Site.Params "description" }} +

{{ .Site.Params.Description }}

+ {{ end }} +
+ +
+ +{{ if isset .Site.Params "socialicons" }} +
+ +
+{{ end }} + +{{ if (or + (and (fileExists "content/_index.md") .Content) + (fileExists "content/index-about.md")) }} +
+ {{ or .Content (readFile "index-about.md" | markdownify) }} +
+{{ end }} + +{{ if isset .Site.Params "showpostsonhomepage" }} +
+

{{ i18n (.Site.Params.ShowPostsOnHomePage | humanize) }}

+ + {{ $posts := where .Site.Pages "Params.type" "post" }} + + {{ if eq .Site.Params.ShowPostsOnHomePage "popular" }} + {{ range $posts.ByWeight | first (or .Site.Params.NumberPostsOnHomePage 4) }} + {{- partial "list-posts.html" . -}} + {{ end }} + {{ else if eq .Site.Params.ShowPostsOnHomePage "recent" }} + {{ range $posts.ByDate.Reverse | first (or .Site.Params.NumberPostsOnHomePage 4) }} + {{- partial "list-posts.html" . -}} + {{ end }} + {{ end }} +
+{{ end }} + +{{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..4d78916 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,59 @@ +
+ +
diff --git a/layouts/projects/list.html b/layouts/projects/list.html new file mode 100644 index 0000000..3c3e59e --- /dev/null +++ b/layouts/projects/list.html @@ -0,0 +1,29 @@ +{{ define "main" }} +
+

{{ .Title }}

+
+ {{ range .Pages.ByWeight }} + {{ $url := .Permalink }} + {{ if .Params.externalUrl }}{{ $url = .Params.externalUrl }}{{ end }} + +
+ {{ .Title }} + +
+ {{ if .Params.description }} +

{{ .Params.description }}

+ {{ end }} + {{ if .Params.tags }} +
+ {{ range .Params.tags }} + {{ . }} + {{ end }} +
+ {{ end }} +
+ {{ end }} +
+
+{{ end }} diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..56dd67d --- /dev/null +++ b/nginx.conf @@ -0,0 +1,11 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ =404; + } + + error_page 404 /404.html; +} diff --git a/static/images/avatar.webp b/static/images/avatar.webp new file mode 100644 index 0000000..2158a91 Binary files /dev/null and b/static/images/avatar.webp differ diff --git a/static/nn/index.html b/static/nn/index.html new file mode 100644 index 0000000..d7d6eb0 --- /dev/null +++ b/static/nn/index.html @@ -0,0 +1,12 @@ + + + + + + + Редирект... + + + Переходим... + + diff --git a/static/svg/icons/telegram.svg b/static/svg/icons/telegram.svg new file mode 100644 index 0000000..7b2d8b8 --- /dev/null +++ b/static/svg/icons/telegram.svg @@ -0,0 +1,3 @@ + + +