Skip to content

Commit e27a3eb

Browse files
committed
Merge branch 'develop' of github.com:fumiX/fuBlog into develop
2 parents 1cfe9ee + 5c0708a commit e27a3eb

File tree

18 files changed

+2325
-1060
lines changed

18 files changed

+2325
-1060
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 5
1313
steps:
14-
- uses: actions/checkout@v3
14+
# See https://github.com/Automattic/node-canvas/issues/599#issuecomment-1336370909
15+
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
16+
- uses: actions/checkout@v4
1517
- name: Setup Node.js
16-
uses: actions/setup-node@v3
18+
uses: actions/setup-node@v4
1719
with:
1820
node-version-file: '.node-version'
1921
cache: 'npm'
@@ -26,15 +28,16 @@ jobs:
2628
runs-on: ubuntu-latest
2729
timeout-minutes: 5
2830
steps:
29-
- uses: actions/checkout@v3
31+
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
32+
- uses: actions/checkout@v4
3033
- name: Cache build
3134
id: cache-build
32-
uses: actions/cache@v3
35+
uses: actions/cache@v4
3336
with:
3437
path: node_modules/.cache/nx
3538
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-build
3639
- name: Setup Node.js
37-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@v4
3841
with:
3942
node-version-file: '.node-version'
4043
cache: 'npm'
@@ -55,44 +58,46 @@ jobs:
5558
portal
5659
]
5760
steps:
58-
- uses: actions/checkout@v3
61+
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
62+
- uses: actions/checkout@v4
5963
- name: Cache build
6064
id: cache-build
61-
uses: actions/cache@v3
65+
uses: actions/cache@v4
6266
with:
6367
path: node_modules/.cache/nx
6468
key: ${{ runner.os }}-nx-${{ hashFiles('package-lock.json') }}
6569
- name: Setup Node.js
66-
uses: actions/setup-node@v3
70+
uses: actions/setup-node@v4
6771
with:
6872
node-version-file: '.node-version'
6973
cache: 'npm'
7074
cache-dependency-path: 'package-lock.json'
7175
- run: npm ci
7276
- run: npx lerna run build --scope=@fumix/fu-blog-${{ matrix.workspace }}
7377
- run: echo "This file is placed at the project root, so Github preserves the artifact paths (see https://github.com/actions/upload-artifact/issues/206)" > root.txt
74-
- uses: actions/upload-artifact@v3
78+
- uses: actions/upload-artifact@v4
7579
with:
76-
name: dist
80+
name: dist-${{ matrix.workspace }}
7781
path: | # Important to use `|` to preserve the path (see https://github.com/actions/upload-artifact/issues/55#issuecomment-633825395)
7882
${{ matrix.workspace }}/dist/**
79-
root.txt
83+
root-${{ matrix.workspace }}.txt
8084
if-no-files-found: error
8185

8286
test:
8387
needs: build-app
8488
runs-on: ubuntu-latest
8589
timeout-minutes: 15
8690
steps:
87-
- uses: actions/checkout@v3
91+
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
92+
- uses: actions/checkout@v4
8893
- name: Cache build
8994
id: cache-build
90-
uses: actions/cache@v3
95+
uses: actions/cache@v4
9196
with:
9297
path: node_modules/.cache/nx
9398
key: ${{ runner.os }}-nx-${{ hashFiles('package-lock.json') }}
9499
- name: Setup Node.js
95-
uses: actions/setup-node@v3
100+
uses: actions/setup-node@v4
96101
with:
97102
node-version-file: '.node-version'
98103
cache: 'npm'
@@ -111,10 +116,12 @@ jobs:
111116
contents: read
112117
packages: write
113118
steps:
114-
- uses: actions/checkout@v3
115-
- uses: actions/download-artifact@v3
119+
- run: sudo apt-get install -y libsdl-pango-dev libgif-dev
120+
- uses: actions/checkout@v4
121+
- uses: actions/download-artifact@v4
116122
with:
117-
name: dist
123+
pattern: dist-*
124+
merge-multiple: true
118125
- run: |
119126
cp -r server/dist/* docker/app/
120127
cp -rT server/test-data/ docker/app/test-data/
@@ -126,17 +133,17 @@ jobs:
126133
npm install
127134
- name: Extract metadata (tags, labels) for Docker
128135
id: meta
129-
uses: docker/metadata-action@v4
136+
uses: docker/metadata-action@v5
130137
with:
131138
images: ${{ env.REGISTRY }}/${{ github.repository }}-app
132139
- name: Log in to the Container registry
133-
uses: docker/login-action@v2
140+
uses: docker/login-action@v3
134141
with:
135142
registry: ${{ env.REGISTRY }}
136143
username: ${{ github.actor }}
137144
password: ${{ secrets.GITHUB_TOKEN }}
138145
- name: Build and push Docker image
139-
uses: docker/build-push-action@v3
146+
uses: docker/build-push-action@v6
140147
with:
141148
context: docker/app
142149
push: true
@@ -160,10 +167,10 @@ jobs:
160167
en_US
161168
]
162169
steps:
163-
- uses: actions/checkout@v3
170+
- uses: actions/checkout@v4
164171
- name: Extract metadata (tags, labels) for Docker
165172
id: meta
166-
uses: docker/metadata-action@v4
173+
uses: docker/metadata-action@v5
167174
with:
168175
images: ${{ env.REGISTRY }}/${{ github.repository }}-postgres
169176
labels: |
@@ -178,13 +185,13 @@ jobs:
178185
latest=auto
179186
suffix=-${{ matrix.language }},onlatest=true
180187
- name: Log in to the Container registry
181-
uses: docker/login-action@v2
188+
uses: docker/login-action@v3
182189
with:
183190
registry: ${{ env.REGISTRY }}
184191
username: ${{ github.actor }}
185192
password: ${{ secrets.GITHUB_TOKEN }}
186193
- name: Build and push Docker image
187-
uses: docker/build-push-action@v3
194+
uses: docker/build-push-action@v6
188195
with:
189196
build-args: |
190197
language=${{ matrix.language }}

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.14.0
1+
22

client/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fumix/fu-blog-client",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"scripts": {
55
"start": "vite --port 5010",
66
"build": "run-p type-check build-only",
@@ -31,7 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@intlify/unplugin-vue-i18n": "^4.0.0",
34-
"@material/web": "^1.5.0",
34+
"@material/web": "^2.0.0",
3535
"@rushstack/eslint-patch": "^1.10.3",
3636
"@tsconfig/node20": "^20.1.4",
3737
"@types/bootstrap": "^5.2.10",
@@ -41,7 +41,7 @@
4141
"@vue/eslint-config-prettier": "^9.0.0",
4242
"@vue/eslint-config-typescript": "^13.0.0",
4343
"@vue/tsconfig": "^0.5.1",
44-
"eslint": "^8.56.0",
44+
"eslint": "^8.57.0",
4545
"eslint-plugin-vue": "^9.26.0",
4646
"sass": "^1.59.2",
4747
"typescript": "^5.0.4",

client/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ console.log(
140140
█ ███ █
141141
██ █ ██ fuBlog
142142
███████
143-
██ █ ██ ${(appData.isProduction ? appData.appVersion ?? "‹unknown›" : "development version") + " "}
143+
██ █ ██ ${(appData.isProduction ? (appData.appVersion ?? "‹unknown›") : "development version") + " "}
144144
█ ███ █
145145
███████`,
146146
`color:#ff9c00;background:rgb(48, 48, 48);display:inline-block`,

client/src/assets/scss/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pre {
4646

4747
.card-body {
4848
svg {
49+
line-height:1.1; /* Prevent text from clipping in diagram boxes */
4950
max-width: 100%;
5051
background: transparent !important;
5152
}

