Skip to content

Commit deffc6f

Browse files
authored
Merge pull request #3 from thegetty/first-pages
First pages
2 parents 0197185 + ec1134e commit deffc6f

File tree

370 files changed

+23419
-1067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+23419
-1067
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ site
1010
themes/default/static/css/application.css
1111
themes/default/static/js/application.js
1212
themes/default/test-results/
13-
themes/default/tests/e2e/
13+
themes/default/tests/e2e/
14+
15+
static/img/magick

bin/magick.sh

+46-11
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@
22

33
# Convert images to JPGs at 80% quality and a maximum pixel dimension of 1800px (web and print ready) and apply a consisent color profile to them.
44
# Create JPGs of those same images at 100% quality and sized to optimize IIIF processing where applicable
5-
# Create a CSV with basic image info that can be converted for use in figures.yml
5+
# Create a figures.csv file with basic image info that can be converted for use in figures.yml
6+
# Create a figures.yml file ready for use in Quire that includes the figure id, src, and if IIIF, the media_type and iiif information.
67

78
defaultSize=1800
89
defaultQuality=80
910

10-
prepIIIF=false # resize images to later process with `quire process --iiif`
11-
outputCSV=false # output a CSV file that can be used as a basis for figures.yml
12-
quietMode=true # supress ImageMagick warnings about image files
11+
prepIIIF=true # resize images to later process with `quire process --iiif`
12+
outputYAML=true # output a figures.yml file
13+
outputCSV=true # output a CSV file that can be used as a basis for figures.yml
14+
quietMode=false # supress ImageMagick warnings about image files
1315

1416
baseDir=static/img
15-
inputDir=magick-new
16-
iiifOutputDir=iiif
17+
inputDir=magick
1718
figureOutputDir=figures
19+
iiifOutputDir=iiif
20+
# iiifTilesDir='/img/'$iiifOutputDir'/processed/' # default Quire output
21+
iiifTilesDir='https://www.getty.edu/publications/resources/cultural-heritage-mass-atrocities/' # Getty AWS S3 hosting
1822

1923
# color profiles to use
2024
colorProfile=bin/magick/adobe-rgb-1998.icm
@@ -49,9 +53,25 @@ if [ $outputCSV == true ]
4953
then
5054
if [ "$type" == "iiif" ]
5155
then
52-
printf '\n\"'$1'\", \"'$figureOutputDir'/'$1'.jpg\", iiif, \"/img/'$iiifOutputDir'/processed/'$1'/info.json\"' >> bin/magick/_figures.csv
56+
printf '\n\"'$1'\", \"'$figureOutputDir'/'$1'.jpg\", iiif, \"'$iiifTilesDir$1'/info.json\"' >> bin/magick/figures.csv
57+
else
58+
printf '\n\"'$1'\", \"'$figureOutputDir'/'$1'.jpg\", ,' >> bin/magick/figures.csv
59+
fi
60+
fi
61+
}
62+
63+
add_to_yaml()
64+
{
65+
file=$1
66+
type=$2
67+
68+
if [ $outputYAML == true ]
69+
then
70+
if [ "$type" == "iiif" ]
71+
then
72+
printf '\n\n - id: \"'$1'\"\n src: \"'$figureOutputDir'/'$1'.jpg\"\n media_type: iiif\n iiif: \"'$iiifTilesDir$1'/info.json\"\n alt: \"\"\n label: \"\"\n caption: \"\"\n credit: \"\"' >> bin/magick/figures.yml
5373
else
54-
printf '\n\"'$1'\", \"'$figureOutputDir'/'$1'.jpg\", ,' >> bin/magick/_figures.csv
74+
printf '\n\n - id: \"'$1'\"\n src: \"'$figureOutputDir'/'$1'.jpg\"\n alt: \"\"\n label: \"\"\n caption: \"\"\n credit: \"\"' >> bin/magick/figures.yml
5575
fi
5676
fi
5777
}
@@ -66,12 +86,17 @@ if [ $outputCSV == true ]
6686
then
6787
if [ $prepIIIF == true ]
6888
then
69-
printf 'id, src, media_type, iiif' > bin/magick/_figures.csv
89+
printf 'id, src, media_type, iiif' > bin/magick/figures.csv
7090
else
71-
printf 'id, src' > bin/magick/_figures.csv
91+
printf 'id, src' > bin/magick/figures.csv
7292
fi
7393
fi
7494

