diff --git a/docs/_data/permalinks.yml b/docs/_data/permalinks.yml new file mode 100644 index 00000000..1e548860 --- /dev/null +++ b/docs/_data/permalinks.yml @@ -0,0 +1,139 @@ +placeholders: + - name: year + desc: >- + Year from the post's filename with four digits. May be overridden via the document's + date front matter. + - name: short_year + desc: >- + Year from the post's filename without the century. (00..99) May be overridden via the + document's date front matter. + - name: month + desc: >- + Month from the post's filename. (01..12) May be overridden via the document's + date front matter. + - name: i_month + desc: >- + Month without leading zeros from the post's filename. May be overridden via the document's + date front matter. + - name: short_month + desc: >- + Three-letter month abbreviation, e.g. "Jan". + - name: long_month + intro_ver: "4.0" + desc: >- + Full month name, e.g. "January". + - name: day + desc: >- + Day of the month from the post's filename. (01..31) May be overridden via the document's + date front matter. + - name: i_day + desc: >- + Day of the month without leading zeros from the post's filename. May be overridden via the + document's date front matter. + - name: y_day + desc: >- + Ordinal day of the year from the post's filename, with leading zeros. (001..366) + - name: w_year + intro_ver: "4.0" + desc: >- + Week year which may differ from the month year for up to three days at the start of January + and end of December + - name: week + intro_ver: "4.0" + desc: >- + Week number of the current year, starting with the first week having a majority of its days + in January. (01..53) + - name: w_day + intro_ver: "4.0" + desc: >- + Day of the week, starting with Monday. (1..7) + - name: short_day + intro_ver: "4.0" + desc: >- + Three-letter weekday abbreviation, e.g. "Sun". + - name: long_day + intro_ver: "4.0" + desc: >- + Weekday name, e.g. "Sunday". + - name: hour + desc: >- + Hour of the day, 24-hour clock, zero-padded from the post's date front matter. (00..23) + - name: minute + desc: >- + Minute of the hour from the post's date front matter. (00..59) + - name: second + desc: >- + Second of the minute from the post's date front matter. (00..59) + - name: title + desc: >- + Title from the document's filename. May be overridden via the document's + slug front matter. Preserves case from the source. + - name: slug + desc: >- + Slugified title from the document's filename (any character except numbers and letters is + replaced as hyphen). May be overridden via the document's slug front matter. + - name: categories + desc: >- + The specified categories for this post. If a post has multiple categories, Jekyll will create + a hierarchy (e.g. /category1/category2). Also Jekyll automatically parses out + double slashes in the URLs, so if no categories are present, it will ignore this. + - name: slugified_categories + intro_ver: "4.1" + desc: >- + The specified categories for this post but slugified. If a category is a composite of + multiple words, Jekyll will downcase all alphabets and replace any non-alphanumeric character + with a hyphen. (e.g. "Work 2 Progress" will be converted into + "work-2-progress"). If a post has multiple categories, Jekyll will create + a hierarchy (e.g. /work-2-progress/category2). Also Jekyll automatically parses + out double slashes in the URLs, so if no categories are present, it will ignore this. + - name: output_ext + desc: >- + Extension of the output file. (Included by default and usually unnecessary.) + +builtin_formats: + - name: date + format: "/:categories/:year/:month/:day/:title:output_ext" + - name: pretty + format: "/:categories/:year/:month/:day/:title/" + - name: ordinal + format: "/:categories/:year/:y_day/:title:output_ext" + - name: weekdate + intro_ver: "4.0" + format: "/:categories/:year/W:week/:short_day/:title:output_ext" + note: "W will be prefixed to the value of :week" + - name: none + format: "/:categories/:title:output_ext" + +types: + documents: + - name: collection + desc: >- + Label of the containing collection. + - name: path + desc: >- + Path to the document relative to the collection's directory, including base filename of the document. + However, does not include the file extension. + - name: name + desc: >- + The document's base filename but slugified: downcased and every sequence of non-alphanumeric character + (including spaces) replaced by a hyphen. + - name: title + desc: >- + Takes on the value of front matter key slug if defined for the document. Otherwise takes + on the string value generated from the document's base filename by piping through the slugify + filter method with pretty option.
+ Regardless of the value taken, the case of the alphabets are preserved instead of being replaced with + lowercase counterparts. + - name: output_ext + desc: >- + Extension of the output file. (Included by default and usually unnecessary.) + pages: + - name: path + desc: >- + Path between the source directory and the base filename of the page. + - name: basename + desc: >- + The page's base filename. + - name: output_ext + desc: >- + Extension of the output file. (Included by default and usually unnecessary.) diff --git a/docs/_docs/permalinks.md b/docs/_docs/permalinks.md index 9611075d..2637ca95 100644 --- a/docs/_docs/permalinks.md +++ b/docs/_docs/permalinks.md @@ -55,237 +55,16 @@ Here's the full list of placeholders available: + {%- for entry in site.data.permalinks.placeholders %} - -

:year

- - -

- Year from the post’s filename with four digits. - May be overridden via the document’s date front matter. -

- - - - -

:short_year

- - -

- Year from the post’s filename without the century. (00..99) - May be overridden via the document’s date front matter. -

- - - - -

:month

- - -

- Month from the post’s filename. (01..12) - May be overridden via the document’s date front matter. -

- - - - -

:i_month

- - -