client/src/util/api-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class AuthEndpoints {
9090
static async getLoggedInUser(): Promise<LoggedInUserInfo> {
9191
const token = loadIdToken();
9292
if (token) {
93-
return callServer<null, JsonMimeType, LoggedInUserInfo>("/api/auth/loggedInUser/", "POST", "application/json");
93+
return callServer<null, JsonMimeType, LoggedInUserInfo>("/api/utility/loggedInUser", "POST", "application/json");
9494
}
9595
return Promise.reject();
9696
}

client/src/views/PostView.vue

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ import PostNotAvailable from "@client/components/PostNotAvailable.vue";
8888
import { faClock } from "@fortawesome/free-regular-svg-icons";
8989
import { faArrowLeft, faEdit, faTrash } from "@fortawesome/free-solid-svg-icons";
9090
import type { ConfirmDialogData, Post, UserRolePermissionsType } from "@fumix/fu-blog-common";
91-
import { useSeoMeta } from "@unhead/vue";
91+
import { DateUtil } from "@fumix/fu-blog-common";
92+
import { useHead, useSeoMeta } from "@unhead/vue";
9293
import { onMounted, type PropType, ref } from "vue";
9394
import { useI18n } from "vue-i18n";
9495
import { useRoute, useRouter } from "vue-router";
@@ -122,7 +123,32 @@ onMounted(async () => {
122123
});
123124
const res = await fetch(`/api/posts/${id}`);
124125
const response = await res.json();
125-
post.value = response.data;
126+
const responseData: Post | null = response.data;
127+
if (responseData) {
128+
useHead({
129+
title: responseData.title + "" + t("posts.blogTitle"),
130+
script: [
131+
{
132+
type: "application/json+ld",
133+
textContent: JSON.stringify({
134+
"@context": "https://schema.org",
135+
"@type": "BlogPosting",
136+
name: responseData.title,
137+
datePublished: responseData.createdAt ? DateUtil.formatDateOnlyUtcIso(new Date(responseData.createdAt)) : undefined,
138+
dateModified: responseData.updatedAt ? DateUtil.formatDateOnlyUtcIso(new Date(responseData.updatedAt)) : undefined,
139+
description: responseData.description,
140+
author: responseData.createdBy
141+
? {
142+
"@type": "Person",
143+
name: responseData.createdBy.fullName,
144+
}
145+
: undefined,
146+
}),
147+
},
148+
],
149+
});
150+
}
151+
post.value = responseData;
126152
loading.value = false;
127153
} catch (e) {
128154
console.log("ERROR: ", e);

common/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fumix/fu-blog-common",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"author": "fumiX GmbH & Co KG",
55
"license": "Apache-2.0",
66
"scripts": {
@@ -12,8 +12,8 @@
1212
"dependencies": {
1313
"dompurify": "^3.0.1",
1414
"highlight.js": "^11.9.0",
15-
"jsdom": "^24.1.0",
16-
"marked": "^13.0.1",
15+
"jsdom": "^25.0.0",
16+
"marked": "^14.1.2",
1717
"marked-highlight": "^2.1.3",
1818
"marked-mangle": "^1.1.8",
1919
"node-fetch": "^3.3.1",
@@ -23,7 +23,6 @@
2323
"devDependencies": {
2424
"@types/dompurify": "^3.0.0",
2525
"@types/jsdom": "^21.1.1",
26-
"@types/marked": "^6.0.0",
2726
"@types/node-fetch": "^2.6.2",
2827
"@types/pako": "^2.0.0",
2928
"@types/sha.js": "^2.4.0"

common/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export * from "./types/public-post.js";
2727
export * from "./types/search-operator.js";
2828
export * from "./util/base64.js";
2929
export * from "./util/cookie-header-helpers.js";
30+
export * from "./util/date-util.js";
3031
export * from "./util/filesize.js";
3132
export * from "./util/markdown.js";
3233
export * from "./util/mimeType.js";

common/src/markdown-converter-common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export abstract class MarkdownConverter {
5959
private static getKrokiDiagramTypeFromMarkdownId(markdownId: string | undefined): KrokiDiagramType | undefined {
6060
return markdownId === undefined //
6161
? undefined
62-
: this.KROKI_SVG_DIAGRAM_TYPES.find((it) => it.markdownId === markdownId) ?? undefined;
62+
: (this.KROKI_SVG_DIAGRAM_TYPES.find((it) => it.markdownId === markdownId) ?? undefined);
6363
}
6464

6565
private static rendererExtension: MarkedExtension = {

0 commit comments

Comments
 (0)