95+
if [ $outputYAML == true ]
96+
then
97+
printf 'figure_list:' > bin/magick/figures.yml
98+
fi
99+
75100
if [ $prepIIIF == true ]
76101
then
77102
create_directory $iiifOutputDir
@@ -98,7 +123,12 @@ do
98123
mode='-quiet'
99124
else
100125
mode=''
101-
printf '\n'$fileName'\n'
126+
if [ $maxDim -lt $defaultSize ]
127+
then
128+
printf '\n'$fileName', '$maxDim'px'
129+
else
130+
printf '\n'$fileName
131+
fi
102132
fi
103133

104134
magick $mode $img -resize $defaultSize'x'$defaultSize'>' -quality $defaultQuality -layers flatten -profile $profile -set filename:name '%t' $baseDir/$figureOutputDir/'%[filename:name].jpg'
@@ -109,21 +139,26 @@ do
109139
if [ $maxDim -lt $iiif4Layers ]
110140
then
111141
add_to_csv $fileName
142+
add_to_yaml $fileName
112143
elif [ $maxDim -lt $iiif5Layers ]
113144
then
114145
magick -quiet $img -resize $iiif4Layers'x'$iiif4Layers -layers flatten -profile $profile -set filename:name '%t' $baseDir/$iiifOutputDir/'%[filename:name].jpg'
115146
add_to_csv $fileName iiif
147+
add_to_yaml $fileName iiif
116148
elif [ $maxDim -lt $iiif6Layers ]
117149
then
118150
magick -quiet $img -resize $iiif5Layers'x'$iiif5Layers -layers flatten -profile $profile -set filename:name '%t' $baseDir/$iiifOutputDir/'%[filename:name].jpg'
119151
add_to_csv $fileName iiif
152+
add_to_yaml $fileName iiif
120153
else
121154
magick -quiet $img -resize $iiif6Layers'x'$iiif6Layers -layers flatten -profile $profile -set filename:name '%t' $baseDir/$iiifOutputDir/'%[filename:name].jpg'
122155
add_to_csv $fileName iiif
156+
add_to_yaml $fileName iiif
123157
fi
124158

125159
else
126160
add_to_csv $fileName
161+
add_to_yaml $fileName
127162
fi
128163

129164
done

