MCPcopy Index your code
hub / github.com/docsifyjs/docsify / renderNameLink

Function renderNameLink

src/core/render/index.js:220–238  ·  view source on GitHub ↗
(vm)

Source from the content-addressed store, hash-verified

218}
219
220function renderNameLink(vm) {
221 const el = dom.getNode('.app-name-link');
222 const nameLink = vm.config.nameLink;
223 const path = vm.route.path;
224
225 if (!el) {
226 return;
227 }
228
229 if (isPrimitive(vm.config.nameLink)) {
230 el.setAttribute('href', nameLink);
231 } else if (typeof nameLink === 'object') {
232 const match = Object.keys(nameLink).filter(
233 key => path.indexOf(key) > -1
234 )[0];
235
236 el.setAttribute('href', nameLink[match]);
237 }
238}
239
240/** @typedef {import('../Docsify').Constructor} Constructor */
241

Callers 1

_updateRenderMethod · 0.85

Calls 1

isPrimitiveFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…