|
49 | 49 | {% include toc_recursive_dropdown.html entries=TOCFILE my_entry=MY_ENTRY path_to_root=PATH_TO_ROOT %} |
50 | 50 | </ul> |
51 | 51 | </div> |
52 | | - |
53 | | - {% comment %} |
54 | | - Show a single edit-link if the page has a specific edit-link. |
55 | | - {% endcomment %} |
56 | 52 | {% if page.edit_link %} |
57 | | - <a class="edit hidden-xs hidden-sm" href="{{ page.edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_text }}</a> |
58 | | - |
59 | | - {% comment %} |
60 | | - Otherwise, show editing and translating options. |
61 | | - |
62 | | - Edit-links obey the following rules: |
63 | | - |
64 | | - if page in /dev/ or /latest/: |
65 | | - show edit link for /dev/ page in source language |
66 | | - if page not in source language: |
67 | | - show translation link for /dev/ page |
68 | | - else: |
69 | | - show edit link for the page in its version and language |
70 | | - |
71 | | - {% endcomment %} |
72 | | - {% else %} |
73 | | - |
74 | | - {% capture base_edit_link %}https://github.com/apache/cordova-docs/tree/master/www/{{ page.path }}{% endcapture %} |
75 | | - {% capture base_version %}/{{ page.version }}/{% endcapture %} |
76 | | - {% capture base_language %}/{{ page.language }}/{% endcapture %} |
77 | | - {% capture dev_version %}/dev/{% endcapture %} |
78 | | - {% capture src_language %}/{{ site.src_language }}/{% endcapture %} |
79 | | - |
80 | 53 | {% comment %} |
81 | | - Edit-links for current pages in non-source languages |
82 | | - NOTE: |
83 | | - Pages that are under /dev/ or /latest/ (i.e. site.latest_docs_version) have page.current set to "true". |
| 54 | + Remote Pages (E.g. Plugins, CLI, ...) |
84 | 55 | {% endcomment %} |
85 | | - {% if page.language != site.src_language and page.current %} |
86 | | - |
87 | | - {% comment %} |
88 | | - Compute crowdin link |
89 | | - {% endcomment %} |
90 | | - {% capture page_path_prefix %}docs/{{ page.language }}/{{ page.version }}{% endcapture %} |
91 | | - {% assign page_path_end = page.path | split:"/" | last %} |
92 | | - {% assign crowdin_path = page.path | replace:page_path_prefix,"docs/en/dev" | replace:page_path_end,"" %} |
93 | | - {% capture crowdin_link %}https://crowdin.com/project/cordova/{{ page.language }}#/cordova-docs/{{ crowdin_path }}{% endcapture %} |
94 | | - |
95 | | - {% assign edit_link = base_edit_link | replace:base_language,src_language | replace:base_version,dev_version %} |
96 | | - |
97 | | - <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a> |
98 | | - <a class="edit" href="{{ crowdin_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_translation_text }}</a> |
99 | | - |
| 56 | + {% assign edit_link = page.edit_link %} |
| 57 | + {% assign edit_text = page.edit_text %} |
| 58 | + {% else %} |
100 | 59 | {% comment %} |
101 | | - Edit-links for all other pages |
| 60 | + Cordova-Doc Pages |
102 | 61 | {% endcomment %} |
103 | | - {% else %} |
104 | | - |
105 | | - {% comment %} |
106 | | - Edit-link for latest version points to dev instead |
107 | | - {% endcomment %} |
108 | | - {% if page.version == site.latest_docs_version %} |
109 | | - {% assign edit_link = base_edit_link | replace:base_version,dev_version %} |
110 | | - {% else %} |
111 | | - {% assign edit_link = base_edit_link %} |
112 | | - {% endif %} |
113 | | - |
114 | | - <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a> |
115 | | - {% endif %} |
| 62 | + {% assign edit_link = "https://github.com/apache/cordova-docs/tree/master/www/" | append: page.path %} |
| 63 | + {% assign edit_text = page.edit_source_text %} |
116 | 64 | {% endif %} |
| 65 | + {% comment %} |
| 66 | + The edit icon will be hidden on small screens. (e.g. mobile) |
| 67 | + {% endcomment %} |
| 68 | + <a class="edit hidden-xs hidden-sm" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ edit_text }}</a> |
117 | 69 | </div> |
118 | 70 |
|
119 | 71 | {% comment %} |
|
0 commit comments