bin/pdfs.sh

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
# This script produces individual PDFs of each page,
4+
# based on a list of pages that is generated by the
5+
# layouts/data/pdf-generation template in Hugo.
6+
#
7+
# Add `pdf_dowload: false` to the page YAML of any page that
8+
# should not be included.
9+
#
10+
# IMPORTANT: `quire preview` must be running for this script to work.
11+
# And `pdf: true` must be set in config.yml
12+
13+
previewURL=http://localhost:1313/
14+
outputDirectory=static/downloads/pages/
15+
baseName=cultural-heritage-mass-atrocities
16+
17+
# FIRST DO A SPECIAL SET OF TRANSLATED TOCs
18+
19+
TRANSLATIONS=(
20+
contents-ar
21+
contents-zh
22+
contents-en
23+
contents-fr
24+
contents-ru
25+
contents-es
26+
)
27+
28+
for page in "${TRANSLATIONS[@]}"
29+
do
30+
31+
url=$previewURL$page"/"
32+
file=$outputDirectory$baseName"--"$page".pdf"
33+
34+
prince $url --style=bin/pdfs/overrides.css --no-warn-css -o $file
35+
36+
done
37+
38+
# NEXT CREATE ALL THE INDIVIDUAL PAGES PDFs
39+
40+
declare -a PAGES
41+
42+
IFS=$'\r\n' GLOBIGNORE='*' command eval 'PAGES=($(curl http://localhost:1313/pdf-generation.txt))'
43+
44+
for page in "${PAGES[@]}"
45+
do
46+
47+
url=$previewURL$page"/"
48+
file=$outputDirectory$baseName"--"${page//\//-}".pdf"
49+
50+
prince $url --style=bin/pdfs/overrides.css --no-warn-css -o $file
51+
52+
done
53+
54+
55+
56+

bin/pdfs/overrides.css

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* This is a special css file that overrides some of the base page settings
2+
for a better output for downloading individual entries.
3+
4+
All the !important calls seem to be necessary.
5+
*/
6+
@page {
7+
size: 7in 10in;
8+
prince-bleed: 0 !important;
9+
bleed: 0 !important;
10+
prince-trim: 0 !important;
11+
marks: none !important;
12+
margin-left: 1in !important;
13+
margin-right: 1in !important;
14+
color: #000 !important;
15+
16+
@bottom-right {
17+
content: "" !important;
18+
}
19+
20+
@bottom-left {
21+
content: "" !important;
22+
}
23+
}
24+
25+
/* Display bios on the individual page downloads since they are otherwise only displayed in the end of the book in the full PDF */
26+
@media print {
27+
.quire-essay h2#biography,
28+
.quire-essay ul.quire-contributors-list.bio {
29+
display: inherit !important;
30+
}
31+
.quire-essay ul.quire-contributors-list.bio,
32+
.quire-essay ul.quire-contributors-list.bio li {
33+
margin-left: 0 !important;
34+
}
35+
}

config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ params:
4646
nextPageButtonText: "Next"
4747
entryPageSideBySideLayout: false
4848
entryPageObjectLinkText: "View in Collection"
49-
figureLabelLocation: on-top # below | on-top
49+
figureLabelLocation: below # below | on-top
5050
figureModal: true
5151
figureModalIcons: true
5252
figureZoom: true
53-
citationPopupStyle: text # text | icon
53+
citationPopupStyle: text # text | icon

config/_default/config.yml

-53
This file was deleted.

content/abbreviations.md

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: List of Abbreviations
3+
weight: 6
4+
type: page
5+
pdf_download: false
6+
---
7+
8+
| | |
9+
| --------| ----------- |
10+
| AFP | Agence France-Presse |
11+
| AKTC | Aga Khan Trust for Culture |
12+
| ALIPH | International Alliance for the Protection of Heritage in Conflict Areas |
13+
| AP | Associated Press |
14+
| AP I | Additional Protocol I to the 1949 Geneva Conventions |
15+
| AP II | Additional Protocol II to the 1949 Geneva Conventions |
16+
| AQIM | Al-Qaeda in the Islamic Maghreb |
17+
| B/C | Benefit-cost (ratios) |
18+
| BCE | Before the Common or Christian Era |
19+
| BRI | Belt and Road Initiative |
20+
| BSI | Blue Shield International |
21+
| CAVR | Commission for Reception, Truth and Reconciliation in East Timor |
22+
| CCP | Chinese Communist Party |
23+
| CE | Common or Christian Era |
24+
| CESCR | Committee on Economic, Social and Cultural Rights |
25+
| CNN | Cable News Network |
26+
| DGAM | Directorate General for Antiquities and Museums |
27+
| Eamena | Endangered Archaeology in the Middle East and North Africa |
28+
| ECOSOC | UN Economic and Social Council |
29+
| EU | European Union |
30+
| GAL | *Geschichte der arabischen Litteratur* |
31+
| GDP | Gross domestic product |
32+
| HRC | Human Rights Committee |
33+
| IAC | International armed conflict |
34+
| ICC | International Criminal Court |
35+
| ICCPR | International Covenant on Civil and Political Rights, 1966 |
36+
| ICCROM | International Centre for the Study of the Preservation and Restoration of Cultural Property |
37+
| ICESCR | International Covenant on Economic, Social and Cultural Rights, 1966 |
38+
| ICG | International Crisis Group |
39+
| ICISS | International Commission on Intervention and State Sovereignty |
40+
| ICOM | International Council of Museums |
41+
| ICOMOS | International Council on Monuments and Sites |
42+
| ICTY | International Criminal Tribunal for the former Yugoslavia |
43+
| IDP | Internally displaced person |
44+
| IHL | International humanitarian law |
45+
| ILA | International Law Association |
46+
| Interpol | International Criminal Police Organization |
47+
| IRR | Internal rate of return |
48+
| ISIL | Islamic State of Iraq and the Levant |
49+
| ISIS | Islamic State of Iraq and Syria |
50+
| KFOR | NATO’s Kosovo Force |
51+
| KLA | Kosovo Liberation Army |
52+
| LIDAR | Light Detection and Ranging |
53+
| LOAC | Law of armed conflict |
54+
| LTTE | Liberation Tigers of Tamil Eelam |
55+
| MFAA | Monuments, Fine Arts, and Archives Section (of the Civil Affairs and Military Government Sections of the Allied Armies in WWII) |
56+
| MINUSMA | UN Multidimensional Integrated Stabilization Mission in Mali |
57+
| MOJWA | Movement for Oneness and Jihad in West Africa |
58+
| MOU | Memorandum of understanding |
59+
| NACLA | North American Congress on Latin America |
60+
| NAGPRA | Native American Grave Protection and Repatriation Act |
61+
| NATO | North Atlantic Treaty Organization |
62+
| NGO | Nongovernmental organization |
63+
| NIAC | Non-international armed conflict |
64+
| NPV | Net present value |
65+
| NSAG | Nonstate armed group |
66+
| OHCHR | Office of the UN High Commissioner for Human Rights |
67+
| QIP | Quick Impact Projects |
68+
| R2P | Responsibility to protect |
69+
| RAC | Records of the American Commission for the Protection and Salvage of Artistic and Historical Monuments in War Areas |
70+
| SAA | Society for American Archaeology |
71+
| SCPR | Syrian Center for Policy Research |
72+
| SPLM/A | Sudan People’s Liberation Movement/Army |
73+
| TCCH | Technical Committee on Cultural Heritage in Cyprus |
74+
| TRADOC | Training and Doctrine Command, US Army |
75+
| UN | United Nations |
76+
| UNAMI | UN Assistance Mission for Iraq |
77+
| UNDP | UN Development Programme |
78+
| UNDRIP | UN Declaration on the Rights of Indigenous Peoples, 2007 |
79+
| UNESCO | UN Educational, Scientific and Cultural Organization |
80+
| UNFICYP | UN Peacekeeping Force in Cyprus |
81+
| UNFIL | UN Interim Force in Lebanon |
82+
| UNHCR | UN High Commissioner for Refugees |
83+
| UNICEF | UN Children’s Fund |
84+
| UNITAD | UN Investigative Team to Promote Accountability for Crimes Committed by Da’esh/ISIL |
85+
| UNITAR | UN Institute for Training and Research |
86+
| UNMIK | UN Interim Administration Mission in Kosovo |
87+
| UNODC | UN Office on Drugs and Crime |
88+
| UNTSO | UN Truce Supervision Organization |
89+
| UNWCC | United Nations War Crimes Commission |
90+
| USAID | US Agency for International Development |
91+
| WHC | Convention Concerning the Protection of the World Cultural and Natural Heritage, 1972 |
92+
| WTP | Willingness to pay |
93+
| XUAR | Xinjiang Uyghur Autonomous Region |

0 commit comments

Comments
 (0)