Skip to content

Commit

Permalink
docs: add og-image example
Browse files Browse the repository at this point in the history
  • Loading branch information
maolonglong committed May 8, 2024
1 parent 03c1123 commit d05bae8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions exampleSite/content/blog/og-image/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
+++
title = "og-image"
date = "2024-05-08"
images = ["og-image/kateryna-ivanova-etgAEeMw2wc-unsplash.jpg"]
# OR:
# images = ["https://example.com/foo.png"]
+++

> <https://github.com/gohugoio/hugo/blob/c46d603a027a715db604d39f7a2e68a157ef0001/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/opengraph/opengraph.html>
```plaintext {hl_lines=["8-10"]}
.
├── _index.md
└── blog
├── _index.md
├── emoji-support.md
├── markdown-syntax.md
├── math-typesetting.md
├── og-image
│ ├── index.md
│ └── kateryna-ivanova-etgAEeMw2wc-unsplash.jpg
├── placeholder-text.md
└── rich-content.md
```

Page params:

```toml {hl_lines=["3-4"]}
title = "og-image"
date = "2024-05-08"
images = ["/og-image/kateryna-ivanova-etgAEeMw2wc-unsplash.jpg"]
# OR:
# images = ["https://example.com/foo.png"]
```

Output HTML:

```html
...

<meta property="og:image" content="http://localhost:1313/og-image/kateryna-ivanova-etgAEeMw2wc-unsplash.jpg">

...
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d05bae8

Please sign in to comment.