Skip to content

Commit 86ecf2f

Browse files
committed
Merge branch 'master' into add_announcement_post
2 parents 99b5e72 + 62f7792 commit 86ecf2f

12 files changed

Lines changed: 212 additions & 35 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ The _config.yml file defines various site level variables, notably the current v
4444

4545
## Front Matter
4646

47-
* Specs use `tags`, news and announements (`_posts`) use `categories`.
47+
* Use `tags`, not `category` or `categories`.
4848
* Look at previous posts and specs to determine what tags/categories to use.
49-
* Anything in the `api` directory (and subdirectories thereof) must include the `spec-doc` tag.
5049
* News posts must include:
5150

5251
* title
@@ -56,7 +55,6 @@ The _config.yml file defines various site level variables, notably the current v
5655

5756
and may include an excerpt.
5857

59-
6058
## Technical Decisions
6159

6260
* Specs will use JSON and JSON-LD

_config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
name: IIIF | International Image Interoperability Framework
21
markdown: kramdown
32
highlighter: pygments
43
source: source
5-
4+
safe: false
65
permalink: /news/:year/:month/:day/:title/
76

87
kramdown:
@@ -30,4 +29,4 @@ shared_canvas:
3029
latest:
3130
major: 1
3231
minor: 0
33-
patch: 0
32+
patch: 0

source/_data/organization.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: "IIIF | International Image Interoperability Framework"
2+
description: "International Image Interoperability Framework: A community driven image framework with well defined APIs for making the world’s image repositories interoperable and accessible"
3+
email: "iiif-discuss@googlegroups.com"
4+
url: http://iiif.io

source/_includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="footer-container">
22
<footer class="wrapper">
3-
Please send feedback to <a href="mailto:iiif-discuss@googlegroups.com">iiif-discuss@googlegroups.com</a>
3+
Please send feedback to <a href="mailto:{{ site.data.organization.email }}">{{ site.data.organization.email }}</a>
44
</footer>
55
</div>

source/_includes/head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<head>
22
<meta charset="utf-8">
3-
<title>{{ page.title }} &mdash; {{ site.name }}</title>
4-
<meta name="description" content="International Image Interoperability Framework: A community driven image framework with well defined APIs for making the world’s image repositories interoperable and accessible">
3+
<title>{{ page.title }} &mdash; {{ site.data.organization.name }}</title>
4+
<meta name="description" content="{{ site.data.organization.description }}">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<link rel="stylesheet" href="/css/normalize.min.css">
77
<link href='http://fonts.googleapis.com/css?family=Raleway:100,300,500' rel='stylesheet' type='text/css'>

