~dmbaturin/soupault

4 3

Understanding Indexes

Details
Message ID
<1f1d8376467e315a45ddc72551d058ec@aoirthoir.com>
DKIM signature
pass
Download raw message
Question 1
====================

The reference manual heading "Ways to control index rendering" it says 
"There are three options you can define view rendering"then lists, 
index_item_template, index_template, index_processor, and [file or lua 
source]. Is that 4 options instead of 3?


Question 2
====================

When it comes to index.fields.something, is the something literally just 
any name I want it to be? So for instance

[index.fields.excerpt]
   selector = ["p#post-excerpt", 'p"]

could just as well be:

[index.fields.candycane]
   selector = ["p#post-excerpt", 'p"]

So that the index.fields.something is just my decision and is not 
related to anything internally in soupault?

I realize that index.fields. has to be exactly that so I mean 
specifically after the second period.

Also is it the same with index.views.whatever, I can name the .whatever 
anything I want or is .blog for instance a built in to Soupault?

Question 3
====================

For index views, is index_selector = 'something'  just like other 
selectors in Soupault? So basically if I have <div id="blog-index"> in 
site/cats/index.html and i have index_selector = "#blog-index" in 
[index.views.something] then that list created with he 
index_item_template (etc) will be injected into site/cat/index.html and 
then output to build/cat/index.html ?

Question 4
====================

Does index.html (or index.md etc) merge with template/main.html (or 
whatever my template is?) and does index.html process widges?

Question 5
====================

In index.views how do I create lists for the different fields from 
index.fields. I see the examples and I know you can create lists for 
Authors or Dates or anything else you created under index.fields, butI 
cannot see how to choose which index.fields.whatever i want to use.

I presume for instance i would have index.fields.author and 
index.fields.date but i cannot figure out how to choose which index to 
use at any particular time.

Question 6
====================

OR is it that each of the index.fields.whatever is creating an index for 
a page like:

index.fields.title
index.fields.date
index.fields.excerpt
index.fields.reading_time

and then in my template as I am creating the particular 
index.views.whatever I would do this:

{{title}}
{{date}}
{{excerpt}}
{{reading_time}}

and so the index.fields.whatever is not actually creating a specific 
list and instead that is where

sort_by = "something" comes in so if I wanted all four of those above in 
separate lists I would so something like:

[index.views.title]
   sort_by = "title"
   index_select = "#titles"
   etc...

[index.views.author]
   sort_by = "author"
   index_selector = "#authors"

So then in my site/cat/index.html i could have separate sections for 
each list that I want to display (title order, author order, etc) and I 
just create a view, with a sort_by for each one that I want sorted in a 
different order?

Question 7
====================

So then would the way that I solve wanting to have separate page for 
posts by authors and posts by date be something like:

site/cats/titles/index.html
site/cats/authors/index.html

index.views.title]
   sort_by = "title"
   section = "cats/"
   index_select = "#titles"
   etc...

[index.views.author]
   sort_by = "author"
   section = "cats/"
   index_selector = "#authors"

and so site/cats/titles/index.html would be <tag id="titles"> and in 
site/cats/authors/index.html would be <tag id="authors">

The reason I ask this is it seems that index.* is what is the indexes... 
but i am presuming that does not mean index.authors.html and 
index.titles.html or... does it mean that?

Or is that pretty much what cloning was intended to accomplish?

==============

Thanks Kindly.
Aoirthoir.

---
This is a test signature.
Details
Message ID
<f1857845-2f42-5a57-3195-785eadd8d1b3@baturin.org>
In-Reply-To
<1f1d8376467e315a45ddc72551d058ec@aoirthoir.com> (view parent)
DKIM signature
pass
Download raw message
Hi Aoirthoir,


 >Is that 4 options instead of 3?

Indeed! There are only two hard problems in programming: cache 
invalidation, naming things, and off-by-one errors. ;)
I forgot to update the number when I added [file or lua_source], I'll 
fix that.

 >When it comes to index.fields.something, is the something literally 
just any name I want it to be?
 >So that the index.fields.something is just my decision and is not 
related to anything internally in soupault?

Yes, it's just a name of your choice that soupault will use for the 
field extracted using the rules you define for it.
Since soupault 2.0.0, there are no built-in _index_ fields anymore, they 
are all user-defined.

1.x versions had built-in title, author, excerpt, and date fields that 
were configured with index.date_selector etc.,
rather than as subtables under [index], but that made new options for 
custom fields such as extract_attribute unavailable for them,
so I dehardcoded the whole thing.

