From 8b0111450b900dd6278031c4288225a4c93d0e09 Mon Sep 17 00:00:00 2001 From: Yasuaki Uechi Date: Tue, 8 Jun 2021 16:50:52 +0900 Subject: [PATCH] add nginx --- .github/workflows/docker.yml | 61 ++++++++++++++++++++++++++++++++ Dockerfile | 5 +++ README.md | 1 + docker-compose.yml | 8 +++++ nginx.conf | 46 ++++++++++++++++++++++++ package.json | 2 +- source/TERMINAL | 8 +++++ themes/uio/LICENSE | 2 +- themes/uio/layout/post.ejs | 14 +++++--- themes/uio/source/css/index.scss | 4 ++- themes/uio/source/css/post.scss | 9 +++-- 11 files changed, 149 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/docker.yml create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 nginx.conf create mode 100644 source/TERMINAL diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..30b63a0 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,61 @@ +# https://hexo.io/docs/github-pages.html +name: Docker + +on: + push: + branches: + - source # default branch + +jobs: + pages: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Set up Pandoc + run: | + sudo apt-get update + sudo apt-get install pandoc -y + + - name: Use Node.js 15.x + uses: actions/setup-node@v1 + with: + node-version: "15.x" + + - name: Cache NPM dependencies + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.OS }}-npm-cache + restore-keys: | + ${{ runner.OS }}-npm-cache + + - name: Install Dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: ghcr.io/uetchy/uechi.io:latest + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..70b4195 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx:stable-alpine + +COPY nginx.conf /etc/nginx/nginx.conf + +COPY public /var/www/html/ \ No newline at end of file diff --git a/README.md b/README.md index c475468..e9e235d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ ## Build ``` +n 15 yarn build ``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..22289e3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: "3" + +services: + web: + image: ghcr.io/uetchy/uechi.io + build: . + ports: + - "8080:80" diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..b2bf2f4 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,46 @@ +worker_processes auto; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + access_log /var/log/nginx/access.log; + + sendfile on; + keepalive_timeout 65; + + server { + listen 80; + + root /var/www/html; + error_page 404 /404.html; + + location /404.html { + internal; + } + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + location / { + index index.html; + try_files $uri $uri.html $uri/index.html =404; + } + + location = / { + if ($http_user_agent ~ curl) { + rewrite / /TERMINAL last; + } + } + } +} diff --git a/package.json b/package.json index c1af237..4d4f25e 100644 --- a/package.json +++ b/package.json @@ -39,4 +39,4 @@ "version": "5.4.0" }, "private": true -} \ No newline at end of file +} diff --git a/source/TERMINAL b/source/TERMINAL new file mode 100644 index 0000000..5bf18a9 --- /dev/null +++ b/source/TERMINAL @@ -0,0 +1,8 @@ + +░█░█░█▀▀░█▀▀░█░█░▀█▀░░░░▀█▀░█▀█ +░█░█░█▀▀░█░░░█▀█░░█░░░░░░█░░█░█ +░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░░▀▀▀░▀▀▀ + +GitHub: https://github.com/uetchy +Twitter: https://twitter.com/uechz +Wallpaper: https://uechi.io/wallpaper diff --git a/themes/uio/LICENSE b/themes/uio/LICENSE index b66effa..3963c3a 100755 --- a/themes/uio/LICENSE +++ b/themes/uio/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 snovey +Copyright (c) 2021 Yasuaki Uechi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/themes/uio/layout/post.ejs b/themes/uio/layout/post.ejs index 1f27db1..2863c11 100755 --- a/themes/uio/layout/post.ejs +++ b/themes/uio/layout/post.ejs @@ -1,11 +1,15 @@
<%- page.content %>
diff --git a/themes/uio/source/css/index.scss b/themes/uio/source/css/index.scss index c8ba9d7..3a4f599 100644 --- a/themes/uio/source/css/index.scss +++ b/themes/uio/source/css/index.scss @@ -9,6 +9,7 @@ $break-large: 840px; --accent: #4f33e8; --highlight: #f6f6f6; --tone: #989898; + --dim: rgb(203, 203, 203); } @media (prefers-color-scheme: dark) { @@ -18,6 +19,7 @@ $break-large: 840px; --accent: #7033e8; --highlight: #140d25; --tone: #989898; + --dim: rgb(90, 83, 101); } } @@ -33,7 +35,7 @@ body { font-family: "PT Sans", "Hiragino Sans", "Hiragino Mincho ProN", sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; - font-feature-settings: "kern", "palt", "pwid"; + font-feature-settings: "kern", "pwid"; -webkit-font-feature-settings: "kern", "palt", "pwid"; -moz-font-feature-settings: "kern", "palt", "pwid"; -moz-font-feature-settings: "kern=1", "palt", "pwid"; diff --git a/themes/uio/source/css/post.scss b/themes/uio/source/css/post.scss index 8994397..14d1d54 100644 --- a/themes/uio/source/css/post.scss +++ b/themes/uio/source/css/post.scss @@ -89,14 +89,17 @@ a.article-list__item__button { .article__pubdate { color: var(--tone); - font-size: 14px; - font-weight: lighter; - font-family: sans-serif; + font-size: 18px; + font-weight: 300; margin-bottom: 10px; border: 1px solid var(--tone); display: inline-block; padding: 5px 20px; + b { + font-weight: 700; + } + @media screen and (max-width: $break-small) { margin-bottom: 15px; font-size: 10pt;