Comments (7)
Hmm, so to fix these warnings, one has to put all non-ordered pages in a separate section?
I think so. i already organise things roughly like that myself: https://gitlab.com/Keats/vincent.is/tree/master/content
An alternative would be putting an attribute in the front-matter to disable the warning but I don't really want to go down the path of adding tons of things there.
Either way, I'll make the warning not too annoying and it should only appear when rebuilding index/section pages so it shouldn't come up too often even if you choose to ignore them.
from zola.
Sorting by order rather than weight might make more sense:
1 -> bottom
2 -> above 1
3 -> above 2
The advantage is that adding a new page doesn't require potentially changing weights of other pages unless you want to put something in the middle
from zola.
Looks like having _index.md
for the homepage will be better than just putting all index specific data in the config
from zola.
Homepage _index.md
in #45
Frontmatter should have a sort_by
that defaults to "date"
and can take "order"
and "none"
as value as well.
Any content without a date or an order (depending on the current section sort_by
) will be put at end of the list. The prev/next for those would be kind of random, not sure it's what we want but i don't see a solution other than just ignoring them.
Ignoring them would solve the issue of having static pages mixed with the content in the index page though: for example on my site I have an about and project pages that I don't want to show when iterating on the blog posts or consider at all when paginating/setting prev and next. A warning could be shown if necessary but not for the index page.
from zola.
I have an about and project pages that I don't want to show when iterating on the blog posts or consider at all when paginating/setting prev and next
This seems to be a common problem. Some static site generators solve this by arbitrarily dividing pages into "posts" and "pages". I don't really like this solution because it is inflexible.
A more general solution would be a method to retrieve a section by name. Then we could iterate over all pages of a posts
section that is ordered by date and maybe even iterate over pages of a footer
section that contains pages like about
or contact
and has manual ordering.
I don't like the none
ordering, since a random ordering would make the output non determistic. Instead we could probably order by e.g. file creation date.
from zola.
I don't like the none ordering, since a random ordering would make the output non determistic. Instead we could probably order by e.g. file creation date.
The none
is for designing landing pages for example, where you don't want any kind of ordering. It matters if we want to avoid warnings (see below).
A more general solution would be a method to retrieve a section by name. Then we could iterate over all pages of a posts section that is ordered by date and maybe even iterate over pages of a footer section that contains pages like about or contact and has manual ordering.
The index page on gutenberg gets all the sections so that's already doable.
I think pages that don't have dates/order when their section is ordered by date/order should not appear at all. It should display a warning saying this page will not be present because it doesn't have a date/order, unless sort_by is set to none
. It will still display a warning in the case of a blog with a couple of non-ordered pages but I think this is ok.
from zola.
The index page on gutenberg gets all the sections so that's already doable
Great!
It will still display a warning in the case of a blog with a couple of non-ordered pages but I think this is ok.
Hmm, so to fix these warnings, one has to put all non-ordered pages in a separate section?
from zola.
Related Issues (20)
- `quick-xml` incompatible in the future HOT 1
- safe inline-script | How to generate nonce in Zola HOT 6
- SVG access via `get_url` and selector seems to be broken when running locally HOT 1
- [Question] Disable trailing slash for `.permalink`? HOT 4
- Why should I use zola? HOT 2
- zola serve panic HOT 3
- [RUSTSEC-2024-0003] [RUSTSEC-2024-0019] and [RUSTSEC-2020-0043] (among many others) HOT 4
- Error: `search` for default language is specified twice
- Feature Request: Image Dithering HOT 2
- No `paginator` in `get_section()` HOT 5
- [Feature Request] XMPP: Post to PubSub
- Long shortcodes / How to best insert images from markdown
- Longevity of Zola HOT 1
- Slugify of german umlaute (ä, ö, ü) HOT 3
- Including multiple template files with unknown names in other templates HOT 1
- Function call `load_data` fails on next branch. HOT 1
- In Zola templates that extend another template, variables declared at top-level are not available in blocks HOT 2
- Question about `regex_replace` HOT 1
- How do I get a relative link to a page? HOT 3
- Suggestion: compress_sass_output config option HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zola.