Open sverchkov opened 1 month ago
I cannot reproduce.
Since your example is not fully reproducible, please share a Git repository. Also, current stable version is 1.5, please upgrade your Quarto version.
Sure thing! I've updated to 1.5 and get the same behavior.
Quarto check:
Quarto 1.5.55
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.55
Path: /opt/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Tex: (not detected)
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.10.12
Path: /bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking R installation...........(None)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/
Repo: https://github.com/sverchkov/quarto-sorting-repr Deployed at https://sverchkov.github.io/quarto-sorting-repr/
Note that the sort
order works as expected. It is the sort-ui
behavior that is unexpected.
Clip of the behavior
It seems the filter by "title" actually uses the filename.
The issue is the EJS listing.
It seams the URL path is used, while moving the target listing-<id>
closer to the real target solves the issue.
<h3 class="no-anchor"><a href="<%- item.path %>" class="listing-title no-external"><%= item.title %></a></h3>
Alternatively, the JavaScript script could be updated but seems more complex and right now I don't know exactly which part:
Note that this also has an impact on other tooling and fields:
Bug description
Given a listing generated by glob-matching files, and
sort-ui
enabled on the listing, using the UI to sort by "title" sorts the listing by file names instead.Steps to reproduce
Initiate a quarto website project with the following directory structure:
With the following file contents:
index.qmd
:pages/p1.qmd
:pages/p2.qmd
:pages/p3.qmd
:Build the website and navigate to the main page. In the sorting interface, select "Title"
Expected behavior
The listing should be ordered by the titles of each document, that is A, B, C
Actual behavior
The listing order becomes C, A, B.
This seems to correspond to file name order (
p1.qmd
,p2.qmd
,p3.qmd
)Your environment
IDE: VSCode Version: 1.91.1 (user setup) Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729 Date: 2024-07-09T22:06:49.809Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.19045
Quarto check output