Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Merge requests
!169
UV: Use relative instead of absolute URLs
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
UV: Use relative instead of absolute URLs
uv-relative-urls
into
develop
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Pascal Ernster
requested to merge
uv-relative-urls
into
develop
1 year ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Fixes
#38 (closed)
.
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
2f5ec999
1 commit,
1 year ago
1 file
+
3
−
13
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
hyrax/config/initializers/hyrax.rb
+
3
−
13
Options
@@ -131,21 +131,10 @@ Hyrax.config do |config|
#
# Default is false
config
.
iiif_image_server
=
true
if
ENV
.
fetch
(
'IIIF_TO_SERVE_SSL_URLS'
,
'false'
)
==
'true'
protocol
=
'https'
else
protocol
=
'http'
end
if
Rails
.
env
.
development?
port
=
ENV
.
fetch
(
'PORT'
,
3000
)
else
port
=
nil
end
# Returns a URL that resolves to an image provided by a IIIF image server
config
.
iiif_image_url_builder
=
lambda
do
|
file_id
,
base_url
,
size
,
format
|
Riiif
::
Engine
.
routes
.
url_helpers
.
image_url
(
file_id
,
host:
base_url
,
size:
size
,
protocol:
protocol
,
port:
port
)
Riiif
::
Engine
.
routes
.
url_helpers
.
image_url
(
file_id
,
size:
size
,
only_path:
true
)
end
# config.iiif_image_url_builder = lambda do |file_id, base_url, size, format|
# "#{base_url}/downloads/#{file_id.split('/').first}"
@@ -153,7 +142,8 @@ Hyrax.config do |config|
# Returns a URL that resolves to an info.json file provided by a IIIF image server
config
.
iiif_info_url_builder
=
lambda
do
|
file_id
,
base_url
|
uri
=
Riiif
::
Engine
.
routes
.
url_helpers
.
info_url
(
file_id
,
host:
base_url
,
protocol:
protocol
,
port:
port
)
uri
=
Riiif
::
Engine
.
routes
.
url_helpers
.
info_url
(
file_id
,
only_path:
true
)
uri
.
sub
(
/\Ahttp:/
,
'https:'
)
uri
.
sub
(
%r{/info
\.
json
\Z
}
,
''
)
end
Loading