Skip to content

Commit

Permalink
refactor: limit tsv-to-json script to writing json
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinstadler committed Oct 30, 2024
1 parent 77a2613 commit 008ab93
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 245 deletions.
10 changes: 10 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ NEXT_PUBLIC_TYPESENSE_HOST="typesense.acdh-dev.oeaw.ac.at"
NEXT_PUBLIC_TYPESENSE_PORT="443"
NEXT_PUBLIC_TYPESENSE_PROTOCOL="https"


# -------------------------------------------------------------------------------------------------
# python data wrangling scripts
# -------------------------------------------------------------------------------------------------
TYPESENSE_COLLECTION_NAME=thomas-bernhard

BASEROW_USER=
BASEROW_PW=
BASEROW_TOKEN=
BASEROW_BASE_URL=https://baserow.acdh-dev.oeaw.ac.at/api
4 changes: 3 additions & 1 deletion app/publications/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export default async function PublicationPage(props: PublicationPageProps) {
})}
</InlineList>
</NameValue>
<NameValue name={t("publisher")}>{pub.publisher.name}</NameValue>
<NameValue name={t("publisher")}>
{pub.publisher} {pub.publication_details}
</NameValue>
<NameValue name={t("year")}>{pub.year_display}</NameValue>
</PublicationDetails>
<NameValue name={t("contains")}>
Expand Down
12 changes: 5 additions & 7 deletions lib/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ export interface Publication {
year: number;
year_display: string;
isbn?: string;
publisher: Publisher;
publisher: string;
// misc info that varies between publications of the same publisher
// prime example: issue/page details when the 'publisher' is a periodical/magazine
publication_details?: string;
exemplar_suhrkamp_berlin: boolean;
exemplar_oeaw: boolean;
images: Array<Asset>;
has_image: boolean; // workaround for https://github.com/typesense/typesense/issues/790
has_image: boolean; // redundant, derived from 'images' (workaround for https://github.com/typesense/typesense/issues/790)
}

export interface Translation {
Expand Down Expand Up @@ -56,11 +59,6 @@ export interface Translator {
wikidata?: string;
}

interface Publisher {
id: string;
name: string;
}

interface Asset {
id: string; // same as filename (without extension, which is .jpg)
metadata?: string;
Expand Down
Loading

0 comments on commit 008ab93

Please sign in to comment.