-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate pages with multi-level path #57
Comments
+1 for this |
pull requests #63 seems to be doing what you are asking. Quite some time passed by, I hope the solution is still relevant. |
The way I understand it, @migpimenta is asking for a way to have How can we achieve the former result with proper nested directories? |
Thanks, now I get it, different label assigned (... easier than actually solving the issue ;-)) |
Its not fully tested ("it's working for me") but this diff may allow what is asking. This link may show the difference https://www.diffchecker.com/ZsMpGYvp. # _config.yml
# @see https://github.com/avillafiorita/jekyll-datapage_gen
page_gen-dirs: true
page_gen:
- data: 'api'
template: 'api'
name_expr: "record['uid'].split('/').last"
dir_expr: "record['uid'].chomp(record['uid'].split('/').last + '/')"
Is generating a sitemap like this <!--
typum: api
-->
<url>
<loc>https://hapi.etica.ai/mul/api/UN/hdx/</loc>
<lastmod>2021-05-17T22:44:58-03:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.3</priority>
<xhtml:link
rel="alternate"
hreflang="x-default"
href="https://hapi.etica.ai/mul/api/UN/HDX/" />
</url>
<url>
<loc>https://hapi.etica.ai/eng/api/UN/humanitarian-data-exchange/</loc>
<lastmod>2021-05-17T22:44:58-03:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.3</priority>
<xhtml:link
rel="alternate"
hreflang="x-default"
href="https://hapi.etica.ai/mul/api/UN/HDX/" />
</url>
<url>
<loc>https://hapi.etica.ai/mul/api/UN/reliefweb/</loc>
<lastmod>2021-05-17T22:44:58-03:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.3</priority>
<xhtml:link
rel="alternate"
hreflang="x-default"
href="https://hapi.etica.ai/mul/api/UN/reliefweb/" />
</url>
<url>
<loc>https://hapi.etica.ai/eng/api/UN/reliefweb/</loc>
<lastmod>2021-05-17T22:44:58-03:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.3</priority>
<xhtml:link
rel="alternate"
hreflang="x-default"
href="https://hapi.etica.ai/mul/api/UN/reliefweb/" />
</url> CommentsI may need to make a few other changes (so lastest file on the the repository may have some other changes), but if someone is in a hurry,this approach could work. Note that the
is a bit hacky way to use a single variable to split between the folder and the name (so most people may not need to need it. Also, this likely to break with the datapage_url (at least I did not tested) Also, great project @avillafiorita ! |
Yes! Actually, looking at the code, it was the same logic made by @DanielJDufour, so mostly is his credits. |
@fititnt , thank you. I appreciate the kind words :-) |
+1 |
* remove hard-coded agencies * remove _agencies and _data-pages collections in favor of _data/agencies.json * add page-generator-gem * add page-generator plugin shim from avillafiorita/jekyll-datapage_gen#57 * generate a sitemap
This was very useful, thank you. I was able to output multiple related renderings of records, grouped by directory, which really simplifies the output layout. |
+1 |
Let's say I want to generate pages on the following URLs:
/animal/mammal/1/whale
/animal/mammal/2/tiger
/animal/reptile/3/snake
The directory pattern would have to be /animal/{group}/{id}/{name} where input data is an array of animals. The directory does not support patterns.
I have tried to create an object property with the value /animal/mammal/1/whale. That doesn't work either, pages are placed in the folder animalmammal1whale, i.e., slashes are stripped.
The text was updated successfully, but these errors were encountered: