{"id":16695587,"url":"https://github.com/hreikin/pelican-custom-css","last_synced_at":"2026-04-13T18:32:23.537Z","repository":{"id":65686598,"uuid":"588658644","full_name":"hreikin/pelican-custom-css","owner":"hreikin","description":"Pelican Custom CSS makes it easy to embed custom CSS into individual Pelican articles and pages","archived":false,"fork":false,"pushed_at":"2023-02-08T10:49:40.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-28T06:22:02.412Z","etag":null,"topics":["custom-css","pelican","pelican-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hreikin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-13T17:03:29.000Z","updated_at":"2023-02-04T11:28:45.000Z","dependencies_parsed_at":"2023-02-18T16:16:00.609Z","dependency_job_id":null,"html_url":"https://github.com/hreikin/pelican-custom-css","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/hreikin/pelican-custom-css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hreikin%2Fpelican-custom-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hreikin%2Fpelican-custom-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hreikin%2Fpelican-custom-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hreikin%2Fpelican-custom-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hreikin","download_url":"https://codeload.github.com/hreikin/pelican-custom-css/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hreikin%2Fpelican-custom-css/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31766436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["custom-css","pelican","pelican-plugin"],"created_at":"2024-10-12T17:07:39.063Z","updated_at":"2026-04-13T18:32:23.512Z","avatar_url":"https://github.com/hreikin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pelican Custom CSS\n\nPelican Custom CSS makes it easy to embed custom CSS into individual Pelican articles and pages. This repository is a fork of [Pelican CSS](https://notabug.org/jorgesumle/pelican-css) originally created by [Jorge Maldonado Ventura](https://notabug.org/jorgesumle) that has been converted to use the Pelican namespace plugin structure and published to PyPi.\n\n## Installation\n\nTo install `pelican-custom-css` run the following command:\n\n```\npip install pelican-custom-css\n```\n\n## Configuration\n\nNamespace plugins can be configured in a few ways, this section is taken straight from the [Pelican Documentation](https://docs.getpelican.com/en/latest/plugins.html) for plugins. If you leave the `PLUGINS` setting as default (None), Pelican will automatically discover namespace plugins and register them. If, on the other hand, you specify a `PLUGINS` setting as a list of plugins, this auto-discovery will be disabled. At that point, only the plugins you specify will be registered, and you must explicitly list any namespace plugins as well.\n\nIf you are using the `PLUGINS` setting, you can specify plugins in two ways. The first method specifies plugins as a list of strings. Namespace plugins can be specified either by their full names (pelican.plugins.myplugin) or by their short names (myplugin):\n\n```\nPLUGINS = ['package.myplugin',\n          'namespace_plugin1',\n          'pelican.plugins.namespace_plugin2']\n```\n\nAlternatively, you can import them in your settings file and pass the modules:\n\n```\nfrom package import myplugin\nfrom pelican.plugins import namespace_plugin1, namespace_plugin2\nPLUGINS = [myplugin, namespace_plugin1, namespace_plugin2]\n```\n\nNext, you will need to create a `css` directory in your `content` directory for your custom styles to live in.\n\n```\nwebsite/\n├── content\n│   ├── css/\n│   │   ├── your_custom_style1.css\n│   │   └── your_custom_style2.css\n│   ├── article1.md\n│   └── pages\n│       └── about.md\n└── pelicanconf.py\n```\n\nAnd then add each resource as a comma-separated file name with the `CSS` tag:\n\n```\nTitle: Mejor sin Wordpress\nDate: 2017-02-09 18:51\nTags: programación, Wordpress, generador de páginas estáticas, generador de sitios web estáticos, rendimiento, eficiencia, comodidad, desventajas\nCategory: Desarrollo web\nAuthor: jorgesumle\nSlug: mejor-sin-wordpress\nCSS: your_custom_style1.css, your_custom_style2.css\n```\n\nFinally, in your base template (likely named `base.html`), you need to add the following in your `\u003chead\u003e` tag:\n\n```\n{% if article %}\n    {% if article.styles %}\n        {% for style in article.styles %}\n            {{ style|format(SITEURL) }}\n        {% endfor %}\n    {% endif %}\n{% endif %}\n```\n\nSo, the template I use for my blog now looks like the following:\n\n```\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=utf-8\"\u003e\n    \u003ctitle\u003e{% block title %} {{SITENAME}} {% endblock %}\u003c/title\u003e\n    \u003clink rel=\"stylesheet\" href=\"{{ SITEURL }}/theme/css/style.css\" type=\"text/css\"\u003e\n    {% if article %}\n        {% if article.styles %}\n            {% for style in article.styles %}\n                {{ style|format(SITEURL) }}\n            {% endfor %}\n        {% endif %}\n    {% endif %}\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv class=container\u003e\n        {% block header %}\n            {% include \"header.html\" %}\n        {% endblock %}\n\n        \u003cdiv class=\"content\"\u003e\n        {% block content %} {% endblock %}\n        \u003c/div\u003e\n\n        {% block footer %}\n            {% include \"footer.html\" %}\n        {% endblock %}\n    \u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nThe previous code only works for articles. For most people, that's enough. If you want to enable custom CSS in pages too insert the following code your `\u003chead\u003e` tag...\n\n```\n{% if page %}\n    {% if page.styles %}\n        {% for style in page.styles %}\n            {{ style|format(SITEURL) }}\n        {% endfor %}\n    {% endif %}\n{% endif %}\n```\n\nThat's it! You can now generate and publish your site normally, for example using `ghp-import` if you're using Github Pages or the standard `make html` or `make publish` commands from Pelican and your CSS will be copied and referenced in the right places.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhreikin%2Fpelican-custom-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhreikin%2Fpelican-custom-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhreikin%2Fpelican-custom-css/lists"}