Conversation
… the scoping of the local graphs
Thought to make the necessary changes more clear
|
@trwbox Thanks for the pull request! It looks good. Can I know if you have a working demo of a github.io hosted site? It would be helpful in additional to my offline testing. |
|
I will get one spun up tonight to look at
On Mon, Jun 27, 2022 at 11:48 AM Peter Yuen ***@***.***> wrote:
@trwbox <https://github.com/trwbox> Thanks for the pull request! It looks
good. Can I know if you have a working demo of a github.io hosted site?
It would be helpful in additional to my offline testing.
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJYSXDIF24ORJXMUMY3DHG3VRHLPFANCNFSM5ZOWSL5Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Trent R. Walraven
|
|
I got it created here is a link to the site: A good example page is Antenna on PCB to see the graph, and that in content links work. And here is a link to the github repo: |
|
The pull request seems reasonable. I would incorporate it in the next release. However, I might not include the |
|
That makes perfect sense. I added it for consistency sake, but have no issues if it is a part of the readme. I know this might be considered promoting my own project in asking, but if you add that section would you mind linking my Github Pages publishing tool? |
|
When will this Pull Request be merged? |
| ) | ||
| new_rel_path = quote(str(slugify_path(new_rel_path, False))) | ||
| new_rel_path = quote(str(slugify_path(new_rel_path, True))) | ||
| if(Settings.options["BASE_PATH"] != ""): |
There was a problem hiding this comment.
Change in the abs_url method breaks all the links in the main graph page, since when building a graph no one takes a hint that we should either strip the BASE_URL or count it in. I've found a better solution. Here is the diff
diff --git a/utils.py b/utils.py
index 4f644c3..9aa596d 100644
--- a/utils.py
+++ b/utils.py
@@ -132,8 +132,9 @@ class DocLink:
for link in cls.get_links(line):
abs_url = link.abs_url(doc_path)
+ replace_with = f"[{link.title}]({Settings.options['SITE_URL']}{abs_url}{link.header})"
parsed = parsed.replace(
- link.combined, f"[{link.title}]({abs_url}{link.header})"
+ link.combined, replace_with
)
linked.append(abs_url)
@@ -445,7 +446,7 @@ def parse_graph(nodes: Dict[str, str], edges: List[Tuple[str, str]]):
{
"id": node_ids[url],
"label": title,
- "url": url,
+ "url": f"{Settings.options['SITE_URL']}{url}",
"color": PASTEL_COLORS[top_nodes[url]] if url in top_nodes else None,
"value": math.log10(edge_counts[url] + 1) + 1,
"opacity": 0.1,
It preserves all the links in the project and allows to use non-root base path
There was a problem hiding this comment.
found better solution using zola's features: SherAndrei@9ef636b
This adds an optional BASE_PATH in the configuration file that could be used for something like example.github.io/obsidian-notebook/.
The format has BASE_PATH with no slashes
BASE_PATH = "obsidian-notebook", and requires that SITE_URL is changed accordingly, and including a trailing backslash to be likeSITE_URL = https://example.github.io/obsidian-zola/