[devdocsgjs/main: 850/1867] vue: fix entries filter for v1 docs
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 850/1867] vue: fix entries filter for v1 docs
- Date: Fri, 19 Nov 2021 23:47:32 +0000 (UTC)
commit 6002d6a940e486b8cc4c6f8af912c12fde97e855
Author: Jasper van Merle <jaspervmerle gmail com>
Date: Tue Aug 20 15:17:41 2019 +0200
vue: fix entries filter for v1 docs
lib/docs/filters/vue/entries.rb | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/lib/docs/filters/vue/entries.rb b/lib/docs/filters/vue/entries.rb
index 6523a924..c3bf4462 100644
--- a/lib/docs/filters/vue/entries.rb
+++ b/lib/docs/filters/vue/entries.rb
@@ -2,13 +2,16 @@ module Docs
class Vue
class EntriesFilter < Docs::EntriesFilter
def get_name
- if slug == 'api/'
+ if slug == 'api/' || slug == 'api/index'
'API'
elsif slug == 'style-guide/'
'Style Guide'
else
name = at_css('.content h1').content
node = at_css(".sidebar .menu-root a[href='#{File.basename(slug)}']")
+
+ return name if node.nil?
+
index = node.parent.parent.css('> li > a').to_a.index(node)
name.prepend "#{index + 1}. " if index
name
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]