summaryrefslogtreecommitdiff
path: root/frontend/site/projects/museum/export.js
blob: 7116ceb2d266d5ae0d1ecb6dffd35743bcf76b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { ARTISTS, ESSAY_TEXTS, CREDITS_STRINGS } from "./constants"
import fs from 'fs'

const outputFile = "./data_store/content/thelastmuseum/content.html"

let strings = [
  `<h1>The Last Museum</h1>`,
  `<h2>Presented by KW</h2>`,
  `<h3>Curated by Nadim Samman</h3>`,
  `<h2>Artists</h2>`,
]

Object.keys(ARTISTS).map(key => {
  const artist = ARTISTS[key]
  strings = strings.concat([
    `<h3>${artist.name}</h3>`,
    `<h4>Biography (English)</h4>`,
    artist.bio.en,
    artist.statement.en,
    `<h4>Biografie (Deutsch)</h4>`,
    artist.bio.de,
    artist.statement.de,
  ])
})

strings = strings.concat([
  `<h2>About The Last Museum</h2>`,
  `<h3>Nadim Samman</h3>`,
  `<h4>English</h4>`,
  ESSAY_TEXTS.nadim_intro.en,
  ESSAY_TEXTS.nadim_essay.en,
  `<h4>Deutsch</h4>`,
  ESSAY_TEXTS.nadim_intro.de,
  ESSAY_TEXTS.nadim_essay.de,
  `<h2>Developer Notes</h2>`,
  `<h3>Jules Laplace</h3>`,
  `<h4>English</h4>`,
  ESSAY_TEXTS.jules_essay.en,
  `<h4>Deutsch</h4>`,
  ESSAY_TEXTS.jules_essay.de,
  `<h2>Credits</h2>`,
  `<h3>Site Credits</h3>`,
  CREDITS_STRINGS.site_credits.en,
  `<h3>Artwork Credits</h3>`,
  CREDITS_STRINGS.artist_credits_1.en,
  CREDITS_STRINGS.artist_credits_2.en,
])

fs.writeFile(outputFile, strings.join("\n\n"), { encoding: "utf8" }, (error) => {
  if (error) {
    console.error(`Error writing file: ${error}`)
  } else {
    console.log(`Wrote ${strings.length} lines to ${outputFile}`)
  }
})