In v1, my index.md file had a few tags at the top simply “#XXX” which when I clicked on one, showed me a line at the top of the page:
All objects in your space tagged with #XXX:
then it had a header called Items, and under that every line with the hashtag #XXX in it, with a link in the front of the form: page@char
Then late a header called Paragraphs with a few more links in it.
In v2, that same link shows a “tag:XXX” at the very top (on the navigation line), then a Table of Contents which includes:
Objects tagged with XXX
Items
Paragraphs
The headers:
Objects tagged with XXX
Items
under Items are the actual lines where #XXX appeared, but no links to the specific page, and missing the actual word/tag #XXX as well, with some other missing text along the way.
In the console output for the silverbullet server I see a ton of:
Error GETting file tag:XXX.md Not found
I found a topic that showed how to iterate through all tags showing the count next to each tag, but that query only worked for me when I took out the count part, otherwise, nothing rendered and no error messages. I’m completely confused…
This all works as it should, except for the case of list items. Those do not contain a reference, which makes them pointless. Let me fix that quickly.
Btw, you get the “GETting” errors because indeed those pages (tag:...) do not exist, which is indeed the case. The way the tag pages are no implemented is via an event that triggers in case of a non-existing page. This is a bit confusing when looking at the logs.
Thanks for the replies Zef! It occurred to me that I had purposely deleted .silverbullet.db, because you said it was no longer used. But, I also deleted .silverbullet-db.shm (and .wal), which I assumed weren’t needed either.
I just tried it again leaving all of those files intact, and I still get the issue. Here’s a screenshot of the top of my list:
The first item is from the first day I ever tried Silverbullet, and the missing word between “give” and “a” is itself a tag (#neovim), so other tags aren’t being rendered for me within an item. Thankfully, as you can see, that was marked done.
I haven’t tried using the edge version yet, but I will, especially if you signal that it’s already been updated.
Also, I’m sure you know, but as long as I stay on that page, the log continuously throws the GETting error…
Major progress, thanks! Now the links render correctly, and embedded tags show up correctly when I visit one of those links. That includes #neovim showing up correctly on the linked page in the first item.
However, as you can see by the attached screenshot, the #neovim tag still doesn’t show on the auto-generated page when I simply click on #DONE in my index.md page.
## Last modified
${template.each(query[[
from index.tag "page"
order by lastModified desc
limit 10
select {name=name, lastModified=lastModified, tags=tags}
]], templates.pageItem)}
## Tasks
${template.each(query[[
from
task = index.tag 'task'
where
not task.done and
(
not page or
page == task.page
)
]], templates.taskItem)}
## Tags
${template.each(query[[
from index.tag "tag"
order by _.name desc
select {name=name}
]], templates.tagItem)}
The main problem doesn’t involve a direct query. My index file simply starts with five hashtags:
#TODO #DONE
are the last of the five (the first 3 are tags for my benefit).
In v1, those show up as links automatically, then I click, and I get the correct results. In v2, they show up as links, but until Zef made an update, I got results without the leading links (which now works!), but embedded hashtags (I gave the example of #neovim above) don’t show up.
As for the query, I tried doing a query instead of just using the automatic hashtag. I started with a query I found in the community:
${template.each(
query[[
from t = index.tag “tag”
where not t.name:match(“^meta”) and t.parent != “builtin”
order by t.name
select {
name = t.name,
count = #query[[from index.tag “tag” where name == t.name]]
}
]],
template.new [==[
* [[tag:${name}|${name}]] (${count})
]==]
)}
I don’t remember exactly what I modified (since deleted after Zef fixed the links), but as long as “count” was in the query, I got nothing back, and things devolved as I tried to modify it (I’m still digging in to v2 stuff…).
Thanks Andy! I’m not using tasks specifically (though I should probably just convert all of my manually tagged “#TODO” and “#DONE” hashtags to proper tasks in md format and be “done”!).
That leaves the “Tags” query at the bottom of your suggestions, so I look forward to whenever Zef merges your PR and we’ll see how it goes!
Woah. I just went back to my index page and when I clicked around (or used my arrows keys), the Tags query refreshed and completely filled in, so I’m back in business where I can look to see if I can use that to replace the raw hashtags that I have at the top of the file.
Thanks Andy and Zef!
Oops. Unfortunately, clicking on the #DONE link in that generated page still doesn’t show the embedded #neovim link on the first output line (no embedded links show up), so I still have a different rendering issue, but your query now works and renders correctly!