So, for my config for soupault.app 
(https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/main/soupault.toml#L45-L61),
entries look like this:

[
   {
     "url": "/blog/soupault-4.3.0-release",
     "page_file": "site/blog/soupault-4.3.0-release.md",
     "nav_path": [
       "blog"
     ],
     "reading_time": "less than a minute",
     "excerpt": "Soupault 4.3.0 is available for download...",
     "date": "2022-10-24",
     "title": "Soupault 4.3.0 release"
   },

url, page_file, and nav_path are generated by soupault from the page 
file path, all other names are from the index fields config.

 >For index views, is index_selector = 'something'  just like other 
selectors in Soupault? So basically if I have <div id="blog-index"> in 
site/cats/index.html and i have index_selector = "#blog-index" in 
[index.views.something] then that list created with he 
index_item_template (etc) will be injected into site/cat/index.html and 
then output to build/cat/index.html ?

Yes, index_selector defines where soupault will insert the generated 
HTML for the index.

 >Does index.html (or index.md etc) merge with template/main.html (or 
whatever my template is?) and does index.html process widges?

The only special thing about index.* pages is that (by default) they 
_aren't_ subject to index field extraction and _are_ subject to 
generated index insertion.
Otherwise, they are treated like all other pages: they are inserted into 
templates/main.html _if_ they don't have a <html> element in them already,
and all widgets run on them unless the page is excluded by 
page/section/path_regex options of a specfic widget.

(You can force soupault to treat an index.* page as a content page: 
https://soupault.app/reference-manual/#treating-index-pages-as-normal-pages
You can also make index data available to every page: 
https://soupault.app/reference-manual/#making-index-data-available-to-every-page
Those options don't change templating or widget behavior for index 
pages, though.)

 >I presume for instance i would have index.fields.author and 
index.fields.date but i cannot figure out how to choose which index to 
use at any particular time.

Oh, no, you don't have to choose! Every field is present in the index 
entry for every page.
You can see an example for the soupault blog here: 
https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/main/soupault.toml#L84-L92

 >So then in my site/cat/index.html i could have separate sections for 
each list that I want to display (title order, author order, etc) and I 
just create a view, with a sort_by for each one that I want sorted in a 
different order?

One option is to make multiple views with different sort_by indeed. 
Since you likely want to display e.g. title and author differently,
you will need  slightly different template for each of those anyway, I 
suppose.

An alternative is to sort and group entries using template filters:
http://tategakibunko.github.io/jingoo/templates/templates.en.html#filter_sort
http://tategakibunko.github.io/jingoo/templates/templates.en.html#filter_groupby

I hope this helps,
Daniil

On 10/27/22 08:08, aoirthoir@aoirthoir.com wrote:
>
> Question 1
> ====================
>
> The reference manual heading "Ways to control index rendering" it says 
> "There are three options you can define view rendering"then lists, 
> index_item_template, index_template, index_processor, and [file or lua 
> source]. Is that 4 options instead of 3?
>
>
> Question 2
> ====================
>
> When it comes to index.fields.something, is the something literally 
> just any name I want it to be? So for instance
>
> [index.fields.excerpt]
>   selector = ["p#post-excerpt", 'p"]
>
> could just as well be:
>
> [index.fields.candycane]
>   selector = ["p#post-excerpt", 'p"]
>
> So that the index.fields.something is just my decision and is not 
> related to anything internally in soupault?
>
> I realize that index.fields. has to be exactly that so I mean 
> specifically after the second period.
>
> Also is it the same with index.views.whatever, I can name the 
> .whatever anything I want or is .blog for instance a built in to 
> Soupault?
>
> Question 3
> ====================
>
> For index views, is index_selector = 'something'  just like other 
> selectors in Soupault? So basically if I have <div id="blog-index"> in 
> site/cats/index.html and i have index_selector = "#blog-index" in 
> [index.views.something] then that list created with he 
> index_item_template (etc) will be injected into site/cat/index.html 
> and then output to build/cat/index.html ?
>
> Question 4
> ====================
>
> Does index.html (or index.md etc) merge with template/main.html (or 
> whatever my template is?) and does index.html process widges?
>
> Question 5
> ====================
>
> In index.views how do I create lists for the different fields from 
> index.fields. I see the examples and I know you can create lists for 
> Authors or Dates or anything else you created under index.fields, butI 
> cannot see how to choose which index.fields.whatever i want to use.
>
> I presume for instance i would have index.fields.author and 
> index.fields.date but i cannot figure out how to choose which index to 
> use at any particular time.
>
> Question 6
> ====================
>
> OR is it that each of the index.fields.whatever is creating an index 
> for a page like:
>
> index.fields.title
> index.fields.date
> index.fields.excerpt
> index.fields.reading_time
>
> and then in my template as I am creating the particular 
> index.views.whatever I would do this:
>
> {{title}}
> {{date}}
> {{excerpt}}
> {{reading_time}}
>
> and so the index.fields.whatever is not actually creating a specific 
> list and instead that is where
>
> sort_by = "something" comes in so if I wanted all four of those above 
> in separate lists I would so something like:
>
> [index.views.title]
>   sort_by = "title"
>   index_select = "#titles"
>   etc...
>
> [index.views.author]
>   sort_by = "author"
>   index_selector = "#authors"
>
> So then in my site/cat/index.html i could have separate sections for 
> each list that I want to display (title order, author order, etc) and 
> I just create a view, with a sort_by for each one that I want sorted 
> in a different order?
>
> Question 7
> ====================
>
> So then would the way that I solve wanting to have separate page for 
> posts by authors and posts by date be something like:
>
> site/cats/titles/index.html
> site/cats/authors/index.html
>
> index.views.title]
>   sort_by = "title"
>   section = "cats/"
>   index_select = "#titles"
>   etc...
>
> [index.views.author]
>   sort_by = "author"
>   section = "cats/"
>   index_selector = "#authors"
>
> and so site/cats/titles/index.html would be <tag id="titles"> and in 
> site/cats/authors/index.html would be <tag id="authors">
>
> The reason I ask this is it seems that index.* is what is the 
> indexes... but i am presuming that does not mean index.authors.html 
> and index.titles.html or... does it mean that?
>
> Or is that pretty much what cloning was intended to accomplish?
>
> ==============
>
> Thanks Kindly.
> Aoirthoir.
>
> ---
> This is a test signature.
Details
Message ID
<9016609d5e6cedb0507efa3acc101832@aoirthoir.com>
In-Reply-To
<f1857845-2f42-5a57-3195-785eadd8d1b3@baturin.org> (view parent)
DKIM signature
pass
Download raw message
Question A1
====================

> when I added [file or lua_source], I'll fix that.

I see how to use a lua_source = """
   some code
"""

but how do we use a file? is it just lua_source = path.to.file or is it 
file = path.to.file

Question A2
====================

I notice you have several things with something = with three quotes. I 
do not know if that means that is how we do it or something? Is that 
some indicator of multi-line content.

Question A3
====================

I went to the soupault.app link you provided on codeberg and I 
understand that a lot better.

site/blog/index.html is the index where #blog-index is located. So all 
files in site/blog will be indexed and added to the div id="blog-index" 
in index.html.

If say you wanted to also have an index on title in addition to date you 
might create a second div id="title-index" then copy lines 63-93 
changing the certain lines in the new section to match something like:

(old lines 63-66 but would have new line numbers due to the copy paste)

[index.views.title]
     index_selector = "#title-index"
     sort_by = "title"
     sort_type = "lexicographic"

All the rest of the settings for index.views.title would be exactly the 
same as index.views.blog?

So then you would have two completely  different lists under two 
completely different div tags, each sorted separately?

Does that sound about right?

This weekend i will try to download the entire soupault.app from 
codeberg to test with a known working quantity so I can try to 
understand this better.

Question A4
====================

Lines 68 and 69 seem to indicate pagination is set to 5 items but on the 
website the entire blog shows up on 1 page. Am I missing something?

68: paginate = true
69: items_per_page = 5

Question A5
====================

> Oh, no, you don't have to choose! Every field is present in the index 
> entry for every page

Correct that much I understand. What I am confused about is how I would 
have different pages for different taxonomies (in wordpress parlance).

I believe the steps I detailed above under Question A3 explain how I 
would put different lists, sorted in different orders, in a page. But 
what if I wanted separate links by sort how to accomplish that.

> You can also make index data available to every page

I am guessing that this would be the key?

site/blog/index.html could be set up to have div="index-blog" and sort 
on date.

site/blog/authors.html could be set up to have div="author-index" and 
sort on author.

site/blog/titles.html could be set up to have div="title-index" and sort 
on title.

so if index_first = true

does that mean that [index.views.something] is basically run on every 
page and that means that if a certain page does not have the appropriate 
div="something-index" for that particular view well then it just is not 
run?

If that is the case then it all makes sense to me now.

Question A6
====================

If that is the case then then the next question is in the above example 
how would I prevent authors.html and titles.html from being included in 
the index?

END
====================

Thanks Kindly
Aoirthoir


On 2022-10-27 05:37, Daniil Baturin wrote:
> Hi Aoirthoir,
> 
> 
>> Is that 4 options instead of 3?
> 
> Indeed! There are only two hard problems in programming: cache
> invalidation, naming things, and off-by-one errors. ;)
> I forgot to update the number when I added [file or lua_source], I'll 
> fix that.
> 
>> When it comes to index.fields.something, is the something literally 
>> just any name I want it to be?
>> So that the index.fields.something is just my decision and is not 
>> related to anything internally in soupault?
> 
> Yes, it's just a name of your choice that soupault will use for the
> field extracted using the rules you define for it.
> Since soupault 2.0.0, there are no built-in _index_ fields anymore,
> they are all user-defined.
> 
> 1.x versions had built-in title, author, excerpt, and date fields that
> were configured with index.date_selector etc.,
> rather than as subtables under [index], but that made new options for
> custom fields such as extract_attribute unavailable for them,
> so I dehardcoded the whole thing.
> 
> So, for my config for soupault.app
> (https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/main/soupault.toml#L45-L61),
> entries look like this:
> 
> [
>   {
>     "url": "/blog/soupault-4.3.0-release",
>     "page_file": "site/blog/soupault-4.3.0-release.md",
>     "nav_path": [
>       "blog"
>     ],
>     "reading_time": "less than a minute",
>     "excerpt": "Soupault 4.3.0 is available for download...",
>     "date": "2022-10-24",
>     "title": "Soupault 4.3.0 release"
>   },
> 
> url, page_file, and nav_path are generated by soupault from the page
> file path, all other names are from the index fields config.
> 
>> For index views, is index_selector = 'something'  just like other 
>> selectors in Soupault? So basically if I have <div id="blog-index"> in 
>> site/cats/index.html and i have index_selector = "#blog-index" in 
>> [index.views.something] then that list created with he 
>> index_item_template (etc) will be injected into site/cat/index.html 
>> and then output to build/cat/index.html ?
> 
> Yes, index_selector defines where soupault will insert the generated
> HTML for the index.
> 
>> Does index.html (or index.md etc) merge with template/main.html (or 
>> whatever my template is?) and does index.html process widges?
> 
> The only special thing about index.* pages is that (by default) they
> _aren't_ subject to index field extraction and _are_ subject to
> generated index insertion.
> Otherwise, they are treated like all other pages: they are inserted
> into templates/main.html _if_ they don't have a <html> element in them
> already,
> and all widgets run on them unless the page is excluded by
> page/section/path_regex options of a specfic widget.
> 
> (You can force soupault to treat an index.* page as a content page:
> https://soupault.app/reference-manual/#treating-index-pages-as-normal-pages
> You can also make index data available to every page:
> https://soupault.app/reference-manual/#making-index-data-available-to-every-page
> Those options don't change templating or widget behavior for index
> pages, though.)
> 
>> I presume for instance i would have index.fields.author and 
>> index.fields.date but i cannot figure out how to choose which index to 
>> use at any particular time.
> 
> Oh, no, you don't have to choose! Every field is present in the index
> entry for every page.
> You can see an example for the soupault blog here:
> https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/main/soupault.toml#L84-L92
> 
>> So then in my site/cat/index.html i could have separate sections for 
>> each list that I want to display (title order, author order, etc) and 
>> I just create a view, with a sort_by for each one that I want sorted 
>> in a different order?
> 
> One option is to make multiple views with different sort_by indeed.
> Since you likely want to display e.g. title and author differently,
> you will need  slightly different template for each of those anyway, I 
> suppose.
> 
> An alternative is to sort and group entries using template filters:
> http://tategakibunko.github.io/jingoo/templates/templates.en.html#filter_sort
> http://tategakibunko.github.io/jingoo/templates/templates.en.html#filter_groupby
> 
> I hope this helps,
> Daniil
> 
> On 10/27/22 08:08, aoirthoir@aoirthoir.com wrote:
>> 
>> Question 1
>> ====================
>> 
>> The reference manual heading "Ways to control index rendering" it says 
>> "There are three options you can define view rendering"then lists, 
>> index_item_template, index_template, index_processor, and [file or lua 
>> source]. Is that 4 options instead of 3?
>> 
>> 
>> Question 2
>> ====================
>> 
>> When it comes to index.fields.something, is the something literally 
>> just any name I want it to be? So for instance
>> 
>> [index.fields.excerpt]
>>   selector = ["p#post-excerpt", 'p"]
>> 
>> could just as well be:
>> 
>> [index.fields.candycane]
>>   selector = ["p#post-excerpt", 'p"]
>> 
>> So that the index.fields.something is just my decision and is not 
>> related to anything internally in soupault?
>> 
>> I realize that index.fields. has to be exactly that so I mean 
>> specifically after the second period.
>> 
>> Also is it the same with index.views.whatever, I can name the 
>> .whatever anything I want or is .blog for instance a built in to 
>> Soupault?
>> 
>> Question 3
>> ====================
>> 
>> For index views, is index_selector = 'something'  just like other 
>> selectors in Soupault? So basically if I have <div id="blog-index"> in 
>> site/cats/index.html and i have index_selector = "#blog-index" in 
>> [index.views.something] then that list created with he 
>> index_item_template (etc) will be injected into site/cat/index.html 
>> and then output to build/cat/index.html ?
>> 
>> Question 4
>> ====================
>> 
>> Does index.html (or index.md etc) merge with template/main.html (or 
>> whatever my template is?) and does index.html process widges?
>> 
>> Question 5
>> ====================
>> 
>> In index.views how do I create lists for the different fields from 
>> index.fields. I see the examples and I know you can create lists for 
>> Authors or Dates or anything else you created under index.fields, butI 
>> cannot see how to choose which index.fields.whatever i want to use.
>> 
>> I presume for instance i would have index.fields.author and 
>> index.fields.date but i cannot figure out how to choose which index to 
>> use at any particular time.
>> 
>> Question 6
>> ====================
>> 
>> OR is it that each of the index.fields.whatever is creating an index 
>> for a page like:
>> 
>> index.fields.title
>> index.fields.date
>> index.fields.excerpt
>> index.fields.reading_time
>> 
>> and then in my template as I am creating the particular 
>> index.views.whatever I would do this:
>> 
>> {{title}}
>> {{date}}
>> {{excerpt}}
>> {{reading_time}}
>> 
>> and so the index.fields.whatever is not actually creating a specific 
>> list and instead that is where
>> 
>> sort_by = "something" comes in so if I wanted all four of those above 
>> in separate lists I would so something like:
>> 
>> [index.views.title]
>>   sort_by = "title"
>>   index_select = "#titles"
>>   etc...
>> 
>> [index.views.author]
>>   sort_by = "author"
>>   index_selector = "#authors"
>> 
>> So then in my site/cat/index.html i could have separate sections for 
>> each list that I want to display (title order, author order, etc) and 
>> I just create a view, with a sort_by for each one that I want sorted 
>> in a different order?
>> 
>> Question 7
>> ====================
>> 
>> So then would the way that I solve wanting to have separate page for 
>> posts by authors and posts by date be something like:
>> 
>> site/cats/titles/index.html
>> site/cats/authors/index.html
>> 
>> index.views.title]
>>   sort_by = "title"
>>   section = "cats/"
>>   index_select = "#titles"
>>   etc...
>> 
>> [index.views.author]
>>   sort_by = "author"
>>   section = "cats/"
>>   index_selector = "#authors"
>> 
>> and so site/cats/titles/index.html would be <tag id="titles"> and in 
>> site/cats/authors/index.html would be <tag id="authors">
>> 
>> The reason I ask this is it seems that index.* is what is the 
>> indexes... but i am presuming that does not mean index.authors.html 
>> and index.titles.html or... does it mean that?
>> 
>> Or is that pretty much what cloning was intended to accomplish?
>> 
>> ==============
>> 
>> Thanks Kindly.
>> Aoirthoir.
>> 
>> ---
>> This is a test signature.
Details
Message ID
<ccc42ebb-f1bf-38b4-a5a7-9f0b385cb210@baturin.org>
In-Reply-To
<9016609d5e6cedb0507efa3acc101832@aoirthoir.com> (view parent)
DKIM signature
pass
Download raw message
Hi Aorthoir,

 >but how do we use a file? is it just lua_source = path.to.file or is 
it file = path.to.file

The "lua_source" is always an inline Lua source, while "file" is always 
a path to a file.
Here is an example of lua_source usage: 
https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/main/soupault.toml#L94-L98

 >site/blog/index.html is the index where #blog-index is located. So all 
files in site/blog will be indexed and added to the div id="blog-index" 
in index.html.

All pages are always indexed (as of 4.3.0). The fully correct way to say 
it is that if an index is rendered on site/blog/index.html,
then only entries from site/blog/* pages will be included by default.
You can change that and include entries from a different section: 
https://soupault.app/reference-manual/#index-view-options

 >All the rest of the settings for index.views.title would be exactly 
the same as index.views.blog?
 >So then you would have two completely  different lists under two 
completely different div tags, each sorted separately?

Different views are completely independent indeed.
They also don't inherit anything but default settings.

 >Lines 68 and 69 seem to indicate pagination is set to 5 items but on 
the website the entire blog shows up on 1 page. Am I missing something?

Oh, good catch! I accidentally committed a config with options from my 
experiments with a Lua paginator.

There is no built-in pagination, it would be done by a Lua index 
processor. Lua index processors can inject new pages in the queue,
so you can use that trick for many purposes, from pagination to 
arbitrary taxonomies.

I'm generating indices of posts by tag on my own blog using that 
mechanism: https://baturin.org/blog/tag/
https://github.com/dmbaturin/baturin.org/blob/master/soupault.toml#L113-L126

Somehow I can't find the paginator script I used for experiments in the 
soupault.app blog, though.
I seem to recall I wasn't confident enough about its robustness to 
expose other people to it.
For now I'll remove those options, but I need to get back to making a 
fully-reusable paginator some time.

 >does that mean that [index.views.something] is basically run on every 
page and that means that if a certain page does not have the appropriate 
div="something-index" for that particular view well then it just is not 
run?

Yes, every index view checks every page for an element that would match 
its selector. If there's such an element, it renders and inserts its index,
if not, then it ignores that page.
I need to document that in the manual, I suppose. Right now it may not 
be very clear.

 >If that is the case then then the next question is in the above 
example how would I prevent authors.html and titles.html from being 
included in the index?

Right now, soupault doesn't extract index data from a) index pages 
(*/index.* by default) and from pages generated by Lua index processors.
So the simplest way to exclude a page is to make it an index page, like 
site/authors/index.html
However, now I wonder if I should add an option to explicitly exclude 
certain pages from indexing in the next version.


On 10/28/22 02:41, aoirthoir@aoirthoir.com wrote:
> Question A1
> ====================
>
>> when I added [file or lua_source], I'll fix that.
>
> I see how to use a lua_source = """
>   some code
> """
>
> but how do we use a file? is it just lua_source = path.to.file or is 
> it file = path.to.file
>
> Question A2
> ====================
>
> I notice you have several things with something = with three quotes. I 
> do not know if that means that is how we do it or something? Is that 
> some indicator of multi-line content.
>
> Question A3
> ====================
>
> I went to the soupault.app link you provided on codeberg and I 
> understand that a lot better.
>
> site/blog/index.html is the index where #blog-index is located. So all 
> files in site/blog will be indexed and added to the div 
> id="blog-index" in index.html.
>
> If say you wanted to also have an index on title in addition to date 
> you might create a second div id="title-index" then copy lines 63-93 
> changing the certain lines in the new section to match something like:
>
> (old lines 63-66 but would have new line numbers due to the copy paste)
>
> [index.views.title]
>     index_selector = "#title-index"
>     sort_by = "title"
>     sort_type = "lexicographic"
>
> All the rest of the settings for index.views.title would be exactly 
> the same as index.views.blog?
>
> So then you would have two completely  different lists under two 
> completely different div tags, each sorted separately?
>
> Does that sound about right?
>
> This weekend i will try to download the entire soupault.app from 
> codeberg to test with a known working quantity so I can try to 
> understand this better.
>
> Question A4
> ====================
>
> Lines 68 and 69 seem to indicate pagination is set to 5 items but on 
> the website the entire blog shows up on 1 page. Am I missing something?
>
> 68: paginate = true
> 69: items_per_page = 5
>
> Question A5
> ====================
>
>> Oh, no, you don't have to choose! Every field is present in the index 
>> entry for every page
>
> Correct that much I understand. What I am confused about is how I 
> would have different pages for different taxonomies (in wordpress 
> parlance).
>
> I believe the steps I detailed above under Question A3 explain how I 
> would put different lists, sorted in different orders, in a page. But 
> what if I wanted separate links by sort how to accomplish that.
>
>> You can also make index data available to every page
>
> I am guessing that this would be the key?
>
> site/blog/index.html could be set up to have div="index-blog" and sort 
> on date.
>
> site/blog/authors.html could be set up to have div="author-index" and 
> sort on author.
>
> site/blog/titles.html could be set up to have div="title-index" and 
> sort on title.
>
> so if index_first = true
>
> does that mean that [index.views.something] is basically run on every 
> page and that means that if a certain page does not have the 
> appropriate div="something-index" for that particular view well then 
> it just is not run?
>
> If that is the case then it all makes sense to me now.
>
> Question A6
> ====================
>
> If that is the case then then the next question is in the above 
> example how would I prevent authors.html and titles.html from being 
> included in the index?
>
> END
> ====================
>
> Thanks Kindly
> Aoirthoir
>
>
> On 2022-10-27 05:37, Daniil Baturin wrote:
>> Hi Aoirthoir,
>>
>>
>>> Is that 4 options instead of 3?
>>
>> Indeed! There are only two hard problems in programming: cache
>> invalidation, naming things, and off-by-one errors. ;)
>> I forgot to update the number when I added [file or lua_source], I'll 
>> fix that.
>>
>>> When it comes to index.fields.something, is the something literally 
>>> just any name I want it to be?
>>> So that the index.fields.something is just my decision and is not 
>>> related to anything internally in soupault?
>>
>> Yes, it's just a name of your choice that soupault will use for the
>> field extracted using the rules you define for it.
>> Since soupault 2.0.0, there are no built-in _index_ fields anymore,
>> they are all user-defined.
>>
>> 1.x versions had built-in title, author, excerpt, and date fields that
>> were configured with index.date_selector etc.,
>> rather than as subtables under [index], but that made new options for
>> custom fields such as extract_attribute unavailable for them,
>> so I dehardcoded the whole thing.
>>
>> So, for my config for soupault.app
>> (https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/main/soupault.toml#L45-L61), 
>>
>> entries look like this:
>>
>> [
>>   {
>>     "url": "/blog/soupault-4.3.0-release",
>>     "page_file": "site/blog/soupault-4.3.0-release.md",
>>     "nav_path": [
>>       "blog"
>>     ],
>>     "reading_time": "less than a minute",
>>     "excerpt": "Soupault 4.3.0 is available for download...",
>>     "date": "2022-10-24",
>>     "title": "Soupault 4.3.0 release"
>>   },
>>
>> url, page_file, and nav_path are generated by soupault from the page
>> file path, all other names are from the index fields config.
>>
>>> For index views, is index_selector = 'something'  just like other 
>>> selectors in Soupault? So basically if I have <div id="blog-index"> 
>>> in site/cats/index.html and i have index_selector = "#blog-index" in 
>>> [index.views.something] then that list created with he 
>>> index_item_template (etc) will be injected into site/cat/index.html 
>>> and then output to build/cat/index.html ?
>>
>> Yes, index_selector defines where soupault will insert the generated
>> HTML for the index.
>>
>>> Does index.html (or index.md etc) merge with template/main.html (or 
>>> whatever my template is?) and does index.html process widges?
>>
>> The only special thing about index.* pages is that (by default) they
>> _aren't_ subject to index field extraction and _are_ subject to
>> generated index insertion.
>> Otherwise, they are treated like all other pages: they are inserted
>> into templates/main.html _if_ they don't have a <html> element in them
>> already,
>> and all widgets run on them unless the page is excluded by
>> page/section/path_regex options of a specfic widget.
>>
>> (You can force soupault to treat an index.* page as a content page:
>> https://soupault.app/reference-manual/#treating-index-pages-as-normal-pages 
>>
>> You can also make index data available to every page:
>> https://soupault.app/reference-manual/#making-index-data-available-to-every-page 
>>
>> Those options don't change templating or widget behavior for index
>> pages, though.)
>>
>>> I presume for instance i would have index.fields.author and 
>>> index.fields.date but i cannot figure out how to choose which index 
>>> to use at any particular time.
>>
>> Oh, no, you don't have to choose! Every field is present in the index
>> entry for every page.
>> You can see an example for the soupault blog here:
>> https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/main/soupault.toml#L84-L92 
>>
>>
>>> So then in my site/cat/index.html i could have separate sections for 
>>> each list that I want to display (title order, author order, etc) 
>>> and I just create a view, with a sort_by for each one that I want 
>>> sorted in a different order?
>>
>> One option is to make multiple views with different sort_by indeed.
>> Since you likely want to display e.g. title and author differently,
>> you will need  slightly different template for each of those anyway, 
>> I suppose.
>>
>> An alternative is to sort and group entries using template filters:
>> http://tategakibunko.github.io/jingoo/templates/templates.en.html#filter_sort 
>>
>> http://tategakibunko.github.io/jingoo/templates/templates.en.html#filter_groupby 
>>
>>
>> I hope this helps,
>> Daniil
>>
>> On 10/27/22 08:08, aoirthoir@aoirthoir.com wrote:
>>>
>>> Question 1
>>> ====================
>>>
>>> The reference manual heading "Ways to control index rendering" it 
>>> says "There are three options you can define view rendering"then 
>>> lists, index_item_template, index_template, index_processor, and 
>>> [file or lua source]. Is that 4 options instead of 3?
>>>
>>>
>>> Question 2
>>> ====================
>>>
>>> When it comes to index.fields.something, is the something literally 
>>> just any name I want it to be? So for instance
>>>
>>> [index.fields.excerpt]
>>>   selector = ["p#post-excerpt", 'p"]
>>>
>>> could just as well be:
>>>
>>> [index.fields.candycane]
>>>   selector = ["p#post-excerpt", 'p"]
>>>
>>> So that the index.fields.something is just my decision and is not 
>>> related to anything internally in soupault?
>>>
>>> I realize that index.fields. has to be exactly that so I mean 
>>> specifically after the second period.
>>>
>>> Also is it the same with index.views.whatever, I can name the 
>>> .whatever anything I want or is .blog for instance a built in to 
>>> Soupault?
>>>
>>> Question 3
>>> ====================
>>>
>>> For index views, is index_selector = 'something'  just like other 
>>> selectors in Soupault? So basically if I have <div id="blog-index"> 
>>> in site/cats/index.html and i have index_selector = "#blog-index" in 
>>> [index.views.something] then that list created with he 
>>> index_item_template (etc) will be injected into site/cat/index.html 
>>> and then output to build/cat/index.html ?
>>>
>>> Question 4
>>> ====================
>>>
>>> Does index.html (or index.md etc) merge with template/main.html (or 
>>> whatever my template is?) and does index.html process widges?
>>>
>>> Question 5
>>> ====================
>>>
>>> In index.views how do I create lists for the different fields from 
>>> index.fields. I see the examples and I know you can create lists for 
>>> Authors or Dates or anything else you created under index.fields, 
>>> butI cannot see how to choose which index.fields.whatever i want to 
>>> use.
>>>
>>> I presume for instance i would have index.fields.author and 
>>> index.fields.date but i cannot figure out how to choose which index 
>>> to use at any particular time.
>>>
>>> Question 6
>>> ====================
>>>
>>> OR is it that each of the index.fields.whatever is creating an index 
>>> for a page like:
>>>
>>> index.fields.title
>>> index.fields.date
>>> index.fields.excerpt
>>> index.fields.reading_time
>>>
>>> and then in my template as I am creating the particular 
>>> index.views.whatever I would do this:
>>>
>>> {{title}}
>>> {{date}}
>>> {{excerpt}}
>>> {{reading_time}}
>>>
>>> and so the index.fields.whatever is not actually creating a specific 
>>> list and instead that is where
>>>
>>> sort_by = "something" comes in so if I wanted all four of those 
>>> above in separate lists I would so something like:
>>>
>>> [index.views.title]
>>>   sort_by = "title"
>>>   index_select = "#titles"
>>>   etc...
>>>
>>> [index.views.author]
>>>   sort_by = "author"
>>>   index_selector = "#authors"
>>>
>>> So then in my site/cat/index.html i could have separate sections for 
>>> each list that I want to display (title order, author order, etc) 
>>> and I just create a view, with a sort_by for each one that I want 
>>> sorted in a different order?
>>>
>>> Question 7
>>> ====================
>>>
>>> So then would the way that I solve wanting to have separate page for 
>>> posts by authors and posts by date be something like:
>>>
>>> site/cats/titles/index.html
>>> site/cats/authors/index.html
>>>
>>> index.views.title]
>>>   sort_by = "title"
>>>   section = "cats/"
>>>   index_select = "#titles"
>>>   etc...
>>>
>>> [index.views.author]
>>>   sort_by = "author"
>>>   section = "cats/"
>>>   index_selector = "#authors"
>>>
>>> and so site/cats/titles/index.html would be <tag id="titles"> and in 
>>> site/cats/authors/index.html would be <tag id="authors">
>>>
>>> The reason I ask this is it seems that index.* is what is the 
>>> indexes... but i am presuming that does not mean index.authors.html 
>>> and index.titles.html or... does it mean that?
>>>
>>> Or is that pretty much what cloning was intended to accomplish?
>>>
>>> ==============
>>>
>>> Thanks Kindly.
>>> Aoirthoir.
>>>
>>> ---
>>> This is a test signature.
Details
Message ID
<6b408a977e1bac4cb0bb0ac694e05d61449c6075.camel@aoirthoir.com>
In-Reply-To
<ccc42ebb-f1bf-38b4-a5a7-9f0b385cb210@baturin.org> (view parent)
DKIM signature
pass
Download raw message
>while "file" is always a path to a file.

I presume that is a lua file? In your example for tags from 
baturin.org it is a lua file? So does file = path.to.file
always mean a lua file?

Also is it the built in lua processor in Soupault?

Also is that still version 2.something?

>Lua index processors can inject new pages in the queue,
>so you can use that trick for many purposes, from pagination to 
>arbitrary taxonomies.

That is the example in the documentation under the heading
Lua In dex Processor, where you clone the index file. The
only part I am not clear about in regards to cloning is
if a specific line actually saves the cloned file, or does
soupault just do that automatically.

>pages = {}
>pages[1] = {}
>pages[1]["page_file"] = Sys.join_path(Sys.dirname(page_file),
>"index_clone.html")
>pages[1]["page_content"] = HTML.pretty_print(page)

So mostly i get what those lines are doing. Just not sure which one 
actually writes out the file. Or as mention if soupault just does that
on its own.

>Yes, every index view checks every page for an element that would
match 
>its selector. If there's such an element, it renders and inserts its
index,
>if not, then it ignores that page.

It should have been obvious to me but as you can see I was kinda
confused about
indexes and they are far simpler than I was making them out to be in my
mind.

Basically in Souapault you keep on following the same consistent and
useful and
good design. Whether it is in indexes or widgets and plugins or other
things, if
a particular element exists it is used or changed and if not then no
issue it
is just skipped. I don't know why I was confusing the matter but
sometimes I am 
not smart (: 

>Right now, soupault doesn't extract index data from a) index pages 
>(*/index.* by default) and from pages generated by Lua index
processors.

Ah so that makes sense now. So the lua_processor = or the file = could
generate authors.html and titles.html.

But if I were to create blog/authors/index.html and
blog/titles/index.html
then i would have: 

[index.views.authors]
  section = "blog/"

[index.views.titles]
  section = "blog/"

among other things?

Tho to be honest now that I am understanding indexing better including
lua_processor and file, it seems it would be easier to just use that,
output based on an array of key/value pairs.. I will think it over.

>However, now I wonder if I should add an option to explicitly exclude 
>certain pages from indexing in the next version.

That makes sense but also I wonder, since the code is already there for
index.* what if you just changed it to index*.*? Then we could just
create
index.html, index-authors.html, index-titles.html. I do not know OCAML
so I do
not know if this is a minor change. 

I have to look at your example for your taxonomies to understand better
what
you are doing there. 

In the soupault.toml I notice several places where you use three single
or
three double quotes after the equal sign like this (Q represents the
quotes):

something = QQQ
  some code
  more code
QQQ

for instance:

index.views.blog]
  index_selector = "#blog-index"
  index_template = QQQ
    {% for e in entries %}
    <h2><a href="{{url}}">{{title}}</a></h2>
    <p><strong>Last update:</strong> {{date}}.</p>
    <p><strong>Reading time:</strong> {{reading_time}}.</p>
    <p>{{excerpt}}</p>
    <a href="{{url}}">Read more</a>
    {% endfor %}
  QQQ
  
Is that how you do mutliline quotes? I presume if I did a single quote
it would
not work? I replace the quotes with QQQ to make it more evident because
when
i tried to send before it seems the quotes disappear at least in my
email.


Thanks Kindly

On Fri, 2022-10-28 at 12:38 +0100, Daniil Baturin wrote:
> Hi Aorthoir,
> 
>  >but how do we use a file? is it just lua_source = path.to.file or
> is 
> it file = path.to.file
> 
> The "lua_source" is always an inline Lua source, while "file" is
> always 
> a path to a file.
> Here is an example of lua_source usage: 
> https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/main/soupault.toml#L94-L98
> 
>  >site/blog/index.html is the index where #blog-index is located. So
> all 
> files in site/blog will be indexed and added to the div id="blog-
> index" 
> in index.html.
> 
> All pages are always indexed (as of 4.3.0). The fully correct way to
> say 
> it is that if an index is rendered on site/blog/index.html,
> then only entries from site/blog/* pages will be included by default.
> You can change that and include entries from a different section: 
> https://soupault.app/reference-manual/#index-view-options
> 
>  >All the rest of the settings for index.views.title would be exactly
> the same as index.views.blog?
>  >So then you would have two completely  different lists under two 
> completely different div tags, each sorted separately?
> 
> Different views are completely independent indeed.
> They also don't inherit anything but default settings.
> 
>  >Lines 68 and 69 seem to indicate pagination is set to 5 items but
> on 
> the website the entire blog shows up on 1 page. Am I missing
> something?
> 
> Oh, good catch! I accidentally committed a config with options from
> my 
> experiments with a Lua paginator.
> 
> There is no built-in pagination, it would be done by a Lua index 
> processor. Lua index processors can inject new pages in the queue,
> so you can use that trick for many purposes, from pagination to 
> arbitrary taxonomies.
> 
> I'm generating indices of posts by tag on my own blog using that 
> mechanism: https://baturin.org/blog/tag/
> https://github.com/dmbaturin/baturin.org/blob/master/soupault.toml#L113-L126
> 
> Somehow I can't find the paginator script I used for experiments in
> the 
> soupault.app blog, though.
> I seem to recall I wasn't confident enough about its robustness to 
> expose other people to it.
> For now I'll remove those options, but I need to get back to making a
> fully-reusable paginator some time.
> 
>  >does that mean that [index.views.something] is basically run on
> every 
> page and that means that if a certain page does not have the
> appropriate 
> div="something-index" for that particular view well then it just is
> not 
> run?
> 
> Yes, every index view checks every page for an element that would
> match 
> its selector. If there's such an element, it renders and inserts its
> index,
> if not, then it ignores that page.
> I need to document that in the manual, I suppose. Right now it may
> not 
> be very clear.
> 
>  >If that is the case then then the next question is in the above 
> example how would I prevent authors.html and titles.html from being 
> included in the index?
> 
> Right now, soupault doesn't extract index data from a) index pages 
> (*/index.* by default) and from pages generated by Lua index
> processors.
> So the simplest way to exclude a page is to make it an index page,
> like 
> site/authors/index.html
> However, now I wonder if I should add an option to explicitly exclude
> certain pages from indexing in the next version.
> 
> 
> On 10/28/22 02:41, aoirthoir@aoirthoir.com wrote:
> > Question A1
> > ====================
> > 
> > > when I added [file or lua_source], I'll fix that.
> > 
> > I see how to use a lua_source = """
> >   some code
> > """
> > 
> > but how do we use a file? is it just lua_source = path.to.file or
> > is 
> > it file = path.to.file
> > 
> > Question A2
> > ====================
> > 
> > I notice you have several things with something = with three
> > quotes. I 
> > do not know if that means that is how we do it or something? Is
> > that 
> > some indicator of multi-line content.
> > 
> > Question A3
> > ====================
> > 
> > I went to the soupault.app link you provided on codeberg and I 
> > understand that a lot better.
> > 
> > site/blog/index.html is the index where #blog-index is located. So
> > all 
> > files in site/blog will be indexed and added to the div 
> > id="blog-index" in index.html.
> > 
> > If say you wanted to also have an index on title in addition to
> > date 
> > you might create a second div id="title-index" then copy lines 63-
> > 93 
> > changing the certain lines in the new section to match something
> > like:
> > 
> > (old lines 63-66 but would have new line numbers due to the copy
> > paste)
> > 
> > [index.views.title]
> >     index_selector = "#title-index"
> >     sort_by = "title"
> >     sort_type = "lexicographic"
> > 
> > All the rest of the settings for index.views.title would be exactly
> > the same as index.views.blog?
> > 
> > So then you would have two completely  different lists under two 
> > completely different div tags, each sorted separately?
> > 
> > Does that sound about right?
> > 
> > This weekend i will try to download the entire soupault.app from 
> > codeberg to test with a known working quantity so I can try to 
> > understand this better.
> > 
> > Question A4
> > ====================
> > 
> > Lines 68 and 69 seem to indicate pagination is set to 5 items but
> > on 
> > the website the entire blog shows up on 1 page. Am I missing
> > something?
> > 
> > 68: paginate = true
> > 69: items_per_page = 5
> > 
> > Question A5
> > ====================
> > 
> > > Oh, no, you don't have to choose! Every field is present in the
> > > index 
> > > entry for every page
> > 
> > Correct that much I understand. What I am confused about is how I 
> > would have different pages for different taxonomies (in wordpress 
> > parlance).
> > 
> > I believe the steps I detailed above under Question A3 explain how
> > I 
> > would put different lists, sorted in different orders, in a page.
> > But 
> > what if I wanted separate links by sort how to accomplish that.
> > 
> > > You can also make index data available to every page
> > 
> > I am guessing that this would be the key?
> > 
> > site/blog/index.html could be set up to have div="index-blog" and
> > sort 
> > on date.
> > 
> > site/blog/authors.html could be set up to have div="author-index"
> > and 
> > sort on author.
> > 
> > site/blog/titles.html could be set up to have div="title-index" and
> > sort on title.
> > 
> > so if index_first = true
> > 
> > does that mean that [index.views.something] is basically run on
> > every 
> > page and that means that if a certain page does not have the 
> > appropriate div="something-index" for that particular view well
> > then 
> > it just is not run?
> > 
> > If that is the case then it all makes sense to me now.
> > 
> > Question A6
> > ====================
> > 
> > If that is the case then then the next question is in the above 
> > example how would I prevent authors.html and titles.html from being
> > included in the index?
> > 
> > END
> > ====================
> > 
> > Thanks Kindly
> > Aoirthoir
> > 
> > 
> > On 2022-10-27 05:37, Daniil Baturin wrote:
> > > Hi Aoirthoir,
> > > 
> > > 
> > > > Is that 4 options instead of 3?
> > > 
> > > Indeed! There are only two hard problems in programming: cache
> > > invalidation, naming things, and off-by-one errors. ;)
> > > I forgot to update the number when I added [file or lua_source],
> > > I'll 
> > > fix that.
> > > 
> > > > When it comes to index.fields.something, is the something
> > > > literally 
> > > > just any name I want it to be?
> > > > So that the index.fields.something is just my decision and is
> > > > not 
> > > > related to anything internally in soupault?
> > > 
> > > Yes, it's just a name of your choice that soupault will use for
> > > the
> > > field extracted using the rules you define for it.
> > > Since soupault 2.0.0, there are no built-in _index_ fields
> > > anymore,
> > > they are all user-defined.
> > > 
> > > 1.x versions had built-in title, author, excerpt, and date fields
> > > that
> > > were configured with index.date_selector etc.,
> > > rather than as subtables under [index], but that made new options
> > > for
> > > custom fields such as extract_attribute unavailable for them,
> > > so I dehardcoded the whole thing.
> > > 
> > > So, for my config for soupault.app
> > > (
> > > https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/m
> > > ain/soupault.toml#L45-L61), 
> > > 
> > > entries look like this:
> > > 
> > > [
> > >   {
> > >     "url": "/blog/soupault-4.3.0-release",
> > >     "page_file": "site/blog/soupault-4.3.0-release.md",
> > >     "nav_path": [
> > >       "blog"
> > >     ],
> > >     "reading_time": "less than a minute",
> > >     "excerpt": "Soupault 4.3.0 is available for download...",
> > >     "date": "2022-10-24",
> > >     "title": "Soupault 4.3.0 release"
> > >   },
> > > 
> > > url, page_file, and nav_path are generated by soupault from the
> > > page
> > > file path, all other names are from the index fields config.
> > > 
> > > > For index views, is index_selector = 'something'  just like
> > > > other 
> > > > selectors in Soupault? So basically if I have <div id="blog-
> > > > index"> 
> > > > in site/cats/index.html and i have index_selector = "#blog-
> > > > index" in 
> > > > [index.views.something] then that list created with he 
> > > > index_item_template (etc) will be injected into
> > > > site/cat/index.html 
> > > > and then output to build/cat/index.html ?
> > > 
> > > Yes, index_selector defines where soupault will insert the
> > > generated
> > > HTML for the index.
> > > 
> > > > Does index.html (or index.md etc) merge with template/main.html
> > > > (or 
> > > > whatever my template is?) and does index.html process widges?
> > > 
> > > The only special thing about index.* pages is that (by default)
> > > they
> > > _aren't_ subject to index field extraction and _are_ subject to
> > > generated index insertion.
> > > Otherwise, they are treated like all other pages: they are
> > > inserted
> > > into templates/main.html _if_ they don't have a <html> element in
> > > them
> > > already,
> > > and all widgets run on them unless the page is excluded by
> > > page/section/path_regex options of a specfic widget.
> > > 
> > > (You can force soupault to treat an index.* page as a content
> > > page:
> > > https://soupault.app/reference-manual/#treating-index-pages-as-normal-pages
> > >  
> > > 
> > > You can also make index data available to every page:
> > > https://soupault.app/reference-manual/#making-index-data-available-to-every-page
> > >  
> > > 
> > > Those options don't change templating or widget behavior for
> > > index
> > > pages, though.)
> > > 
> > > > I presume for instance i would have index.fields.author and 
> > > > index.fields.date but i cannot figure out how to choose which
> > > > index 
> > > > to use at any particular time.
> > > 
> > > Oh, no, you don't have to choose! Every field is present in the
> > > index
> > > entry for every page.
> > > You can see an example for the soupault blog here:
> > > https://codeberg.org/PataphysicalSociety/soupault.app/src/branch/main/soupault.toml#L84-L92
> > >  
> > > 
> > > 
> > > > So then in my site/cat/index.html i could have separate
> > > > sections for 
> > > > each list that I want to display (title order, author order,
> > > > etc) 
> > > > and I just create a view, with a sort_by for each one that I
> > > > want 
> > > > sorted in a different order?
> > > 
> > > One option is to make multiple views with different sort_by
> > > indeed.
> > > Since you likely want to display e.g. title and author
> > > differently,
> > > you will need  slightly different template for each of those
> > > anyway, 
> > > I suppose.
> > > 
> > > An alternative is to sort and group entries using template
> > > filters:
> > > http://tategakibunko.github.io/jingoo/templates/templates.en.html#filter_sort
> > >  
> > > 
> > > http://tategakibunko.github.io/jingoo/templates/templates.en.html#filter_groupby
> > >  
> > > 
> > > 
> > > I hope this helps,
> > > Daniil
> > > 
> > > On 10/27/22 08:08, aoirthoir@aoirthoir.com wrote:
> > > > 
> > > > Question 1
> > > > ====================
> > > > 
> > > > The reference manual heading "Ways to control index rendering"
> > > > it 
> > > > says "There are three options you can define view
> > > > rendering"then 
> > > > lists, index_item_template, index_template, index_processor,
> > > > and 
> > > > [file or lua source]. Is that 4 options instead of 3?
> > > > 
> > > > 
> > > > Question 2
> > > > ====================
> > > > 
> > > > When it comes to index.fields.something, is the something
> > > > literally 
> > > > just any name I want it to be? So for instance
> > > > 
> > > > [index.fields.excerpt]
> > > >   selector = ["p#post-excerpt", 'p"]
> > > > 
> > > > could just as well be:
> > > > 
> > > > [index.fields.candycane]
> > > >   selector = ["p#post-excerpt", 'p"]
> > > > 
> > > > So that the index.fields.something is just my decision and is
> > > > not 
> > > > related to anything internally in soupault?
> > > > 
> > > > I realize that index.fields. has to be exactly that so I mean 
> > > > specifically after the second period.
> > > > 
> > > > Also is it the same with index.views.whatever, I can name the 
> > > > .whatever anything I want or is .blog for instance a built in
> > > > to 
> > > > Soupault?
> > > > 
> > > > Question 3
> > > > ====================
> > > > 
> > > > For index views, is index_selector = 'something'  just like
> > > > other 
> > > > selectors in Soupault? So basically if I have <div id="blog-
> > > > index"> 
> > > > in site/cats/index.html and i have index_selector = "#blog-
> > > > index" in 
> > > > [index.views.something] then that list created with he 
> > > > index_item_template (etc) will be injected into
> > > > site/cat/index.html 
> > > > and then output to build/cat/index.html ?
> > > > 
> > > > Question 4
> > > > ====================
> > > > 
> > > > Does index.html (or index.md etc) merge with template/main.html
> > > > (or 
> > > > whatever my template is?) and does index.html process widges?
> > > > 
> > > > Question 5
> > > > ====================
> > > > 
> > > > In index.views how do I create lists for the different fields
> > > > from 
> > > > index.fields. I see the examples and I know you can create
> > > > lists for 
> > > > Authors or Dates or anything else you created under
> > > > index.fields, 
> > > > butI cannot see how to choose which index.fields.whatever i
> > > > want to 
> > > > use.
> > > > 
> > > > I presume for instance i would have index.fields.author and 
> > > > index.fields.date but i cannot figure out how to choose which
> > > > index 
> > > > to use at any particular time.
> > > > 
> > > > Question 6
> > > > ====================
> > > > 
> > > > OR is it that each of the index.fields.whatever is creating an
> > > > index 
> > > > for a page like:
> > > > 
> > > > index.fields.title
> > > > index.fields.date
> > > > index.fields.excerpt
> > > > index.fields.reading_time
> > > > 
> > > > and then in my template as I am creating the particular 
> > > > index.views.whatever I would do this:
> > > > 
> > > > {{title}}
> > > > {{date}}
> > > > {{excerpt}}
> > > > {{reading_time}}
> > > > 
> > > > and so the index.fields.whatever is not actually creating a
> > > > specific 
> > > > list and instead that is where
> > > > 
> > > > sort_by = "something" comes in so if I wanted all four of those
> > > > above in separate lists I would so something like:
> > > > 
> > > > [index.views.title]
> > > >   sort_by = "title"
> > > >   index_select = "#titles"
> > > >   etc...
> > > > 
> > > > [index.views.author]
> > > >   sort_by = "author"
> > > >   index_selector = "#authors"
> > > > 
> > > > So then in my site/cat/index.html i could have separate
> > > > sections for 
> > > > each list that I want to display (title order, author order,
> > > > etc) 
> > > > and I just create a view, with a sort_by for each one that I
> > > > want 
> > > > sorted in a different order?
> > > > 
> > > > Question 7
> > > > ====================
> > > > 
> > > > So then would the way that I solve wanting to have separate
> > > > page for 
> > > > posts by authors and posts by date be something like:
> > > > 
> > > > site/cats/titles/index.html
> > > > site/cats/authors/index.html
> > > > 
> > > > index.views.title]
> > > >   sort_by = "title"
> > > >   section = "cats/"
> > > >   index_select = "#titles"
> > > >   etc...
> > > > 
> > > > [index.views.author]
> > > >   sort_by = "author"
> > > >   section = "cats/"
> > > >   index_selector = "#authors"
> > > > 
> > > > and so site/cats/titles/index.html would be <tag id="titles">
> > > > and in 
> > > > site/cats/authors/index.html would be <tag id="authors">
> > > > 
> > > > The reason I ask this is it seems that index.* is what is the 
> > > > indexes... but i am presuming that does not mean
> > > > index.authors.html 
> > > > and index.titles.html or... does it mean that?
> > > > 
> > > > Or is that pretty much what cloning was intended to accomplish?
> > > > 
> > > > ==============
> > > > 
> > > > Thanks Kindly.
> > > > Aoirthoir.
> > > > 
> > > > ---
> > > > This is a test signature.
> 
Reply to thread Export thread (mbox)