- Month without leading zeros from the post’s filename. May be - overridden via the document’s date front matter. -

- - - - -

:short_month

- - -

Three-letter month abbreviation, e.g. “Jan”.

- - - - -

:long_month

- {% include docs_version_badge.html version="4.0" %} - - -

Full month name, e.g. “January”.

- - - - -

:day

- - -

- Day of the month from the post’s filename. (01..31) - May be overridden via the document’s date front matter. -

- - - - -

:i_day

- - -

- Day of the month without leading zeros from the post’s filename. - May be overridden via the document’s date front matter. -

- - - - -

:y_day

- - -

Ordinal day of the year from the post’s filename, with leading zeros. (001..366)

- - - - -

:w_year

- {% include docs_version_badge.html version="4.0" %} - - -

Week year which may differ from the month year for up to three days at the start of January and end of December

- - - - -

:week

- {% include docs_version_badge.html version="4.0" %} - - -

Week number of the current year, starting with the first week having a majority of its days in January. (01..53)

- - - - -

:w_day

- {% include docs_version_badge.html version="4.0" %} - - -

Day of the week, starting with Monday. (1..7)

- - - - -

:short_day

- {% include docs_version_badge.html version="4.0" %} - - -

Three-letter weekday abbreviation, e.g. “Sun”.

- - - - -

:long_day

- {% include docs_version_badge.html version="4.0" %} - - -

Weekday name, e.g. “Sunday”.

- - - - -

:hour

- - -

- Hour of the day, 24-hour clock, zero-padded from the post’s - date front matter. (00..23) -

- - - - -

:minute

- - -

- Minute of the hour from the post’s date front matter. (00..59) -

- - - - -

:second

- - -

- Second of the minute from the post’s date front matter. (00..59) -

- - - - -

:title

- - -

- Title from the document’s filename. May be overridden via - the document’s slug front matter. Preserves case from the source. -

- - - - -

:slug

- - -

- Slugified title from the document’s filename (any character - except numbers and letters is replaced as hyphen). May be - overridden via the document’s slug front matter. -

- - - - -

:categories

- - -

- The specified categories for this post. If a post has multiple - categories, Jekyll will create a hierarchy (e.g. /category1/category2). - Also Jekyll automatically parses out double slashes in the URLs, - so if no categories are present, it will ignore this. -

- - - - -

:slugified_categories

- {% include docs_version_badge.html version="4.1" %} - - -

- The specified categories for this post but slugified. If a category is a - composite of multiple words, Jekyll will downcase all alphabets and replace any - non-alphanumeric character with a hyphen. (e.g. "Work 2 Progress" - will be converted into "work-2-progress") -

-

- If a post has multiple categories, Jekyll will create a hierarchy - (e.g. /work-2-progress/category2). - Also Jekyll automatically parses out double slashes in the URLs, - so if no categories are present, it will ignore this. -

- - - - -

:output_ext

- - -

Extension of the output file. (Included by default and usually unnecessary.)

+

:{{ entry.name }}

+ {%- if entry.intro_ver -%} + {% include docs_version_badge.html version = entry.intro_ver %} + {%- endif -%} +

{{ entry.desc }}

+ {%- endfor %} @@ -303,50 +82,22 @@ For posts, Jekyll also provides the following built-in styles for convenience: + {%- for entry in site.data.permalinks.builtin_formats %} - -

date

+

{{ entry.name }}

+ {%- if entry.intro_ver -%} + {% include docs_version_badge.html version = entry.intro_ver %} + {%- endif -%} -

/:categories/:year/:month/:day/:title:output_ext

- - - - -

pretty

- - -

/:categories/:year/:month/:day/:title/

- - - - -

ordinal

- - -

/:categories/:year/:y_day/:title:output_ext

- - - - -

weekdate

- {% include docs_version_badge.html version="4.0" %} - - -

- /:categories/:year/W:week/:short_day/:title:output_ext
- (W will be prefixed to the value of :week) +

{{ entry.format }} + {%- if entry.note -%}
+ ({{ entry.note }}) + {%- endif -%}

- - -

none

- - -

/:categories/:title:output_ext

- - + {%- endfor %} @@ -381,57 +132,12 @@ Collections have the following placeholders available: + {%- for entry in site.data.permalinks.types.documents -%} - -

:collection

- - -

Label of the containing collection.

- - - - -

:path

- - -

- Path to the document relative to the collection's directory, - including base filename of the document. -

- - - - -

:name

- - -

The document's base filename, with every sequence of spaces - and non-alphanumeric characters replaced by a hyphen.

- - - - -

:title

- - -

- The :title template variable will take the - slug front matter - variable value if any is present in the document; if none is - defined then :title will be equivalent to - :name, aka the slug generated from the filename. - Preserves case from the source. -

- - - - -

:output_ext

- - -

Extension of the output file. (Included by default and usually unnecessary.)

- +

:{{ entry.name }}

+

{{ entry.desc }}

+ {%- endfor -%} @@ -453,36 +159,12 @@ Pages have the following placeholders available: + {%- for entry in site.data.permalinks.types.pages -%} - -

:path

- - -

- Path to the page relative to the site's source directory, excluding - base filename of the page. -

- - - - -

:basename

- - -

The page's base filename

- - - - -

:output_ext

- - -

- Extension of the output file. (Included by default and usually - unnecessary.) -

- +

:{{ entry.name }}

+

{{ entry.desc }}

+ {%- endfor -%}