From 961f623c2d6fb6f9298a28aca95e4912e19d2952 Mon Sep 17 00:00:00 2001 From: Stephan Hadan Date: Tue, 28 Jan 2025 09:02:00 +0100 Subject: [PATCH] first commit --- .forgejo/workflows/deploy.yml | 39 ++++++++++++++++++++++++++++++++++ .gitignore | 3 +++ .gitmodules | 3 +++ archetypes/default.md | 5 +++++ hugo.toml | 40 +++++++++++++++++++++++++++++++++++ static/admin/config.yml | 22 +++++++++++++++++++ static/admin/index.html | 13 ++++++++++++ themes/internet-weblog | 1 + 8 files changed, 126 insertions(+) create mode 100644 .forgejo/workflows/deploy.yml create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 archetypes/default.md create mode 100644 hugo.toml create mode 100644 static/admin/config.yml create mode 100644 static/admin/index.html create mode 160000 themes/internet-weblog diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml new file mode 100644 index 0000000..28d434e --- /dev/null +++ b/.forgejo/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: Build,test and deploy reaktionsfaehig.net +run-name: ${{ gitea.actor }} is building, testing and deploying the static page +on: + push: + branches: + - main + +jobs: + deploy-prod: + runs-on: ubuntu-latest + steps: + - run: echo "The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Install apt packages + run: apt update && apt install -y jq rsync + - name: Get latest Hugo version + run: | + url=$(curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | jq -r '.assets[] | select(.name | contains("linux-amd64.tar.gz")) | .browser_download_url' | grep -E 'hugo_[0-9]+\.[0-9]+\.[0-9]+_linux-amd64.tar.gz') + wget -P /tmp/hugo/ "$url" + version=$(echo "$url" | grep -oP 'hugo_\K[0-9]+\.[0-9]+\.[0-9]+') + echo "Downloaded Hugo version: $version" + - name: Unpack Hugo + run: tar -xf /tmp/hugo/* -C ${{ gitea.workspace }}/bin + - name: Build the static webpage + run: ${{ gitea.workspace }}/bin/hugo --minify + - name: Test static page + run: bash ${{ gitea.workspace }}/bin/test_static_page.sh + - name: Create private key + run: | + echo "${{ secrets.ACT_RUNNER_KEY }}" > /tmp/act_runner_key + chmod 600 /tmp/act_runner_key + - name: rsync public directory + run: | + /usr/bin/rsync -avz --delete -e "ssh -i /tmp/act_runner_key -o StrictHostKeyChecking=no" ${{ gitea.workspace }}/public/* root@vps03.hadan-it.com:/data/webspace/reaktionsfaehig.net/ + - run: echo "This job's status is ${{ job.status }}." diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c84b44a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +public/ +.hugo_build.lock diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..30a0694 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/internet-weblog"] + path = themes/internet-weblog + url = ssh://git@git.hadan-it.com:222/stiebke/hugo-internet-weblog.git 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/hugo.toml b/hugo.toml new file mode 100644 index 0000000..2d2da45 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,40 @@ +baseURL = 'https://reaktionsfaehig.net/' +languageCode = 'de-DE' +title = 'reaktionsfaehig' +theme = 'internet-weblog' + +[markup.goldmark.renderer] +unsafe=true + +[author] + Handle = "jnjosh" + FirstName = "Josh" + LastName = "Johnson" + AboutPage = "/about" + Location = "Durham, NC" + FlickrID = "87151163@N00" + +[params] + Description = "Internet weblog of Software (Mac, iOS, Web) Developer, Josh Johnson." + ShowCopyright = true + RSSEnabled = true + EnablePreferredDarkAppearance = true + RSSMicropostTitles = false + mainSections = [ "posts", "microposts", "photos" ] + +[taxonomies] + tag = "tags" + category = "categories" + series = "series" + +[[menu.main]] + name = "Post Archive" + weight = 1 + identifier = "posts" + url = "/posts/" + +[[menu.main]] + name = "Photography" + weight = 2 + identifier = "photoography" + url = "https://jnjosh.photography" diff --git a/static/admin/config.yml b/static/admin/config.yml new file mode 100644 index 0000000..f3b4a81 --- /dev/null +++ b/static/admin/config.yml @@ -0,0 +1,22 @@ +# when using the default proxy server port +local_backend: true + +backend: + name: git-gateway + branch: main +media_folder: static/img +public_folder: /img +collections: + - name: 'posts' + label: 'Posts' + folder: 'content/posts' + create: true + slug: '{{year}}-{{month}}-{{day}}-{{slug}}' + editor: + preview: false + fields: + - { label: 'Title', name: 'title', widget: 'string' } + - { label: 'Publish Date', name: 'date', widget: 'datetime' } + - { label: 'Description', name: 'description', widget: 'string' } + - { label: 'Body', name: 'body', widget: 'markdown' } + diff --git a/static/admin/index.html b/static/admin/index.html new file mode 100644 index 0000000..790f7a8 --- /dev/null +++ b/static/admin/index.html @@ -0,0 +1,13 @@ + + + + + + + Content Manager + + + + + + diff --git a/themes/internet-weblog b/themes/internet-weblog new file mode 160000 index 0000000..d654868 --- /dev/null +++ b/themes/internet-weblog @@ -0,0 +1 @@ +Subproject commit d654868451991e917e21821ce4ca261a35a9f197