File tree 4 files changed +4
-0
lines changed
4 files changed +4
-0
lines changed Original file line number Diff line number Diff line change 20
20
<title >{{ macros::escape_hbs(input=page.title) | safe }}</title >
21
21
<link rel =" alternate" href =" https://blog.rust-lang.org{{ macros::escape_hbs(input=page.path) | safe }}" type =" text/html" title =" {{ macros::escape_hbs(input=page.title) | safe }}" />
22
22
{%- set num_comps = page.components | length %}
23
+ {%- if num_comps < 4 %}{{ throw(message="Missing date in 'path' key, required format: '[inside-rust/]YYYY/MM/DD/slug-of-your-choice'") }}{% endif %}
23
24
{%- set year = page.components | nth(n=num_comps - 4) %}
24
25
{%- set month = page.components | nth(n=num_comps - 3) %}
25
26
{%- set day = page.components | nth(n=num_comps - 2) %}
Original file line number Diff line number Diff line change 27
27
{%- set rev_pages = section.pages | reverse %}
28
28
{%- for page in rev_pages %}
29
29
{%- set num_comps = page.components | length %}
30
+ {%- if num_comps < 4 %}{{ throw(message ="Missing date in 'path' key, required format: '[inside-rust/]YYYY/MM/DD/slug-of-your-choice' ") }}{% endif %}
30
31
{%- set year = page.components | nth(n =num_comps - 4) | int %}
31
32
{%- set month = page.components | nth(n =num_comps - 3) | int %}
32
33
{%- set day = page.components | nth(n =num_comps - 2) | int %}
Original file line number Diff line number Diff line change 2
2
{% extends "layout.html" -%}
3
3
{% block page -%}
4
4
{% set num_comps = page.components | length -%}
5
+ {% if num_comps < 4 %}{{ throw(message ="Missing date in 'path' key, required format: '[inside-rust/]YYYY/MM/DD/slug-of-your-choice' ") }}{% endif -%}
5
6
{% set year = page.components | nth(n =num_comps - 4) | int -%}
6
7
{% set month = page.components | nth(n =num_comps - 3) | int -%}
7
8
{% set day = page.components | nth(n =num_comps - 2) | int -%}
Original file line number Diff line number Diff line change 26
26
{%- set rev_pages = section.pages | reverse %}
27
27
{%- for page in rev_pages %}
28
28
{%- set num_comps = page.components | length %}
29
+ {%- if num_comps < 4 %}{{ throw(message ="Missing date in 'path' key, required format: '[inside-rust/]YYYY/MM/DD/slug-of-your-choice' ") }}{% endif %}
29
30
{%- set year = page.components | nth(n =num_comps - 4) | int %}
30
31
{%- set month = page.components | nth(n =num_comps - 3) | int %}
31
32
{%- set day = page.components | nth(n =num_comps - 2) | int %}
You can’t perform that action at this time.
0 commit comments