Comments (5)
Here is what I suggest can be added to the header.html file. This allows users to customize the most important tags.
<!-- ============ open graph tags ========== --> <meta property="og:site_name" content="{{ .Site.Params.openGraph.siteName | default .Site.Title}}"/> <meta property="og:title" content="{{ .Site.Params.openGraph.title | default .Site.Title}}"/> <meta property="og:description" content="{{ .Site.Params.openGraph.description | default .Site.Params.description }}"/> <meta property="og:image" content="{{ .Site.Params.openGraph.image | default .Site.Params.logo.main }}"> <meta property="og:url" content="{{ .Site.Params.openGraph.url | default .Site.BaseURL }}"> <meta property="og:type" content="{{ .Site.Params.openGraph.title | default "website"}}"/>
from toha.
@drem-darios hugo offers the ability to customize opengraph settings via an internal template https://gohugo.io/templates/internal/#open-graph
Does that enable what you are looking for or are there more customizations needed?
from toha.
So this is what it would do to the posts pages
However, one problem with the open-graph internal template is that it won't take into account internationalization for the main home page for the description like we do here https://github.com/hossainemruz/toha/blob/master/layouts/index.html#L12
https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/opengraph.html#L2
You could technically add the description config back into the main config.yml if you wanted.
If internationalization isn't a strong requirement, it would technically be simplest to use the internal template to align with hugo standards and not create more custom config options, but it won't be as flexible as something like what @drem-darios posted above
from toha.
Echoing this request (also for Twitter cards)!
from toha.
Added OpenGraph header in #333. Used Hugo internal template for the post pages. Added a custom template for home page to handle the internationalization.
Check this PR to see how to customize the headers.
hugo-toha/hugo-toha.github.io#77
from toha.
Related Issues (20)
- bug blurry images HOT 5
- Hovering a post card tag does not change appearance HOT 2
- Change /icons Directory Path HOT 2
- "I want to update the theme automatically, but the theme-update.yml fails." HOT 6
- When I push to my repository deployed on gh-pages, the custom domain field goes blank. This has been happening since I updated from Theme version 3 to version 4. HOT 4
- Feature Request: Show different pictures for dark theme HOT 1
- Bootstrap 5 HOT 1
- Cannot see Hero images on my posts after theme update HOT 4
- How to set different background image for dark and light themes? HOT 1
- Using FontAwesome icon for project card HOT 2
- How to use toha in production envοΌ HOT 1
- Feature Request - Add Page View Counter Section to Posts
- Can not switch to english if another language is set by default HOT 4
- navbar-brand text should be customizable (not always site.Title)
- Huge amount of whitelines in generated html files HOT 1
- Oversized application.js HOT 3
- Day of week missing in Finnish HOT 2
- JSBUILD failed when init from scratch HOT 2
- How to disable "light" theme? HOT 1
- Site always shows English language independent of browser settings/weights HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toha.