mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 18:10:09 +00:00
bugfix + some tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
59eff6cf05
commit
54ca3252bf
@ -126,7 +126,9 @@ object.Constructor('BasePage', {
|
||||
},
|
||||
resolvePathVars: function(path='', context={}){
|
||||
var that = this
|
||||
return pwpath.normalize(
|
||||
return path == '.' ?
|
||||
path
|
||||
: pwpath.normalize(
|
||||
Object.entries(this.path_vars)
|
||||
.reduce(function(res, [key, func]){
|
||||
return res
|
||||
@ -990,7 +992,8 @@ object.Constructor('Page', BasePage, {
|
||||
depends,
|
||||
renderer: state.renderer,
|
||||
})}
|
||||
: this.get(src)
|
||||
//: this.get(src)
|
||||
: this
|
||||
.parse(state) }
|
||||
|
||||
var first = true
|
||||
@ -2064,7 +2067,12 @@ module.System = {
|
||||
|
||||
type: @source(../type)<br>
|
||||
|
||||
tags: @source(../tags join=", ")<br>
|
||||
tags:
|
||||
<macro name="list-tags" src="../tags">
|
||||
<a href="#/**/path:tags=@source(.)">@source(.)</a>
|
||||
</macro><br>
|
||||
related tags:
|
||||
<macro name="list-tags" src="../relatedTags"/><br>
|
||||
|
||||
ctime: @source(../ctime)<br>
|
||||
mtime: @source(../mtime)<br>
|
||||
|
||||
@ -283,13 +283,14 @@ module.BaseStore = {
|
||||
return this.__tags() },
|
||||
|
||||
relatedTags: function*(...tags){
|
||||
var cur = tags
|
||||
var cur = new Set(tags)
|
||||
var {tags, paths} = this.tags
|
||||
var seen = new Set()
|
||||
for(var tag of cur){
|
||||
for(var p of tags[tag] ?? []){
|
||||
for(var t of paths[p] ?? []){
|
||||
if(!seen.has(t)){
|
||||
if(!seen.has(t)
|
||||
&& !cur.has(t)){
|
||||
seen.add(t)
|
||||
yield t } } } } },
|
||||
|
||||
|
||||
@ -18,6 +18,15 @@
|
||||
* - CLI -
|
||||
*
|
||||
*
|
||||
* XXX BUG: parser:
|
||||
* This will break:
|
||||
* <macro src=../tags join=", ">@source(.)</macro><br>
|
||||
* This will not:
|
||||
* <macro src="../tags" join=", ">@source(.)</macro><br>
|
||||
* XXX LIST BUG: <macro>: sourcing an element of a list does not work...
|
||||
* Example:
|
||||
* await pwiki.parse('<macro src="/WikiHome/tags">@source(.)</macro>')
|
||||
* XXX do we need a way to index a list item via path???
|
||||
* XXX TAGS
|
||||
* - add tags to page -- macro/filter
|
||||
* - <page>.text -> <page>.tags (cached on .update(..))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user