by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 01 13:44

    dependabot-preview[bot] on cargo

    (compare)

  • Jul 01 13:44
    dependabot-preview[bot] closed #774
  • Jul 01 13:44

    dependabot-preview[bot] on cargo

    (compare)

  • Jul 01 13:44
    dependabot-preview[bot] edited #774
  • Jul 01 13:44

    dependabot-preview[bot] on cargo

    (compare)

  • Jul 01 13:44

    dependabot-preview[bot] on cargo

    (compare)

  • Jul 01 13:44
    dependabot-preview[bot] closed #770
  • Jul 01 13:44
    dependabot-preview[bot] closed #772
  • Jul 01 13:44

    dependabot-preview[bot] on cargo

    (compare)

  • Jul 01 13:44
    dependabot-preview[bot] edited #770
  • Jul 01 13:44

    dependabot-preview[bot] on cargo

    (compare)

  • Jul 01 13:44
    dependabot-preview[bot] edited #772
  • Jul 01 13:44
    dependabot-preview[bot] commented #774
  • Jul 01 13:44
    dependabot-preview[bot] closed #773
  • Jul 01 13:44
    dependabot-preview[bot] closed #775
  • Jul 01 13:44
    dependabot-preview[bot] commented #770
  • Jul 01 13:44
    dependabot-preview[bot] closed #776
  • Jul 01 13:44
    dependabot-preview[bot] closed #771
  • Jul 01 13:44
    dependabot-preview[bot] edited #775
  • Jul 01 13:44
    dependabot-preview[bot] edited #773
Geobert Quach
@Geobert
Ok I remember now how this indexes field is used: it's for the other type of pagination than All, like Tag. The first paginator will have indexes that contains the paginator for each tag
My first thought was to fill it for All as well, but it's the only way to distinguish a meta paginator from a paginator (testing the existence of indexes)
Geobert Quach
@Geobert
But I think we had some other plan to support this kind of pagination navigation (forgot the name of this kind of pagination presentation)
Ed Page
@epage
As a quick aside, {% capture startIndex %}{{ paginator.index | minus: 2 | at_least: 0 }}{% endcapture %} I think can be simplified to {% assign startIndex = paginator.index | minus: 2 | at_least: 0 %}
Could you give a high level summary of what you are trying to accomplish?
Geobert Quach
@Geobert
image.png
He wants to do this, I think
I remember that we slightly talk about that kind of pagination navigation, but can't remember the name of this style nor where we talked about that… ^^'
proegssilb
@proegssilb
Geobert is correct, @epage . Sorry, existing scheduled stuff took more of my time than I expected.
If anyone is still awake, I should be clear the rest of the day. :)
I don't know liquid that well, so I didn't know about assign. Thanks for the pointer.
And yeah, I wouldn't be surprised if this were a bounds checking issue, but it's tricky to check that over here. Maybe I can tweak per_page and create some dummy posts to play with it further.
proegssilb
@proegssilb
The complicating factors are (afaik) finding the bounds, dealing with the current index possibly not being in the list of pages, and adjusting for 0-indexing vs. 1-indexing when necessary.
proegssilb
@proegssilb

Tried this frontmatter with 4 posts:

---
layout: page.liquid
title: Blog archive | Xen Relay
permalink: /blog/archive.html
pagination:
  include: All
  per_page: 1
  permalink_suffix: "./{{ num }}/"
  order: Desc
  sort_by: ["published_date"]
  date_index: ["Year", "Month"]
---

Got this error:

$ cobalt build
[info] Building from "Z:\\projects\\xenrelay-com\\" into "Z:\\projects\\xenrelay-com\\_site"
Error: build command failed
Info: caused by Failed to render content for blog/archive.html
Info: caused by liquid: Unknown index
  with:
    variable=paginator.pages
    requested index=1
    available indexes=0, first, last
from: {{% else %}}
from: {% if pgIndex == currIndex %}
from: {% for pgIndex in (startIndex..endIndex)  %}
  with:
    index=2

Looks to me like Cobalt just doesn't fill the page 3 index if you're on page 0 of 5, just first/previous/current/next/last. That was not what I thought the docs were saying, but if that's all that's intended to work, then no problem, I just thought other stuff would work too.

