You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "erisu (via GitHub)" <gi...@apache.org> on 2026/02/18 08:15:09 UTC
[PR] doc: fix edit page link & cleanup [cordova-docs]
erisu opened a new pull request, #1474:
URL: https://github.com/apache/cordova-docs/pull/1474
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
https://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Motivation and Context
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->
Resolves #1465
### Description
<!-- Describe your changes in detail -->
- Update URL to point to `latest`
- Remove more old language conditional logic
### Testing
<!-- Please describe in detail how you tested your changes. -->
`npm run serve`
### Checklist
- [ ] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
- [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
- [ ] I've updated the documentation if necessary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc: fix edit page link & cleanup [cordova-docs]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu commented on code in PR #1474:
URL: https://github.com/apache/cordova-docs/pull/1474#discussion_r2854266962
##########
www/_layouts/docs.html:
##########
@@ -49,71 +49,23 @@
{% include toc_recursive_dropdown.html entries=TOCFILE my_entry=MY_ENTRY path_to_root=PATH_TO_ROOT %}
</ul>
</div>
-
- {% comment %}
- Show a single edit-link if the page has a specific edit-link.
- {% endcomment %}
{% if page.edit_link %}
- <a class="edit hidden-xs hidden-sm" href="{{ page.edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_text }}</a>
-
- {% comment %}
- Otherwise, show editing and translating options.
-
- Edit-links obey the following rules:
-
- if page in /dev/ or /latest/:
- show edit link for /dev/ page in source language
- if page not in source language:
- show translation link for /dev/ page
- else:
- show edit link for the page in its version and language
-
- {% endcomment %}
- {% else %}
-
- {% capture base_edit_link %}https://github.com/apache/cordova-docs/tree/master/www/{{ page.path }}{% endcapture %}
- {% capture base_version %}/{{ page.version }}/{% endcapture %}
- {% capture base_language %}/{{ page.language }}/{% endcapture %}
- {% capture dev_version %}/dev/{% endcapture %}
- {% capture src_language %}/{{ site.src_language }}/{% endcapture %}
-
{% comment %}
- Edit-links for current pages in non-source languages
- NOTE:
- Pages that are under /dev/ or /latest/ (i.e. site.latest_docs_version) have page.current set to "true".
+ Remote Pages (E.g. Plugins, CLI, ...)
{% endcomment %}
- {% if page.language != site.src_language and page.current %}
-
- {% comment %}
- Compute crowdin link
- {% endcomment %}
- {% capture page_path_prefix %}docs/{{ page.language }}/{{ page.version }}{% endcapture %}
- {% assign page_path_end = page.path | split:"/" | last %}
- {% assign crowdin_path = page.path | replace:page_path_prefix,"docs/en/dev" | replace:page_path_end,"" %}
- {% capture crowdin_link %}https://crowdin.com/project/cordova/{{ page.language }}#/cordova-docs/{{ crowdin_path }}{% endcapture %}
-
- {% assign edit_link = base_edit_link | replace:base_language,src_language | replace:base_version,dev_version %}
-
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
- <a class="edit" href="{{ crowdin_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_translation_text }}</a>
-
+ {% assign edit_link = page.edit_link %}
+ {% assign edit_text = page.edit_text %}
+ {% else %}
{% comment %}
- Edit-links for all other pages
+ Cordova-Doc Pages
{% endcomment %}
- {% else %}
-
- {% comment %}
- Edit-link for latest version points to dev instead
- {% endcomment %}
- {% if page.version == site.latest_docs_version %}
- {% assign edit_link = base_edit_link | replace:base_version,dev_version %}
- {% else %}
- {% assign edit_link = base_edit_link %}
- {% endif %}
-
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
- {% endif %}
+ {% assign edit_link = "https://github.com/apache/cordova-docs/tree/master/www/" | append: page.path %}
+ {% assign edit_text = page.edit_source_text %}
{% endif %}
+ {% comment %}
+ The edit icon will be hidden on small screens. (e.g. mobile)
+ {% endcomment %}
+ <a class="edit hidden-xs hidden-sm" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ edit_text }}</a>
Review Comment:
Links were hidden in some cases and visible in others. I decided to unify the behavior and hide them in all cases.
I'm not sure how common it is for people to create and submit PRs from a phone. I usually find working on a phone very difficult due to typos, autocorrect issues, autofill errors, etc.
Based on web traffic, over the past year:
- Only 11.3% of our web traffic has come from phones.
- About 1% has come from phablets, tablets, or other devices (not desktop/laptops).
Additionally, over the past 24 months (2 years), most contributions came from PMC members.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc: fix edit page link & cleanup [cordova-docs]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu merged PR #1474:
URL: https://github.com/apache/cordova-docs/pull/1474
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc: fix edit page link & cleanup [cordova-docs]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on code in PR #1474:
URL: https://github.com/apache/cordova-docs/pull/1474#discussion_r2853342785
##########
www/_layouts/docs.html:
##########
@@ -49,71 +49,23 @@
{% include toc_recursive_dropdown.html entries=TOCFILE my_entry=MY_ENTRY path_to_root=PATH_TO_ROOT %}
</ul>
</div>
-
- {% comment %}
- Show a single edit-link if the page has a specific edit-link.
- {% endcomment %}
{% if page.edit_link %}
- <a class="edit hidden-xs hidden-sm" href="{{ page.edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_text }}</a>
-
- {% comment %}
- Otherwise, show editing and translating options.
-
- Edit-links obey the following rules:
-
- if page in /dev/ or /latest/:
- show edit link for /dev/ page in source language
- if page not in source language:
- show translation link for /dev/ page
- else:
- show edit link for the page in its version and language
-
- {% endcomment %}
- {% else %}
-
- {% capture base_edit_link %}https://github.com/apache/cordova-docs/tree/master/www/{{ page.path }}{% endcapture %}
- {% capture base_version %}/{{ page.version }}/{% endcapture %}
- {% capture base_language %}/{{ page.language }}/{% endcapture %}
- {% capture dev_version %}/dev/{% endcapture %}
- {% capture src_language %}/{{ site.src_language }}/{% endcapture %}
-
{% comment %}
- Edit-links for current pages in non-source languages
- NOTE:
- Pages that are under /dev/ or /latest/ (i.e. site.latest_docs_version) have page.current set to "true".
+ Remote Pages (E.g. Plugins, CLI, ...)
{% endcomment %}
- {% if page.language != site.src_language and page.current %}
-
- {% comment %}
- Compute crowdin link
- {% endcomment %}
- {% capture page_path_prefix %}docs/{{ page.language }}/{{ page.version }}{% endcapture %}
- {% assign page_path_end = page.path | split:"/" | last %}
- {% assign crowdin_path = page.path | replace:page_path_prefix,"docs/en/dev" | replace:page_path_end,"" %}
- {% capture crowdin_link %}https://crowdin.com/project/cordova/{{ page.language }}#/cordova-docs/{{ crowdin_path }}{% endcapture %}
-
- {% assign edit_link = base_edit_link | replace:base_language,src_language | replace:base_version,dev_version %}
-
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
- <a class="edit" href="{{ crowdin_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_translation_text }}</a>
-
+ {% assign edit_link = page.edit_link %}
+ {% assign edit_text = page.edit_text %}
+ {% else %}
{% comment %}
- Edit-links for all other pages
+ Cordova-Doc Pages
{% endcomment %}
- {% else %}
-
- {% comment %}
- Edit-link for latest version points to dev instead
- {% endcomment %}
- {% if page.version == site.latest_docs_version %}
- {% assign edit_link = base_edit_link | replace:base_version,dev_version %}
- {% else %}
- {% assign edit_link = base_edit_link %}
- {% endif %}
-
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
- {% endif %}
+ {% assign edit_link = "https://github.com/apache/cordova-docs/tree/master/www/" | append: page.path %}
+ {% assign edit_text = page.edit_source_text %}
{% endif %}
+ {% comment %}
+ The edit icon will be hidden on small screens. (e.g. mobile)
+ {% endcomment %}
+ <a class="edit hidden-xs hidden-sm" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ edit_text }}</a>
Review Comment:
Why should the edit button be hidden on small screens? The docs could be also changed on mobil phones.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc: fix edit page link & cleanup [cordova-docs]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on code in PR #1474:
URL: https://github.com/apache/cordova-docs/pull/1474#discussion_r2854910021
##########
www/_layouts/docs.html:
##########
@@ -49,71 +49,23 @@
{% include toc_recursive_dropdown.html entries=TOCFILE my_entry=MY_ENTRY path_to_root=PATH_TO_ROOT %}
</ul>
</div>
-
- {% comment %}
- Show a single edit-link if the page has a specific edit-link.
- {% endcomment %}
{% if page.edit_link %}
- <a class="edit hidden-xs hidden-sm" href="{{ page.edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_text }}</a>
-
- {% comment %}
- Otherwise, show editing and translating options.
-
- Edit-links obey the following rules:
-
- if page in /dev/ or /latest/:
- show edit link for /dev/ page in source language
- if page not in source language:
- show translation link for /dev/ page
- else:
- show edit link for the page in its version and language
-
- {% endcomment %}
- {% else %}
-
- {% capture base_edit_link %}https://github.com/apache/cordova-docs/tree/master/www/{{ page.path }}{% endcapture %}
- {% capture base_version %}/{{ page.version }}/{% endcapture %}
- {% capture base_language %}/{{ page.language }}/{% endcapture %}
- {% capture dev_version %}/dev/{% endcapture %}
- {% capture src_language %}/{{ site.src_language }}/{% endcapture %}
-
{% comment %}
- Edit-links for current pages in non-source languages
- NOTE:
- Pages that are under /dev/ or /latest/ (i.e. site.latest_docs_version) have page.current set to "true".
+ Remote Pages (E.g. Plugins, CLI, ...)
{% endcomment %}
- {% if page.language != site.src_language and page.current %}
-
- {% comment %}
- Compute crowdin link
- {% endcomment %}
- {% capture page_path_prefix %}docs/{{ page.language }}/{{ page.version }}{% endcapture %}
- {% assign page_path_end = page.path | split:"/" | last %}
- {% assign crowdin_path = page.path | replace:page_path_prefix,"docs/en/dev" | replace:page_path_end,"" %}
- {% capture crowdin_link %}https://crowdin.com/project/cordova/{{ page.language }}#/cordova-docs/{{ crowdin_path }}{% endcapture %}
-
- {% assign edit_link = base_edit_link | replace:base_language,src_language | replace:base_version,dev_version %}
-
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
- <a class="edit" href="{{ crowdin_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_translation_text }}</a>
-
+ {% assign edit_link = page.edit_link %}
+ {% assign edit_text = page.edit_text %}
+ {% else %}
{% comment %}
- Edit-links for all other pages
+ Cordova-Doc Pages
{% endcomment %}
- {% else %}
-
- {% comment %}
- Edit-link for latest version points to dev instead
- {% endcomment %}
- {% if page.version == site.latest_docs_version %}
- {% assign edit_link = base_edit_link | replace:base_version,dev_version %}
- {% else %}
- {% assign edit_link = base_edit_link %}
- {% endif %}
-
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
- {% endif %}
+ {% assign edit_link = "https://github.com/apache/cordova-docs/tree/master/www/" | append: page.path %}
+ {% assign edit_text = page.edit_source_text %}
{% endif %}
+ {% comment %}
+ The edit icon will be hidden on small screens. (e.g. mobile)
+ {% endcomment %}
+ <a class="edit hidden-xs hidden-sm" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ edit_text }}</a>
Review Comment:
Ok. In the past I remember a moment where I found something in the docu I wanted to change and did it by the edit button. But now I do the most work on desktop. So it makes sense, also when it was not consistent before. I wouldn't have thought, that so less traffic is made by phones.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc: fix edit page link & cleanup [cordova-docs]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu commented on code in PR #1474:
URL: https://github.com/apache/cordova-docs/pull/1474#discussion_r2854266962
##########
www/_layouts/docs.html:
##########
@@ -49,71 +49,23 @@
{% include toc_recursive_dropdown.html entries=TOCFILE my_entry=MY_ENTRY path_to_root=PATH_TO_ROOT %}
</ul>
</div>
-
- {% comment %}
- Show a single edit-link if the page has a specific edit-link.
- {% endcomment %}
{% if page.edit_link %}
- <a class="edit hidden-xs hidden-sm" href="{{ page.edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_text }}</a>
-
- {% comment %}
- Otherwise, show editing and translating options.
-
- Edit-links obey the following rules:
-
- if page in /dev/ or /latest/:
- show edit link for /dev/ page in source language
- if page not in source language:
- show translation link for /dev/ page
- else:
- show edit link for the page in its version and language
-
- {% endcomment %}
- {% else %}
-
- {% capture base_edit_link %}https://github.com/apache/cordova-docs/tree/master/www/{{ page.path }}{% endcapture %}
- {% capture base_version %}/{{ page.version }}/{% endcapture %}
- {% capture base_language %}/{{ page.language }}/{% endcapture %}
- {% capture dev_version %}/dev/{% endcapture %}
- {% capture src_language %}/{{ site.src_language }}/{% endcapture %}
-
{% comment %}
- Edit-links for current pages in non-source languages
- NOTE:
- Pages that are under /dev/ or /latest/ (i.e. site.latest_docs_version) have page.current set to "true".
+ Remote Pages (E.g. Plugins, CLI, ...)
{% endcomment %}
- {% if page.language != site.src_language and page.current %}
-
- {% comment %}
- Compute crowdin link
- {% endcomment %}
- {% capture page_path_prefix %}docs/{{ page.language }}/{{ page.version }}{% endcapture %}
- {% assign page_path_end = page.path | split:"/" | last %}
- {% assign crowdin_path = page.path | replace:page_path_prefix,"docs/en/dev" | replace:page_path_end,"" %}
- {% capture crowdin_link %}https://crowdin.com/project/cordova/{{ page.language }}#/cordova-docs/{{ crowdin_path }}{% endcapture %}
-
- {% assign edit_link = base_edit_link | replace:base_language,src_language | replace:base_version,dev_version %}
-
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
- <a class="edit" href="{{ crowdin_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_translation_text }}</a>
-
+ {% assign edit_link = page.edit_link %}
+ {% assign edit_text = page.edit_text %}
+ {% else %}
{% comment %}
- Edit-links for all other pages
+ Cordova-Doc Pages
{% endcomment %}
- {% else %}
-
- {% comment %}
- Edit-link for latest version points to dev instead
- {% endcomment %}
- {% if page.version == site.latest_docs_version %}
- {% assign edit_link = base_edit_link | replace:base_version,dev_version %}
- {% else %}
- {% assign edit_link = base_edit_link %}
- {% endif %}
-
- <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a>
- {% endif %}
+ {% assign edit_link = "https://github.com/apache/cordova-docs/tree/master/www/" | append: page.path %}
+ {% assign edit_text = page.edit_source_text %}
{% endif %}
+ {% comment %}
+ The edit icon will be hidden on small screens. (e.g. mobile)
+ {% endcomment %}
+ <a class="edit hidden-xs hidden-sm" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ edit_text }}</a>
Review Comment:
Links were hidden in some cases and visible in others. I decided to unify the behavior and hide them in all cases, for small screens (mobile phones).
I'm not sure how common it is for people to create and submit PRs from a phone. I usually find working on a phone very difficult due to typos, autocorrect issues, autofill errors, etc.
Based on web traffic, over the past year:
- Only 11.3% of our web traffic has come from phones.
- About 1% has come from phablets, tablets, or other devices (not desktop/laptops).
Additionally, over the past 24 months (2 years), most contributions came from PMC members.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org