code: public Page findAncestor(String name) {
          Path rootPath = Paths.get(mdw.getAssetRoot().getPath()).normalize();
          Path pkgPath = Paths.get(getAsset().getFile().getPath()).normalize();
          while (pkgPath != null && pkgPath.startsWith(rootPath)) {
              if (new File(pkgPath + "/" + PackageDir.PACKAGE_JSON_PATH).exists() || new File(pkgPath + "/" + PackageDir.PACKAGE_YAML_PATH).exists() ) {
                  Page p = new Page(mdw, "/" + rootPath.relativize(pkgPath).toString().replace('\\', '/') + "/" + name);
                  if (p.exists())
                      return p;
              }
              pkgPath = pkgPath.getParent();
          }
          return null;
      }
docs: Locate closest page in ancestor package hierarchy (if any).