Fixes https://github.com/kaushalmodi/ox-hugo/issues/141 Regular page weight setting is same as before: Manual: #+hugo_weight: 100 Auto: #+hugo_weight: auto Taxonomy weight setting: Manual: #+hugo_weight: :tags 100 :categories 100 :series 100 Auto: #+hugo_weight: :tags auto :categories auto :series auto Regular page weight and Taxonomy weights together: #+hugo_weight: 50 :tags 100 :categories 100 :series 100 or if *not* specifying the page weight in the very beginning, use the :page keyword: #+hugo_weight: :tags 100 :categories 100 :page 50 :series 100master
parent
de397f0235
commit
01662ab78a
31 changed files with 297 additions and 48 deletions
@ -1,11 +1,11 @@ |
||||
+++ |
||||
title = "Hugo auto weight ineffective for per-file exports" |
||||
tags = ["weight"] |
||||
tags = ["weight", "ineffective"] |
||||
draft = false |
||||
+++ |
||||
|
||||
Even though we have `#+hugo_weight: auto` in this file, the weight |
||||
will be treated as nil as this file is exported using the _per-file_ |
||||
or _complete-file_ export flow. |
||||
will be treated as nil as this file is exported using the _file-based_ |
||||
export. |
||||
|
||||
The auto-weight calculation works **only** for _per-subtree_ flow. |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post with auto weight calc 1 (EXPORT_HUGO_WEIGHT as subtree property)" |
||||
tags = ["weight", "page-weight", "auto"] |
||||
weight = 4001 |
||||
draft = false |
||||
weight = 4001 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post with weight 123" |
||||
tags = ["weight", "page-weight", "manual"] |
||||
weight = 123 |
||||
draft = false |
||||
weight = 123 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post with auto weight calc 2 (EXPORT_HUGO_WEIGHT as subtree property)" |
||||
tags = ["weight", "page-weight", "auto"] |
||||
weight = 4002 |
||||
draft = false |
||||
weight = 4002 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post with auto weight calc 3 (EXPORT_HUGO_WEIGHT as subtree property)" |
||||
tags = ["weight", "page-weight", "auto"] |
||||
weight = 4003 |
||||
draft = false |
||||
weight = 4003 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post with auto weight calc 4 (EXPORT_HUGO_WEIGHT as subtree property)" |
||||
tags = ["weight", "page-weight", "auto"] |
||||
weight = 4004 |
||||
draft = false |
||||
weight = 4004 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post with weight 4567" |
||||
tags = ["weight", "page-weight", "manual"] |
||||
weight = 4567 |
||||
draft = false |
||||
weight = 4567 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post with auto weight calc 5 (EXPORT_HUGO_WEIGHT as subtree property)" |
||||
tags = ["weight", "page-weight", "auto"] |
||||
weight = 4005 |
||||
draft = false |
||||
weight = 4005 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post 1 with auto calculation of weight (HUGO_WEIGHT as keyword)" |
||||
tags = ["weight"] |
||||
weight = 1001 |
||||
draft = false |
||||
weight = 1001 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post 2 with auto calculation of weight (HUGO_WEIGHT as keyword)" |
||||
tags = ["weight"] |
||||
weight = 1002 |
||||
draft = false |
||||
weight = 1002 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post 3 with auto calculation of weight (HUGO_WEIGHT as keyword)" |
||||
tags = ["weight"] |
||||
weight = 1003 |
||||
draft = false |
||||
weight = 1003 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post 4 with auto calculation of weight (HUGO_WEIGHT as keyword)" |
||||
tags = ["weight"] |
||||
weight = 1004 |
||||
draft = false |
||||
weight = 1004 |
||||
+++ |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
+++ |
||||
title = "Post 5 with auto calculation of weight (HUGO_WEIGHT as keyword)" |
||||
tags = ["weight"] |
||||
weight = 1005 |
||||
draft = false |
||||
weight = 1005 |
||||
+++ |
||||
|
||||
@ -0,0 +1,12 @@ |
||||
+++ |
||||
title = "Taxonomy weights and page weight 1" |
||||
tags = ["weight", "taxonomy-weight", "manual", "tags", "page-weight", "categories"] |
||||
draft = false |
||||
categories_weight = 999 |
||||
tags_weight = 111 |
||||
weight = 77 |
||||
+++ |
||||
|
||||
If you want to specify page weight along with taxonomy weights, **and** |
||||
if you do not use the `:page` keyword before the weight value, the |
||||
page weight **must** be specified as the very first weight. |
||||
@ -0,0 +1,11 @@ |
||||
+++ |
||||
title = "Taxonomy weights and page weight 2" |
||||
tags = ["weight", "taxonomy-weight", "manual", "tags", "page-weight", "categories"] |
||||
draft = false |
||||
weight = 77 |
||||
categories_weight = 999 |
||||
tags_weight = 111 |
||||
+++ |
||||
|
||||
The page weight does not have to be specified as the very first weight |
||||
if using the `:page` keyword before the weight value. |
||||
@ -0,0 +1,13 @@ |
||||
+++ |
||||
title = "Taxonomy weights and page weight 3" |
||||
tags = ["weight", "taxonomy-weight", "manual", "tags", "page-weight", "categories"] |
||||
draft = false |
||||
categories_weight = 999 |
||||
tags_weight = 111 |
||||
weight = 77 |
||||
+++ |
||||
|
||||
If you want to specify page weight along with taxonomy weights, **and** |
||||
if you do not use the `:page` keyword before the weight value, the |
||||
page weight **must** be specified as the very first weight, even when |
||||
you specify the weights separately on each line. |
||||
@ -0,0 +1,11 @@ |
||||
+++ |
||||
title = "Taxonomy weights and page weight 4" |
||||
tags = ["weight", "taxonomy-weight", "manual", "tags", "page-weight", "categories"] |
||||
draft = false |
||||
categories_weight = 999 |
||||
weight = 77 |
||||
tags_weight = 111 |
||||
+++ |
||||
|
||||
The page weight does not have to be specified as the very first weight |
||||
if using the `:page` keyword before the weight value. |
||||
@ -0,0 +1,13 @@ |
||||
+++ |
||||
title = "Taxonomy weights and page weight (auto) 1" |
||||
tags = ["weight", "taxonomy-weight", "auto", "page-weight", "tags", "categories"] |
||||
draft = false |
||||
categories_weight = 5001 |
||||
tags_weight = 5001 |
||||
weight = 5001 |
||||
+++ |
||||
|
||||
If you want to specify page weight along with taxonomy weights, **and** |
||||
if you do not use the `:page` keyword before the weight value, the |
||||
page weight **must** be specified as the very first weight, even when |
||||
you specify the weights separately on each line. |
||||
@ -0,0 +1,11 @@ |
||||
+++ |
||||
title = "Taxonomy weights and page weight (auto) 2" |
||||
tags = ["weight", "taxonomy-weight", "auto", "page-weight", "tags", "categories"] |
||||
draft = false |
||||
categories_weight = 5002 |
||||
weight = 5002 |
||||
tags_weight = 5002 |
||||
+++ |
||||
|
||||
The page weight does not have to be specified as the very first weight |
||||
if using the `:page` keyword before the weight value. |
||||
@ -0,0 +1,6 @@ |
||||
+++ |
||||
title = "Taxonomy (categories) weight set 222" |
||||
tags = ["weight", "taxonomy-weight", "manual", "categories"] |
||||
draft = false |
||||
categories_weight = 222 |
||||
+++ |
||||
@ -0,0 +1,6 @@ |
||||
+++ |
||||
title = "Post with auto taxonomy (categories) weight calc 1" |
||||
tags = ["weight", "taxonomy-weight", "auto", "categories"] |
||||
draft = false |
||||
categories_weight = 5001 |
||||
+++ |
||||
@ -0,0 +1,6 @@ |
||||
+++ |
||||
title = "Post with auto taxonomy (categories) weight calc 2" |
||||
tags = ["weight", "taxonomy-weight", "auto", "categories"] |
||||
draft = false |
||||
categories_weight = 5002 |
||||
+++ |
||||
@ -0,0 +1,6 @@ |
||||
+++ |
||||
title = "Taxonomy (tags) weight set 111" |
||||
tags = ["weight", "taxonomy-weight", "manual", "tags"] |
||||
draft = false |
||||
tags_weight = 111 |
||||
+++ |
||||
@ -0,0 +1,6 @@ |
||||
+++ |
||||
title = "Post with auto taxonomy (tags) weight calc 1" |
||||
tags = ["weight", "taxonomy-weight", "auto", "tags"] |
||||
draft = false |
||||
tags_weight = 5001 |
||||
+++ |
||||
@ -0,0 +1,6 @@ |
||||
+++ |
||||
title = "Post with auto taxonomy (tags) weight calc 2" |
||||
tags = ["weight", "taxonomy-weight", "auto", "tags"] |
||||
draft = false |
||||
tags_weight = 5002 |
||||
+++ |
||||
Loading…
Reference in new issue