{"id":21770770,"url":"https://github.com/gouravkhunger/jekyll-hostname","last_synced_at":"2025-04-13T16:41:00.841Z","repository":{"id":56878602,"uuid":"441840731","full_name":"gouravkhunger/jekyll-hostname","owner":"gouravkhunger","description":"A liquid filter for Jekyll to extract the hostname from a URL","archived":false,"fork":false,"pushed_at":"2024-10-31T03:39:09.000Z","size":53,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-27T07:35:50.617Z","etag":null,"topics":["hacktoberfest","jekyll","jekyll-plugin","ruby"],"latest_commit_sha":null,"homepage":"http://hostname.gourav.sh/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gouravkhunger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-26T08:11:10.000Z","updated_at":"2024-10-31T03:38:42.000Z","dependencies_parsed_at":"2022-08-20T23:10:19.028Z","dependency_job_id":null,"html_url":"https://github.com/gouravkhunger/jekyll-hostname","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gouravkhunger%2Fjekyll-hostname","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gouravkhunger%2Fjekyll-hostname/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gouravkhunger%2Fjekyll-hostname/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gouravkhunger%2Fjekyll-hostname/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gouravkhunger","download_url":"https://codeload.github.com/gouravkhunger/jekyll-hostname/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248746932,"owners_count":21155352,"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":["hacktoberfest","jekyll","jekyll-plugin","ruby"],"created_at":"2024-11-26T14:13:45.439Z","updated_at":"2025-04-13T16:41:00.791Z","avatar_url":"https://github.com/gouravkhunger.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jekyll::Hostname\n\n[![Gem Version](https://img.shields.io/gem/v/jekyll-hostname)][ruby-gems]\n[![Gem Total Downloads](https://img.shields.io/gem/dt/jekyll-hostname)][ruby-gems]\n\n[ruby-gems]: https://rubygems.org/gems/jekyll-hostname\n\nA jekyll plugin to grab the hostnames from a URL, meaning\n\n- `https://google.com` becomes `google.com`\n- `http://github.com` becomes `github.com`\n- `https://github.com/gouravkhunger/jekyll-hostname` becomes `github.com`\n\nThis gem was originally authored to be used as a custom plugin for the [static site](https://github.com/genicsblog/genicsblog.github.io) of [genicsblog.com](https://genicsblog.com)\n\n## Installation\n\nAdd this line to your application's Gemfile inside the `jekyll_plugins` group:\n\n```ruby\ngroup :jekyll_plugins do\n    # other gems\n    gem \"jekyll-hostname\"\nend\n```\n\nThen, enable the plugin by adding it to the `plugins` section in the `_config.yml` file:\n\n```yaml\nplugins:\n    # - other plugins\n    - jekyll-hostname\n```\n\nAnd then execute:\n\n```shell\nbundle install\n```\n\n## Usage\n\nThis plugin is essentially a filter and works on any [valid URL string](https://en.wikipedia.org/wiki/URL#Syntax) provided inside a liquid tag. Use it as below:\n\n```liquid\n{% assign host = site.url | hostname %}\n{% assign domain = post.source | hostname %}\n```\n\nThe `hostname` filter extracts the root domain from the given url string(here `site.url` or `page.source`)\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n```\nMIT License\n\nCopyright (c) 2021 Gourav Khunger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgouravkhunger%2Fjekyll-hostname","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgouravkhunger%2Fjekyll-hostname","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgouravkhunger%2Fjekyll-hostname/lists"}