Skip to content

Commit

Permalink
add base support in client menu
Browse files Browse the repository at this point in the history
  • Loading branch information
wassfila committed Jun 8, 2024
1 parent 6dcd07d commit 34fc8c0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const outdir = (process.env.OUT_DIR==null)?"dist":process.env.OUT_DIR
const base = (process.env.PUBLIC_BASE==null)?"":process.env.PUBLIC_BASE
const structuredir = (process.env.STRUCTURE==null)?join(rootdir,".structure"):process.env.STRUCTURE
const contentdir = (process.env.CONTENT==null)?join(rootdir,"content"):process.env.CONTENT
const kroki_server = (process.env.KROKI_SERVER==null)?"https://kroki.io":process.env.CONTENT
const kroki_server = (process.env.KROKI_SERVER==null)?"https://kroki.io":process.env.KROKI_SERVER

const config = {
rootdir: rootdir,
Expand Down
3 changes: 3 additions & 0 deletions content/examples/code-diagram-meta/astro-is-awesome.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
links:
- label: Astro
link: https://docs.astro.build/
3 changes: 0 additions & 3 deletions content/examples/code-diagram-meta/kroki-is-awesome.yaml

This file was deleted.

16 changes: 8 additions & 8 deletions content/examples/code-diagram-meta/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ order: 5
---

# Code block meta data
This code block has language `blockdiag` and first code-block param of `kroki-is-awesome`
This code block has language `blockdiag` and first code-block param of `astro-is-awesome`
````
```blockdiag kroki-is-awesome
```blockdiag astro-is-awesome
blockdiag {
Kroki -> is -> Awesome;
astro -> is -> Awesome;
}
```
````

when adding a meta data file `kroki-is-awesome.yaml` with this content
when adding a meta data file `astro-is-awesome.yaml` with this content
```yaml
links:
- label: Kroki
link: https://kroki.io/
- label: Astro
link: https://docs.astro.build/
```
will generates an SVG diagram with links
```blockdiag kroki-is-awesome
```blockdiag astro-is-awesome
blockdiag {
Kroki -> is -> Awesome;
Astro -> is -> Awesome;
}
```

Expand Down
8 changes: 4 additions & 4 deletions src/layout/client_nav_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ function recursive_update_element(element,menu_entry_items,root,expanded){
}

function section_from_pathname(pathname){
pathname = remove_base(pathname)
if(pathname.startsWith('http')){
return 'external'
}
const sections = pathname.split('/')
if(sections.length < 2){
return "home"
Expand All @@ -175,10 +179,6 @@ function section_from_pathname(pathname){
return sections[1]
}
}

function inject_menu_elements(section_items){
//console.log(section)
}

function enable_clicks(){
const pages_menu = document.getElementsByClassName("pages_menu")[0]
Expand Down

0 comments on commit 34fc8c0

Please sign in to comment.