Skip to content

Commit

Permalink
basic support vnote3 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
tootal committed Feb 15, 2021
1 parent 49238d6 commit 328d05c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 2 additions & 2 deletions dist/js/viki.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions js/linkrewriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ class LinkRewriter {
newHref = p_base + href;
}

// Only let markdown file and _vnote.json go through our router.
// Only let markdown file / _vnote.json / vx.json go through our router.
let suffix = utils.suffix(newHref);
if (/^(?:md|markdown)$/i.test(suffix) ||
/^(.*\/)?_vnote\.json$/i.test(newHref)) {
/^(.*\/)?_vnote\.json$/i.test(newHref) ||
/^(.*\/)?vx\.json$/i.test(newHref)) {
p_a.href = '#!' + utils.cleanPath(newHref);
} else {
p_a.href = utils.cleanPath(newHref);
Expand Down
5 changes: 3 additions & 2 deletions js/navigationrenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ class NavigationRenderer {

let children = [];
// Subfolders.
for (let i = 0; i < p_jobj.sub_directories.length; ++i) {
let folder = p_jobj.sub_directories[i];
let folders = p_jobj.sub_directories ? p_jobj.sub_directories : p_jobj.folders;
for (let i = 0; i < folders.length; ++i) {
let folder = folders[i];

let folderItem = {
text: folder.name,
Expand Down

0 comments on commit 328d05c

Please sign in to comment.