Skip to content

Commit

Permalink
docs: add opengraph meta
Browse files Browse the repository at this point in the history
Add proper description and social preview
to the readthedocs site.
  • Loading branch information
derlin committed Mar 24, 2024
1 parent 04cc4d7 commit 0310e41
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 6 deletions.
5 changes: 5 additions & 0 deletions docs/00-getting_started.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
:og:description: Get started with mantelo.

.. meta::
:description: Get started with mantelo.

.. _getting_started:

🏁 Getting started
Expand Down
6 changes: 5 additions & 1 deletion docs/01-authentication.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.. _authentication:
:og:description: How to authenticate to Keycloak using mantelo.

.. meta::
:description: How to authenticate to Keycloak using mantelo.

.. _authentication:

🔐 Authenticate to Keycloak
===========================
Expand Down
10 changes: 6 additions & 4 deletions docs/02-making-calls.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
.. _making_calls:
:og:description: How to make calls to the Keycloak Admin API using mantelo.

.. meta::
:description: How to make calls to the Keycloak Admin API using mantelo.

.. role:: python(code)
:language: python
.. _making_calls:

📡 Making calls
===============

Once you have configured how to authenticate to Keycloak, the rest is easy-peasy. mantelo **starts
with the URL ``<server-url>/admin/realms/<realm-name>``** and constructs the URL from there,
with the URL** ``<server-url>/admin/realms/<realm-name>`` and constructs the URL from there,
depending on how you call the client.

The return value is the HTTP response content as a :python:`dict` (parsed from the JSON response). In
Expand Down
5 changes: 5 additions & 0 deletions docs/90-api.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
:og:description: The API documentation for Mantelo.

.. meta::
:description: The API documentation for Mantelo.

.. _api:

The API Documentation
Expand Down
Binary file added docs/_static/images/mantelo-social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"sphinx.ext.intersphinx",
"autoapi.extension",
"sphinx_copybutton",
"sphinxext.opengraph",
]

autoapi_type = "python"
Expand All @@ -52,6 +53,10 @@
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

rst_prolog = """
.. role:: python(code)
:language: python
"""

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Expand Down Expand Up @@ -84,3 +89,8 @@
}
],
}

ogp_site_url = "https://mantelo.readthedocs.io/en/latest/"
ogp_social_cards = {
"image": "_static/images/mantelo-social-preview.png",
}
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
:og:description: Mantelo is a super small yet super powerful Python library for interacting with the Keycloak Admin API.

.. meta::
:description: Mantelo is a super small yet super powerful Python library for interacting with the Keycloak Admin API.

Mantelo: A Keycloak Admin REST Api Client for Python
=====================================================

Expand Down
2 changes: 1 addition & 1 deletion mantelo/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@frozen
class AuthenticationException(Exception):
"""
Exception raised when the authentication fails with "401 Unauthorized" status code.
Exception raised when the authentication request fails with a `401 Unauthorized` status code.
"""

error: str
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ docs = [
"sphinx-book-theme",
"sphinx-autoapi",
"sphinx-copybutton",
"sphinxext-opengraph",
]


Expand Down

0 comments on commit 0310e41

Please sign in to comment.