source/_includes/spec-head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<head>
22
<meta charset="utf-8">
3-
<title>{{ page.title }} &mdash; {{ site.name }}</title>
4-
<meta name="description" content="International Image Interoperability Framework: A community driven image framework with well defined APIs for making the world’s image repositories interoperable and accessible">
3+
<title>{{ page.title }} &mdash; {{ site.data.organization.name }}</title>
4+
<meta name="description" content="{{ site.data.organization.description }}">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<link rel="stylesheet" href="/css/normalize.min.css">
77
<link rel="stylesheet" href="/css/main.css">
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Pageless Redirect Generator
2+
#
3+
# Generates redirect pages based on YAML or htaccess style redirects
4+
#
5+
# To generate redirects create _redirects.yml, _redirects.htaccess, and/or _redirects.json in the Jekyll root directory
6+
# both follow the pattern alias, final destination.
7+
#
8+
# Example _redirects.yml
9+
#
10+
# initial-page : /destination-page
11+
# other-page : http://example.org/destination-page
12+
# "another/page" : /destination-page
13+
#
14+
# Result:
15+
# Requests to /initial-page are redirected to /destination-page
16+
# Requests to /other-page are redirected to http://example.org/destination-page
17+
# Requests to /another/page are redirected to /destination-page
18+
#
19+
#
20+
# Example _redirects.htaccess
21+
#
22+
# Redirect /some-page /destination-page
23+
# Redirect 301 /different-page /destination-page
24+
# Redirect cool-page http://example.org/destination-page
25+
#
26+
# Result:
27+
# Requests to /some-page are redirected to /destination-page
28+
# Requests to /different-page are redirected to /destination-page
29+
# Requests to /cool-page are redirected to http://example.org/destination-page
30+
#
31+
#
32+
# Example _redirects.json
33+
#
34+
# {
35+
# "some-page" : "/destination-page",
36+
# "yet-another-page" : "http://example.org/destination-page",
37+
# "ninth-page" : "/destination-page"
38+
# }
39+
#
40+
# Result:
41+
# Requests to /some-page are redirected to /destination-page
42+
# Requests to /yet-another-page are redirected to http://example.org/destination-page
43+
# Requests to /ninth-page are redirected to /destination-page
44+
#
45+
#
46+
# Author: Nick Quinlan
47+
# Site: http://nicholasquinlan.com
48+
# Plugin Source: https://github.com/nquinlan/jekyll-pageless-redirects
49+
# Plugin License: MIT
50+
# Plugin Credit: This plugin borrows heavily from alias_generator (http://github.com/tsmango/jekyll_alias_generator) by Thomas Mango (http://thomasmango.com)
51+
52+
require 'json'
53+
54+
module Jekyll
55+
56+
class PagelessRedirectGenerator < Generator
57+
58+
def generate(site)
59+
@site = site
60+
61+
process_yaml
62+
process_htaccess
63+
process_json
64+
end
65+
66+
def process_yaml
67+
file_path = @site.source + "/_redirects.yml"
68+
if File.exists?(file_path)
69+
YAML.load_file(file_path, :safe => true).each do | new_url, old_url |
70+
generate_aliases( old_url, new_url )
71+
end
72+
end
73+
end
74+
75+
def process_htaccess
76+
file_path = @site.source + "/_redirects.htaccess"
77+
if File.exists?(file_path)
78+
# Read the file line by line pushing redirects to the redirects array
79+
file = File.new(file_path, "r")
80+
while (line = file.gets)
81+
# Match the line against a regex, if it matches push it to the object
82+
/^Redirect(\s+30[1237])?\s+(.+?)\s+(.+?)$/.match(line) { | matches |
83+
generate_aliases( matches[3], matches[2])
84+
}
85+
end
86+
file.close
87+
end
88+
end
89+
90+
def process_json
91+
file_path = @site.source + "/_redirects.json"
92+
if File.exists?(file_path)
93+
file = File.new(file_path, "r")
94+
content = JSON.parse(file.read)
95+
content.each do |new_url, old_url|
96+
generate_aliases(old_url, new_url)
97+
end
98+
file.close
99+
end
100+
end
101+
102+
def generate_aliases(destination_path, aliases)
103+
alias_paths ||= Array.new
104+
alias_paths << aliases
105+
alias_paths.compact!
106+
107+
alias_paths.flatten.each do |alias_path|
108+
alias_path = alias_path.to_s
109+
110+
alias_dir = File.extname(alias_path).empty? ? alias_path : File.dirname(alias_path)
111+
alias_file = File.extname(alias_path).empty? ? "index.html" : File.basename(alias_path)
112+
113+
fs_path_to_dir = File.join(@site.dest, alias_dir)
114+
alias_index_path = File.join(alias_dir, alias_file)
115+
116+
FileUtils.mkdir_p(fs_path_to_dir)
117+
118+
File.open(File.join(fs_path_to_dir, alias_file), 'w') do |file|
119+
file.write(alias_template(destination_path))
120+
end
121+
122+
(alias_index_path.split('/').size + 1).times do |sections|
123+
@site.static_files << Jekyll::PagelessRedirectFile.new(@site, @site.dest, alias_index_path.split('/')[0, sections].join('/'), '')
124+
end
125+
end
126+
end
127+
128+
def alias_template(destination_path)
129+
<<-EOF
130+
<!DOCTYPE html>
131+
<html>
132+
<head>
133+
<title>Redirecting...</title>
134+
<link rel="canonical" href="#{destination_path}"/>
135+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
136+
<meta http-equiv="refresh" content="0; url=#{destination_path}" />
137+
</head>
138+
<body>
139+
<p><strong>Redirecting...</strong></p>
140+
<p><a href='#{destination_path}'>Click here if you are not redirected.</a></p>
141+
<script>
142+
document.location.href = "#{destination_path}";
143+
</script>
144+
</body>
145+
</html>
146+
EOF
147+
end
148+
end
149+
150+
class PagelessRedirectFile < StaticFile
151+
require 'set'
152+
153+
def destination(dest)
154+
File.join(dest, @dir)
155+
end
156+
157+
def modified?
158+
return false
159+
end
160+
161+
def write(dest)
162+
return true
163+
end
164+
end
165+
end

source/_posts/2014-06-01-drafts-released.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ A complete list of the changes can be found on the IIIF website:
1818
* [Image API 2.0 Change Log](/api/image/2.0/change-log.html)
1919
* [Presentation API 2.0 Change Log](/api/presentation/2.0/change-log.html)
2020

21-
We welcome your feedback, questions, and use cases, and encourage you to submit feedback to the [IIIF Discussion Listserv](mailto:iiif-discuss%40googlegroups.com).
21+
We welcome your feedback, questions, and use cases, and encourage you to submit feedback to the [IIIF Discussion Listserv](mailto:{{ site.data.organization.email }}).

source/_redirects.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"api/presentation/index.html" : "/api/presentation/2.0/index.html",
3+
"api/presentation/2/index.html" : "/api/presentation/2.0/index.html",
4+
"api/metadata/index.html" : "/api/metadata/1.0/index.html",
5+
"api/metadata/1/index.html" : "/api/metadata/1.0/index.html",
6+
"api/image/index.html" : "/api/image/1.1/index.html",
7+
"api/image/1/index.html" : "/api/image/1.1/index.html",
8+
"api/image/2/index.html" : "/api/image/2.0/index.html",
9+
"api/index.html" : "/technical-details.html",
10+
"model/index.html" : "/model/shared-canvas/1.0/index.html",
11+
"model/shared-canvas/index.html" : "/model/shared-canvas/1.0/index.html"
12+
}
13+

source/api/image/2.0/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,7 @@ The JSON response _MUST_ conform to the structure shown in the following example
502502
"formats" : [ "jpg", "png" ],
503503
"qualities" : [ "default" ],
504504
"supports" : [
505-
"cors", "region_by_pct", "region_by_px", "rotation_arbitrary", "rotation_by_90s",
506-
"size_by_forced_wh", "size_by_h", "size_by_pct", "size_by_w", "size_by_wh"
505+
"canonical_link_header", "rotation_arbitrary"
507506
]
508507
}
509508
]

0 commit comments

Comments
 (0)