In these cases the site permalink is used instead of the social network
URL for sharing as defined in the `link` value
(https://www.linkedin.com/shareArticle in the below example)
Most visible case is LinkedIn but all social networks that have
```toml
[ananke.social.networks.particles]
...
params = "..."
```
in `config/_default/params.toml` are affected by this bug.
Closes#768.
You can't just cache the share links, that will result into every blog
post having the same URL.
Just use `partial` on the getShareLink.html. So now each post will show
the correct URL to share the post via social media or alike.
---------
Signed-off-by: Melroy van den Berg <melroy@melroy.org>
Signed-off-by: Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Co-authored-by: Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
You definitely want to **add Plainify transformer first**, because the
body content will become a HTML encoding mess. I left `HTMLEscape` there
as well, just be sure for security reasons. But if you want, I can
remove the second transformer.
Like a tweet on X will look like this:
![image](https://github.com/user-attachments/assets/73ab37b0-decc-47a4-8bbd-cf43cbef1641)
After implementing `transform.Plainify`, it will look much better:
![image](https://github.com/user-attachments/assets/962ba515-72ae-4b46-827f-2c477358d065)
(ignore the red, I don't have X premium pro blabla, it's red because I
hit the max limit of chars)
Signed-off-by: Melroy van den Berg <melroy@melroy.org>
Do NOT use the same cache name for social _share_ and social _follow_..
This will never work of course.
Signed-off-by: Melroy van den Berg <melroy@melroy.org>
A bare bones setup of two pages and two posts gets broken because of a
template change missed in #665
Fatal error message in readable form:
```
ERROR render:
failed to render pages:
render of "home" failed: "/themes/ananke/layouts/index.html:48:23":
execute of template failed:
template:
index.html:48:23:
executing "main" at <.Site.GetPage>: can't evaluate field Site in type string
```
Steps to reproduce:
```shell
hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> hugo.toml
echo -e "+++\ntitle='Home'\n+++\n\nMain page" > content/_index.md
echo Foo. > content/page1.md
echo Bar > content/page2.md
mkdir -p content/post
echo "First post." > content/post/post1.md
echo "Second post." > content/post/post2.md
hugo server
Watching for changes in .../quickstart/{archetypes,assets,content,data,i18n,layouts,static,themes}
Watching for config changes in .../quickstart/hugo.toml, ...quickstart/themes/ananke/config.yaml
Start building sites …
hugo v0.125.3-474c4c02212cf97712c6fbf4159c68822ea6e078+extended darwin/amd64 BuildDate=2024-04-22T17:18:35Z VendorInfo=brew
Built in 67 ms
Error: error building site: render: failed to render pages: render of "home" failed: ".../quickstart/themes/ananke/layouts/index.html:48:23": execute of template failed: template: index.html:48:23: executing "main" at <.Site.GetPage>: can't evaluate field Site in type string
```
When you want to publish content that is already published on a different site. You need to reference a canonical url of the original content.
By defining the `canonicalUrl` in the front matter definition the canonical url is set in the headers.
* assets: replace Mastodon logo
The new version is based on the logo-black.svg file distributed from
https://joinmastodon.org/branding, adjusted to match the metrics of the
other social logos.
* layouts: change the color for the mastodon social link
I've picked a purple from https://joinmastodon.org/branding.
* layouts: use absURL to construct absolute URLs instead of concatenating with .Site.BaseURL
* layouts: let hugo generate URLs to taxonomy terms
* layouts: link to current language's home page in the site footer