{"id":13696176,"url":"https://github.com/pelican-plugins/linkclass","last_synced_at":"2025-04-10T04:32:48.999Z","repository":{"id":32042120,"uuid":"35613617","full_name":"pelican-plugins/linkclass","owner":"pelican-plugins","description":"Pelican plugin to set anchor tag's class attribute to differentiate between internal and external links","archived":false,"fork":false,"pushed_at":"2024-04-14T10:01:06.000Z","size":114,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-02T00:03:07.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pelican-plugins.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"justinmayer","custom":"https://donate.getpelican.com","liberapay":"pelican"}},"created_at":"2015-05-14T13:47:39.000Z","updated_at":"2024-07-21T07:35:09.678Z","dependencies_parsed_at":"2023-02-16T16:16:14.001Z","dependency_job_id":"26856c96-57ac-4725-957c-bab06766d5b6","html_url":"https://github.com/pelican-plugins/linkclass","commit_stats":{"total_commits":98,"total_committers":6,"mean_commits":"16.333333333333332","dds":0.5204081632653061,"last_synced_commit":"7f9a7a5d66ea893d557290ac823a90c0757b5f50"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Flinkclass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Flinkclass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Flinkclass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Flinkclass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pelican-plugins","download_url":"https://codeload.github.com/pelican-plugins/linkclass/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248157656,"owners_count":21057048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T18:00:36.971Z","updated_at":"2025-04-10T04:32:48.986Z","avatar_url":"https://github.com/pelican-plugins.png","language":"Python","funding_links":["https://github.com/sponsors/justinmayer","https://donate.getpelican.com","https://liberapay.com/pelican"],"categories":["Plugins"],"sub_categories":["Migrated to new architecture"],"readme":"Link Class: A Plugin for Pelican\n================================\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/pelican-plugins/linkclass/main.yml?branch=main)](https://github.com/pelican-plugins/linkclass/actions)\n[![PyPI Version](https://img.shields.io/pypi/v/pelican-linkclass)](https://pypi.org/project/pelican-linkclass/)\n[![Downloads](https://img.shields.io/pypi/dm/pelican-linkclass)](https://pypi.org/project/pelican-linkclass/)\n[![License](https://img.shields.io/pypi/l/pelican-linkclass?color=blue)](https://www.gnu.org/licenses/agpl-3.0.en.html)\n\nThis Pelican plugin allows you to set the class attribute of `\u003ca\u003e` elements (generated in Markdown by `[ext](link)`) according to whether the link is external (i.e., starts with `http://` or `https://`) or internal to the Pelican-generated site.\n\nFor now, this plugin only works with Markdown. It has been tested with version 3.0+ of the Python-Markdown module and may not work with previous versions.\n\n\nInstallation\n------------\n\nThis plugin [is available as a package](https://pypi.org/project/pelican-linkclass/) at PyPI and can be installed via:\n\n```\npython -m pip install pelican-linkclass\n```\n\nAs long as you have not explicitly added a `PLUGINS` setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add `avatar` to your existing `PLUGINS` list. For more information, please see the [How to Use Plugins](https://docs.getpelican.com/en/latest/plugins.html#how-to-use-plugins) documentation.\n\n\nConfiguration\n-------------\n\nIn order to avoid clashes with already-defined classes in the user CSS style sheets, it is possible to specify the name of the classes that will be used. They can be specified in the Pelican setting file with the `LINKCLASS` variable, which must be defined as a list of tuples, like this:\n\n```python\n'LINKCLASS' = (('EXTERNAL_CLASS', 'name-of-the-class-for-external-links'),\n               ('INTERNAL_CLASS', 'name-of-the-class-for-internal-links'))\n```\n\nThe default values for `EXTERNAL_CLASS` and `INTERNAL_CLASS` are, respectively, `'external'` and `'internal'`.\n\n\nStyling Hyperlinks\n------------------\n\nOne of the possible uses of this plugins is for styling. Suppose that we have the following Markdown content in your article:\n\n```markdown\nThis is an [internal](internal) link and this is an\n[external](http://external.com) link.\n```\n\nIf the default configuration variable values are used, then one possible CSS setting could be:\n\n```css\na.external:before {\n    content: url('../images/external-link.png');\n    margin-right: 0.2em;\n}\n```\n\n(The file `external-link.png` is also distributed with this plugin. To use it, copy it to the appropriate place in your web site source tree, for instance in `theme/static/images/`.)\n\nThen, the result will look like the following:\n\n![figure](https://github.com/pelican-plugins/linkclass/raw/main/linkclass-example.png)\n\nNote that this plugin also works with reference-style links, as in the following example:\n\n```markdown\nThis is an [internal][internal] link and this is an\n[external][external] link.\n\n [internal]: internal\n [external]: http://external.com\n```\n\n\nContributing\n------------\n\nContributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].\n\nTo start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.\n\n[existing issues]: https://github.com/pelican-plugins/linkclass/issues\n[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html\n\n\nAcknowledgments\n---------------\n\nMany thanks to [Yuliya Bagriy][] for setting up the package for [PyPI][], to [Lucas Cimon][] for fixing the issues with [pytest][], and to [Justin Mayer][] for helping with migration of this plugin under the Pelican Plugins organization.\n\n[Yuliya Bagriy]: https://github.com/aviskase\n[PyPI]: https://pypi.org/\n[Lucas Cimon]: https://github.com/Lucas-C\n[pytest]: https://pytest.org/\n[Justin Mayer]: https://github.com/justinmayer\n\n\nAuthor\n------\n\nCopyright © 2015, 2017, 2019, 2021-2023, 2025 Rafael Laboissière (\u003crafael@laboissiere.net\u003e)\n\n\nLicense\n-------\n\nThis project is released under the terms of the GNU Affero Public License, version 3 or later.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpelican-plugins%2Flinkclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpelican-plugins%2Flinkclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpelican-plugins%2Flinkclass/lists"}