pnpm update, type fixing and automatic oikb push action
Next.js App CI / docker (push) Failing after 1m58s
Next.js App CI / docker (push) Failing after 1m58s
This commit is contained in:
@@ -42,4 +42,12 @@ jobs:
|
|||||||
|
|
||||||
# make this work in future releases
|
# make this work in future releases
|
||||||
# cache-from: type=registry,ref=${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner }}/website:buildcache
|
# cache-from: type=registry,ref=${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner }}/website:buildcache
|
||||||
# cache-to: type=registry,ref=${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner
|
# cache-to: type=registry,ref=${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner
|
||||||
|
|
||||||
|
- name: Sync docs to Open WebUI
|
||||||
|
uses: docker://ghcr.io/open-webui/oikb:latest
|
||||||
|
with:
|
||||||
|
args: sync ${{ gitea.workspace }}/docs --kb-id ${{ secrets.KB_ID }}
|
||||||
|
env:
|
||||||
|
OPEN_WEBUI_URL: ${{ secrets.OPEN_WEBUI_URL }}
|
||||||
|
OPEN_WEBUI_API_KEY: ${{ secrets.OPEN_WEBUI_API_KEY }}
|
||||||
+6
-7
@@ -23,9 +23,8 @@ export function getPublicationsData(): Publication[] {
|
|||||||
return bibtexJson.entries.map((entry) => {
|
return bibtexJson.entries.map((entry) => {
|
||||||
const authorNames = entry.fields.author
|
const authorNames = entry.fields.author
|
||||||
? entry.fields.author.map(
|
? entry.fields.author.map(
|
||||||
(author) => `${author.firstName} ${author.lastName}`
|
(author) => `${author.firstName} ${author.lastName}`
|
||||||
)
|
): [];
|
||||||
: [];
|
|
||||||
|
|
||||||
let bibtexEntryString = `@${entry.type}{${entry.key},\n`;
|
let bibtexEntryString = `@${entry.type}{${entry.key},\n`;
|
||||||
for (const [key, value] of Object.entries(entry.fields)) {
|
for (const [key, value] of Object.entries(entry.fields)) {
|
||||||
@@ -48,11 +47,11 @@ export function getPublicationsData(): Publication[] {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
key: entry.key,
|
key: entry.key,
|
||||||
title: Array.isArray(entry.fields.title) ? entry.fields.title.join(" ") : entry.fields.title,
|
title: Array.isArray(entry.fields.title) ? entry.fields.title.join(" ") : (entry.fields.title || ""),
|
||||||
authors: authorNames,
|
authors: authorNames,
|
||||||
journal: Array.isArray(journalField) ? journalField.join(" ") : journalField,
|
journal: Array.isArray(journalField) ? journalField.join(" ") : (journalField || ""),
|
||||||
year: Array.isArray(entry.fields.year) ? entry.fields.year.join(" ") : entry.fields.year,
|
year: Array.isArray(entry.fields.year) ? entry.fields.year.join(" ") : (entry.fields.year || ""),
|
||||||
url: Array.isArray(entry.fields.url) ? entry.fields.url.join(" ") : entry.fields.url,
|
url: Array.isArray(entry.fields.url) ? entry.fields.url.join(" ") : (entry.fields.url || ""),
|
||||||
bibtex: bibtexEntryString,
|
bibtex: bibtexEntryString,
|
||||||
pdfUrl: `/publications/${entry.key}.pdf`,
|
pdfUrl: `/publications/${entry.key}.pdf`,
|
||||||
pdfAvailable: pdfExists,
|
pdfAvailable: pdfExists,
|
||||||
|
|||||||
Vendored
+50
@@ -0,0 +1,50 @@
|
|||||||
|
declare module '@retorquere/bibtex-parser' {
|
||||||
|
// Represents a single author/creator object inside the author array
|
||||||
|
export interface Creator {
|
||||||
|
firstName?: string;
|
||||||
|
lastName?: string;
|
||||||
|
prefix?: string;
|
||||||
|
suffix?: string;
|
||||||
|
initial?: string;
|
||||||
|
useprefix?: boolean;
|
||||||
|
family?: string;
|
||||||
|
given?: string;
|
||||||
|
name?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Represents the fields object inside an entry.
|
||||||
|
// 'author' is specifically typed, everything else is treated as an array of strings or a single string.
|
||||||
|
export interface Fields {
|
||||||
|
author?: Creator[];
|
||||||
|
editor?: Creator[];
|
||||||
|
translator?: Creator[];
|
||||||
|
title?: string | string[];
|
||||||
|
journal?: string | string[];
|
||||||
|
booktitle?: string | string[];
|
||||||
|
year?: string | string[];
|
||||||
|
url?: string | string[];
|
||||||
|
[key: string]: any; // Catch-all for other BibTeX fields (volume, pages, publisher, etc.)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Represents a single parsed BibTeX entry
|
||||||
|
export interface Entry {
|
||||||
|
type: string;
|
||||||
|
key: string;
|
||||||
|
fields: Fields;
|
||||||
|
crossref?: any;
|
||||||
|
creators?: Record<string, Creator[]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Represents the overall output of the parse function
|
||||||
|
export interface Library {
|
||||||
|
entries: Entry[];
|
||||||
|
errors: any[];
|
||||||
|
comments: string[];
|
||||||
|
strings: Record<string, string>;
|
||||||
|
jabref?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The main parse function you are importing
|
||||||
|
export function parse(input: string, options?: any): Library;
|
||||||
|
export function parseAsync(input: string, options?: any): Promise<Library>;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user