Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-01-31 07:54:01

alekk
Member
From: Krzywogoniec
Registered: 2011-11-24
Posts: 10
Website

Hugo/Jekyll like data files

In Hugo there is a folder when You can put “data” files (in YAML or JSON).
For example all questions and answers can sit in “faq.yaml” file in plain text – easy to change, easy to maintain.

How can one implement similar solution with Textpattern?


Fac Si Facis

Offline

#2 2021-01-31 08:33:29

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Hugo/Jekyll like data files

Hugo is of course for static websites, not dynamic ones.

Why do you think that it is simpler to have the Q&A in a yaml file and not an article?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2021-01-31 09:31:36

alekk
Member
From: Krzywogoniec
Registered: 2011-11-24
Posts: 10
Website

Re: Hugo/Jekyll like data files

It’s not about “static websites” it’s about data structures to iterate over.

For example you can have “list of books” – so name, author, rating, reading date, theme.

Now You can:
- on Author site put books.
- on Home put last book readed
- on Section put list of books only with theme x.

Other situation – you make chess tournaments – and you have cross table in json file.
Of course You can put it in article and format it there, but you can’t pull first 3 places on home site.

This is something I love in HUGO – adding new things with minimum effort.

Last edited by alekk (2021-01-31 09:33:18)


Fac Si Facis

Offline

#4 2021-01-31 09:42:15

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Hugo/Jekyll like data files

Probably etc_query can help you? It can import/query JSON and many other formats, and I could add a YAML parser if needed.

Offline

#5 2021-01-31 09:43:48

alekk
Member
From: Krzywogoniec
Registered: 2011-11-24
Posts: 10
Website

Re: Hugo/Jekyll like data files

It looks like what I wanted. Thank You.


Fac Si Facis

Offline

#6 2021-01-31 09:46:52

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Hugo/Jekyll like data files

alekk wrote #328437:

Of course You can put it in article and format it there, but you can’t pull first 3 places on home site.

You can, just sort by date and limit to 3. Storing things in db has its advantages.

Offline

Board footer

Powered by FluxBB