Ed Page
@epage
So I think the confusion is over what the role of paginator.pages is. paginator.pages represents the pages for the current page index. Since the frontmatter says per_page: 1, there is only one entry listed.
It doesn't represent all of the paginated pages. We currently don't have something that exposes that.
proegssilb
@proegssilb
OK, so I'd have to figure out how to manually construct each URL?
Ed Page
@epage
You can infer it though since you specified permalink_suffix: {{num}} if all you want is the URL. You know the max number of index pages. You just need to special case the first page (no suffix applied) and the current page.
Yes, sorry this isn't ideal atm moment. I'd appreciate it if you opened an issue about this use case and, if you get it working, if you can include your workaround.
That way we make sure we remember to address this use case and for anyone else, they can see borrow your solution.
proegssilb
@proegssilb
I can definitely open an issue. Thanks for the pointer.
Ed Page
@epage
I will admit that my top priority when I get back to cobalt is the refactor though I suspect this has piqued @Geobert's interest and they might go and fix this :)
proegssilb
@proegssilb
:) There has been a couple of times where I've been curious what Cobalt would look like if it borrowed Saltstack's concept of "Plugin Oriented Programming".
Ed Page
@epage
Have a quick summary on what saltstack does?
proegssilb
@proegssilb
It's a config management tool. Automatically install software, change config files, anything a sysadmin can do from bash. Their concept of "Plugin Oriented Programming" is just a particular way of phrasing modularity, though, so the concept works in most programs.
Like, you could make a code indexer along the lines of GNU Global/ctags/etags based on plugin-oriented programming, if you wanted to.
Ed Page
@epage
btw the refactor I keep mentioning is to move to an ECS which, in case you aren't familiar with, is like a native-to-Rust in-memory database. If the Rust gaming community makes it easy to integrate scripting with the ECS we chose, we could possibly have plugins in Lua or some other language.
proegssilb
@proegssilb
Entity Component System?
Ed Page
@epage
Yup
So I have a passing familiarity with Salt though I haven't dealt with POP yet. From a quick search, the vague big-promise descriptions I saw almost made it sound like ORB / COM / MEF
Need to head off for the rest of the weekend. I'll be back on Monday in case you need anything or have additional ideas!
proegssilb
@proegssilb
OK, catch you 'round. Doing some research to catch up to where you're talking.
proegssilb
@proegssilb
Maybe I'm just tired, but for some reason, I cannot wrap my brain around the sass support. I dropped the *.scss files for bootstrap into _sass/bootstrap, but for some reason, they're not being built, and I can't guess what to type out to get them included somewhere to be built. Any pointers? (I'll look in ~6-10 hours)
Geobert Quach
@Geobert
@proegssilb for sass, have a look at the template of my blog: https://github.com/Geobert/blog
especially, in src folder: _includes/head.liquid and then assets/main.scss and the _sass folder.
I found (again) the name of this kind of pagination: trail
proegssilb
@proegssilb
Thanks for the info, Geobert. I managed to get sass working. Next step: A whole lot of bootstrap work.
proegssilb
@proegssilb

OK, not sure what's going on here. For those not familiar with bootstrap, the way customizing/theming bootstrap works is it declares a ton of variables in _variables.scss, and some utility functions in _functions.scss. Neither of those import any other sass file, so they should be fairly standalone. Furthermore, every variable in _variables.scss is declared with !default. So, I should be able to do something like:

@import "bootstrap/_functions";
@import "bootstrap/_variables";

$white:    #fef;

@import "bootstrap/bootstrap";

....and get the color of white used throughout bootstrap slightly darkened. That doesn't seem to work; replacing one !default variable declaration with another regular variable declaration seems to take the original value. I went through and noticed there's a new version of sass-rs, but not sure if that's significant (maybe rust picked it up already? What changed?), and not sure that there's any reason to expect !default to only have started working recently. Thoughts?

Geobert Quach
@Geobert
Hm, I'm not very familiar with sass, my blog was just tinkering around with a base theme so I don't even know about !default ^^' maybe your question can be asked to sass-rs community?
proegssilb
@proegssilb
OK, website is now updated, and looks somewhat slick (imo). I can think about other things now. Just for my own curiosity, Ed, what makes you interested in applying ECS to Cobalt?
Ed Page
@epage

A struggle I've had with Cobalt is finding the right architecture for the end-to-end pipeline that keeps things easy to evolve and makes it reasonable to implement incremental re-generation.

Entities/Components offer a good architecture for meeting these needs

While I'm not strictly needing Systems, I'm modeling the processing to be System like
This is similar to what the Rust compiler is doing with a library called Salsa. Maybe I'll move to Salsa later but I didn't want to be on the cutting edge so I'm implementing what I need with legion's ECS
Glad you're site is working!
Danilo Spinella
@DanySpin97
Hey there :)
I was migrating a jekyll site to cobalt but I noticed that cobalt does not accept custom vars in front matter
is there any way to add this? Some liquid template use that and the result is a nice looking website generated from yaml data
Ed Page
@epage

data is for custom stuff

See https://cobalt-org.github.io/docs/front/

I broke it out to avoid new features from breaking users
Danilo Spinella
@DanySpin97
I see, however this is different than how jekyll and hugo works
I'll try changing the application code to use data, thanks for the answer