{"id":20128180,"url":"https://github.com/thenewdynamic/hugo-module-tnd-socials","last_synced_at":"2025-08-20T15:08:16.721Z","repository":{"id":75047722,"uuid":"240039797","full_name":"theNewDynamic/hugo-module-tnd-socials","owner":"theNewDynamic","description":"Hugo Module for printing Social follow links","archived":false,"fork":false,"pushed_at":"2022-02-08T19:59:50.000Z","size":31,"stargazers_count":3,"open_issues_count":4,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-02T21:28:00.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","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/theNewDynamic.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-12T14:58:19.000Z","updated_at":"2022-02-08T19:59:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"713f707a-0237-4be8-94ff-090c6b0d725e","html_url":"https://github.com/theNewDynamic/hugo-module-tnd-socials","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/theNewDynamic/hugo-module-tnd-socials","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-socials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-socials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-socials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-socials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theNewDynamic","download_url":"https://codeload.github.com/theNewDynamic/hugo-module-tnd-socials/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-socials/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271337930,"owners_count":24742061,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-13T20:26:02.990Z","updated_at":"2025-08-20T15:08:16.695Z","avatar_url":"https://github.com/theNewDynamic.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hugo Module TND Socials\n\n## Requirements\n\nRequirements:\n- Go 1.14\n- Hugo 0.61.0\n\n\n## Installation\n\nIf not already, [init](https://gohugo.io/hugo-modules/use-modules/#initialize-a-new-module) your project as Hugo Module:\n\n```\n$: hugo mod init {repo_url}\n```\n\nConfigure your project's module to import this module:\n\n```yaml\n# config.yaml\nmodule:\n  imports:\n  - path: github.com/theNewDynamic/hugo-module-tnd-socials\n```\n\n## Usage\n\n### GetSocials\n\nModule provides one partial called `GetSocials` which returns every or some Social services set in the project through the Module's [configuration](#configuration).\n\nReturned services are maps structured as the following:\n  - String (.Name)\n  - String (.Handle)\n  - String (.URL)\n  - SVG (String of safe HTML)\n\nIf the given partial receives a `.Page` key with a Page object as value among its context, each service will sport an extra key:\n  - String (.ShareURL)\n\n#### Default \"Follow Us\" links\n\nTo simply print links pointing to the project's Social landing pages:\n\n```\n{{ range partialCached \"tnd-socials/GetSocials\" \"GetSocials\" }}\n  \u003ca href=\"{{ .URL }}\" title=\"Follow {{ .Handle }} on {{ .Name }}\"\u003e\n    {{ .SVG }}\n  \u003c/a\u003e\n{{ end }}\n```\nBy default, the partial will return all the services set though the module's configuration in their original order. \nTo limit or reorder services, the partial can take a `slice` as context:\n```\n{{ range partial \"tnd-socials/GetSocials\" (slice \"facebook \"twitter\") }}\n[...]\n{{ end }}\n```\n\n#### \"Share On..\" links\n\nThe partial can also return a `.ShareURL` key for each services if it receives a `.Page` key among its context. The value is a share URL for the given services.\n(Ex: `https://www.linkedin.com/sharing/share-offsite/?url=https://example.com/that-article`) \n\nChosen services discussed above will be hold in a `services` key.\n\n```\n{{ range partial \"tnd-socials/GetSocials\" (dict \"Page\" $ \"services\" (slice \"facebook\" \"twitter\")) }}\n  \u003ca href=\"{{ .ShareURL }}\" title=\"Share on {{ .Name }}\"\u003e\n    {{ .SVG }}\n  \u003c/a\u003e\n{{ end }}\n```\n\nServices sporting a ShareURL are for now:\n- Facebook\n- Twitter\n- LinkedIn\n- Email\n\n### Icons\n\nIcons are pulled from a default [set](https://github.com/theNewDynamic/hugo-module-tnd-icons/tree/master/svgs) but can easily be overwritten by adding svg files to your projects using the following naming convention:\n\n`assets/tnd-socials/{service|icon}.svg`\n\n## Configure\n\nThe module can read Hugo's default `Social` settings but we recommand using the module's own `.Params.tnd_socials` reserved key for more control:\n\n### Services\nThe `services` key takes a slice of Maps with the following keys:\n  - __name*__: The name of the service\n  - __handle*__: The username or handle of the service's profile. Use an email address for the `email` service.\n  - __url__: If the profile URL does not follow the conventional `https://www.{service}.com/{handle}` it should be set here.\n  - __icon__: Icon file's basename (no extension). Available icons are [here](https://github.com/theNewDynamic/hugo-module-tnd-icons/tree/master/svgs)  \n\n```yaml\n# config.yaml\nparams:\n  tnd_socials:\n    services:\n    - name: github\n      handle: theNewDynamic\n    - name: twitter\n      handle: JohnDoe\n      url: https://www.twitter.com/john67898\n      icon: twitter-alt\n    - name: email\n      handle: welcome@thenewdynamic.com\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenewdynamic%2Fhugo-module-tnd-socials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenewdynamic%2Fhugo-module-tnd-socials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenewdynamic%2Fhugo-module-tnd-socials/lists"}