Commit Graph

27 Commits

Author SHA1 Message Date
Martin Brennan 7721b1646d
DEV: Update defer_track_visit method in line with core (#174)
When https://github.com/discourse/discourse/pull/27761 is
merged in core the v2 method name is obsolete and we
can call `defer_track_visit` once more.
2024-07-08 16:37:25 +10:00
Martin Brennan 0d9365571b
DEV: Use new core code API for topic view tracking (#173)
Brings this plugin into line with the changes at
https://github.com/discourse/discourse/pull/27533,
where we have split the topic view tracking into
2 controller functions.
2024-07-08 10:14:50 +10:00
Renato Atilio 025bf46f8d
FEATURE: add local onebox handler for /docs urls (#145) 2023-07-14 10:35:11 -03:00
Jordan Vidrine 06f6d00ba1
FEATURE: Use the same structure as core topic-list-item and add topic excerpts to docs index (#140)
* FEATURE: Optionally show topic excerpts in docs index

This commit adds a new docs_show_topic_excerpts site setting
which, when enabled and used in conjunction either with the
always_include_topic_excerpts site setting or the
serialize_topic_excerpts theme modifier.

For the theme modifier, this commit also fixes an issue
with the Docs::Query class. Since we were re-initializing
Guardian within the class (rather than using the guardian
passed down from the controller), we did not have the request
information needed to determine theme_id, which meant that
the theme modifier had no effect. We now pass down guardian
from the controller instead. In general guardian is almost
always better than a user object, since we can always just
call guardian.user.

Adds a simple system spec as well.

---

We now check both the serialize_topic_excerpts theme modifier
and the always_include_topic_excerpts site setting server-side
within Docs::Query, and use that on the client to determine
whether or not to show the excerpts for docs. This is because if
someone sets one of those values it's logical to think it will
apply everywhere there is a topic list.

Also include a system spec to test whether the theme modifier
works to show the excerpts.

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2023-06-15 12:44:44 -05:00
Jarek Radosz d4ecda50ff
FIX: Incorrect plugin name in `requires_plugin` (#133)
This resulted in `Required plugin 'docs' not found` warnings in logs
2023-05-12 12:54:29 +02:00
David Taylor 724100044c
DEV: Introduce syntax_tree for ruby formatting (#118) 2022-12-29 13:31:34 +01:00
Bianca Nenciu 45386920ca
FIX: Use new robots.txt API (#101)
The old robots.txt was invalid because "User-agent: *" was found twice
in robots.txt. Using the API will generate correct robots.txt.
2022-07-13 19:53:56 +03:00
Krzysztof Kotlarek 7c54952414
FIX: TopicViewItem and TopicUser for doc topics (#80)
When a documentation topic is viewed, corresponding TopicViewItem and TopicUser should be created.

A method from a TopicController is called, however, specs should warn us if ever that core method would change.
2022-02-01 16:38:54 +11:00
Justin DiRose 2835500c62
FEATURE: Make Docs compatible with inline oneboxes (#33)
Linking directly to a Docs item like so `http://localhost:3000/docs?topic=16` would result in a generic inline onebox link. This adds logic to the Rails view so a proper title is rendered when the `InlineOneboxer` in core queries the route.
2021-02-16 15:09:45 -06:00
Justin DiRose f32aebdba0
FEATURE: Rename from Knowledge Explorer to Docs (#27)
After internal discussion, the team decided to rename this plugin to `discourse-docs`. No substantial changes made here aside from a settings migration.
2021-01-18 10:38:09 -06:00
Justin DiRose 22c2387b76
FIX: Topics not always properly shown (#11)
There was a bug with the logic in how we were checking for matching tags
and categories in KE settings. If only tags were set, topics would not
show.
2020-10-13 10:32:22 -05:00
Justin DiRose abb9047d29
FIX: Ignore canonical URL on /docs
When trying to onebox topics, the canonical URL overrides the generated
OpenGraph tags, causing a less than ideal onebox for a linked KE
article.

This commit uses the existing options for the `crawlable_meta_data`
method to generate the `og:ignore_canonical` tag.

1504fe7231/app/helpers/application_helper.rb (L267-L269)
2020-10-06 11:22:18 -05:00
Justin DiRose 310f2f142c
FIX: Handle encoding on onebox excerpt
Oneboxes were breaking with bad encoding using the out of the box
excerpt on the topic. Mimicked core behaviors instead.
2020-10-05 16:17:38 -05:00
Justin DiRose 7849f8943c
FIX: 406 Error on Reload
Logic was not properly checking if there was a topic selected or not. As a result, the template for onebox data was still being loaded, causing an error. Also changed the order around TopicView to avoid unwanted effects.
2020-10-01 13:24:28 -05:00
Justin DiRose 0e1c7c7216
FEATURE: Add onebox metadata (#10)
Currently linking directly to Knowledge Explorer topics shows a generic onebox, which isn't super helpful in some cases.

This commit mimics how the theme creator plugin handles adding metadata to special occurrences. However, to get this to work, how the plugin handles showing topic contents needed to be refactored. Instead of hitting the existing topic route, the plugin implements its own version of this, including adding restrictions for topics that are not in a selected Knowledge Explorer category or tag.
2020-10-01 09:32:28 -05:00
Justin DiRose 6eb3c7574d
FEATURE: Filter by solved 2020-06-15 14:16:57 -05:00
Justin DiRose 1dd582e1b1 FEATURE: Sorting per column on topic list 2019-11-18 11:03:49 -06:00
Justin DiRose a34e4468c1
REFACTOR: Handle queries in more robust, customizable way
* Create custom query lib file

* Get topic list by category

* Get topic list with both categories and tags

* Count tags and pass back to controller in object

* Filter topic list by param-passed tag list

* FIX: Correctly serialize topic list data

* Filter results by search term (title only

* Debug commit

* Working multi-tag filtering

* FIX: case insensitive search terms

* Begin refactor of front end for new api changes

* REFACTOR: Use model for refreshing data
Instead of just using a route, which introduces full page refreshes, use
the route to pull the data initially, then update it using a model as to
refresh only the relevant parts of the page.

* Working topic load

* FIX: Visual alignment

* Refactor tests to follow new patterns

* Fixes suggested by eviltrout

* FEATURE: Load more topics

* FIX: Paginate records on return to the front end in a better fashion

* FIX: Prevent loadMore while loading more

* Fix pagination of topics to truncate list properly

* Inherit rubocop from discourse

* Make rubocop happynated

* Set list to unordered
2019-10-31 15:09:50 -05:00
Justin DiRose 5d0da1fe0a Spec tests & minor refactors 2019-10-02 16:24:40 -05:00
Justin DiRose 6057e054c4 REFACTOR: Complete filtering on back end for complexity purposes 2019-09-10 13:36:02 -05:00
Justin DiRose e7359a118b FIX: Missing count method for search results 2019-09-10 10:45:25 -05:00
Justin DiRose 7b8d3a84bd FEATURE: Use category_list for selecting categories 2019-08-30 15:04:07 -05:00
Justin DiRose 2c9b904e15 Working tag filtering of topics 2019-07-26 10:50:22 -05:00
Justin DiRose b8fd5aa8e2 Return tag count
I'm probably doing this wrong 😅
2019-07-02 16:46:18 -05:00
Justin DiRose 03a85bb3d7 Fix routing for Ember 2019-07-02 09:20:51 -05:00
Justin DiRose 578773f3c0 FEATURE: Disallow crawling of /knowledge-explorer/ via robots.txt 2019-06-28 15:05:27 -05:00
Justin DiRose 1789bac0cf FEATURE: Render Topics from Selected Categories/Tags on `/knowledge-explorer`
Add category/tag settings

Rename to knowledge explorer

Missed rename

Render a deduplicated list of topics from all selected tags and categories

Exclude category topic ids from rendered list
2019-06-28 14:56:04 -05:00