Hi All,
Does anyone have any tips on how I could make a return to top bottom widget?
I have the below which almost works but is inconsistent on some pages and doesnt really work at all on index.
widgets = widgets or {}
function widgets.gotoTop()
local pageName = editor.getCurrentPage()
-- Link to line 1, column 1 (top of page)
local link = string.format("[[%s@L1c1|Go to Top]]", pageName)
return widget.new {
markdown = link
}
end
event.listen {
name = "hooks:renderBottomWidgets",
run = function(e)
return widgets.gotoTop()
end
}
Any help would be super appreciated. ![]()