Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
luminy-org
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eloi Perdereau
luminy-org
Commits
c15c6b7e
Commit
c15c6b7e
authored
5 years ago
by
Eloi Perdereau
Browse files
Options
Downloads
Patches
Plain Diff
adapt layout logic to cms fields
parent
b795a8a3
No related branches found
No related tags found
1 merge request
!5
Big fat update, mostly cms configuration
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_includes/page__hero.html
+48
-40
48 additions, 40 deletions
_includes/page__hero.html
_layouts/single.html
+1
-3
1 addition, 3 deletions
_layouts/single.html
with
49 additions
and
43 deletions
_includes/page__hero.html
+
48
−
40
View file @
c15c6b7e
{% if page.header.image contains "://" %}
{% if page.header.
fixed_
image contains "://" %}
{% capture img_path %}{{ page.header.image
}}{% endcapture %}
{% capture
fixed_
img_path %}{{ page.header.
fixed_
image}}{% endcapture %}
{% else %}
{% else %}
{% capture img_path %}{{ page.header.image | relative_url }}{% endcapture %}
{% capture
fixed_
img_path %}{{ page.header.
fixed_
image | relative_url }}{% endcapture %}
{% endif %}
{% endif %}
{% if page.header.cta_url contains "://" %}
{% if page.header.cta_url contains "://" %}
...
@@ -10,12 +10,10 @@
...
@@ -10,12 +10,10 @@
{% capture cta_path %}{{ page.header.cta_url | relative_url }}{% endcapture %}
{% capture cta_path %}{{ page.header.cta_url | relative_url }}{% endcapture %}
{% endif %}
{% endif %}
{% if page.overlay_image contains "://" %}
{% if page.
header.
overlay_image contains "://" %}
{% capture overlay_img_path %}{{ page.overlay_image }}{% endcapture %}
{% capture overlay_img_path %}{{ page.
header.
overlay_image }}{% endcapture %}
{% elsif page.overlay_image %}
{% elsif page.overlay_image %}
{% capture overlay_img_path %}{{ page.overlay_image | relative_url }}{% endcapture %}
{% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %}
{% elsif author.banner %}
{% capture overlay_img_path %}{{ author.banner | relative_url }}{% endcapture %}
{% endif %}
{% endif %}
{% if page.header.overlay_filter contains "rgba" %}
{% if page.header.overlay_filter contains "rgba" %}
...
@@ -24,6 +22,18 @@
...
@@ -24,6 +22,18 @@
{% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %}
{% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %}
{% endif %}
{% endif %}
{% if page.header.type == 'fixed_image' %}
{% capture img_path %}{{ page.header.fixed_image }}{% endcapture %}
{% elsif page.header.type == 'overlay_image' %}
{% capture img_path %}{{ page.header.overlay_image }}{% endcapture %}
{% endif %}
{% if page.header.show_text == 'description' %}
{% capture overlay_text %}{{ page.description }}{% endcapture %}
{% elsif page.header.show_text == 'custom' %}
{% capture overlay_text %}{{ page.header.custom_text }}{% endcapture %}
{% endif %}
{% if page.header.image_description %}
{% if page.header.image_description %}
{% assign image_description = page.header.image_description %}
{% assign image_description = page.header.image_description %}
{% else %}
{% else %}
...
@@ -32,42 +42,40 @@
...
@@ -32,42 +42,40 @@
{% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %}
{% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %}
<div
class=
"page__hero{%
if
page.header.
overlay_color or page.overlay_image or author.banner
%}--overlay{% end
if
%}"
<div
class=
"page__hero{%
unless
page.header.
header_type == 'image-fixed'
%}--overlay{% end
unless
%}"
style=
"{% if page.header.overlay_color %}background-color: {{ page.header.overlay_color | default: 'transparent' }};{% endif %} {% if
overlay_img_path
%}background-image: {% if overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}), {% endif %}url('{{
overlay_
img_path }}');{% endif %}"
style=
"{% if page.header.overlay_color %}background-color: {{ page.header.overlay_color | default: 'transparent' }};{% endif %} {% if
page.header.type contains 'image'
%}background-image: {% if overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}), {% endif %}url('{{ img_path }}');{% endif %}"
>
>
{% if page.overlay_image or author.banner %}
<div
class=
"wrapper"
>
<div
class=
"wrapper"
>
{% if page.header.overlay_title %}
<h1
id=
"page-title"
class=
"page__title"
itemprop=
"headline"
>
<h1
id=
"page-title"
class=
"page__title"
itemprop=
"headline"
>
{% if paginator and site.paginate_show_page_num %}
{% if paginator and site.paginate_show_page_num %}
{{ site.title }}{% unless paginator.page == 1 %} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %}
{{ site.title }}{% unless paginator.page == 1 %} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %}
{% else %}
{% else %}
{{ page.title | default: site.title | markdownify | remove: "
<p>
" | remove: "
</p>
" }}
{{ page.title | default: site.title | markdownify | remove: "
<p>
" | remove: "
</p>
" }}
{% endif %}
</h1>
{% if page.header.show_overlay_excerpt != false and page.excerpt %}
<p
class=
"page__lead"
>
{{ page.excerpt | markdownify | remove: "
<p>
" | remove: "
</p>
" }}
</p>
{% endif %}
{% if page.read_time %}
<p
class=
"page__meta"
><i
class=
"far fa-clock"
aria-hidden=
"true"
></i>
{% include read-time.html %}
</p>
{% endif %}
{% endif %}
{% if page.header.cta_url %}
</h1>
<p><a
href=
"{{ cta_path }}"
class=
"btn btn--light-outline btn--large"
>
{{ page.header.cta_label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}
</a></p>
{% endif %}
{% endif %}
{% if overlay_text %}
{% if page.header.actions %}
<p
class=
"page__lead"
>
{{ overlay_text | markdownify | remove: "
<p>
" | remove: "
</p>
" }}
</p>
<p>
{% endif %}
{% for action in page.header.actions %}
{% if page.read_time %}
{% if action.url contains "://" %}
<p
class=
"page__meta"
><i
class=
"far fa-clock"
aria-hidden=
"true"
></i>
{% include read-time.html %}
</p>
{% assign url = action.url %}
{% endif %}
{% else %}
{% if page.header.cta_url %}
{% assign url = action.url | relative_url %}
<p><a
href=
"{{ cta_path }}"
class=
"btn btn--light-outline btn--large"
>
{{ page.header.cta_label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}
</a></p>
{% endif %}
{% endif %}
<a
href=
"{{ url }}"
class=
"btn btn--light-outline btn--large"
>
{{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}
</a>
{% if page.header.actions %}
{% endfor %}
<p>
{% for action in page.header.actions %}
{% if action.url contains "://" %}
{% assign url = action.url %}
{% else %}
{% assign url = action.url | relative_url %}
{% endif %}
{% endif %}
</div>
<a
href=
"{{ url }}"
class=
"btn btn--light-outline btn--large"
>
{{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}
</a>
{% else %}
{% endfor %}
<img
src=
"{{ img_path }}"
alt=
"{{ image_description }}"
class=
"page__hero-image"
>
{% endif %}
{% endif %}
</div>
{% if page.header.caption %}
{% if page.header.caption %}
<span
class=
"page__hero-caption"
>
{{ page.header.caption | markdownify | remove: "
<p>
" | remove: "
</p>
" }}
</span>
<span
class=
"page__hero-caption"
>
{{ page.header.caption | markdownify | remove: "
<p>
" | remove: "
</p>
" }}
</span>
{% endif %}
{% endif %}
...
...
This diff is collapsed.
Click to expand it.
_layouts/single.html
+
1
−
3
View file @
c15c6b7e
...
@@ -6,10 +6,8 @@ layout: default
...
@@ -6,10 +6,8 @@ layout: default
{% assign author = author[1] %}
{% assign author = author[1] %}
{% assign author = site.data.authors.authors | where: "directory", author | first %}
{% assign author = site.data.authors.authors | where: "directory", author | first %}
{% if page.h
eader.overlay_color or page.overlay_image or page.header.image or author.bann
er %}
{% if page.h
as_head
er %}
{% include page__hero.html %}
{% include page__hero.html %}
{% elsif page.header.video.id and page.header.video.provider %}
{% include page__hero_video.html %}
{% endif %}
{% endif %}
{% if page.url != "/" and site.breadcrumbs %}
{% if page.url != "/" and site.breadcrumbs %}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment