1
0
Fork 0
Beyond coding. We forge. https://codeberg.org/forgejo/forgejo
Find a file
Xavier Vello 147ae2c5be Fix opengraph meta for wiki pages (#4427)
Fixes https://codeberg.org/forgejo/forgejo/issues/4417 by adding a conditional branch to the `head_opengraph` template to match wiki pages. I tried to be consistent with the other types:

- `og:title` is the wiki page title
- `og:url` is built via `{{AppUrl}}{{.Link}}` like it is done for commit and file views. This has the caveat of doubling the slash (see test below). Should we `{{trimSuffix "/" AppUrl}}` to remove this, if sprig is available?
- `og:description` is the repository description to match GH behaviour. Also, the first sentences of the page might not be descriptive enough. Should we prefix the repo description with the repo name?
- `og:type` and `og:image` are common

Added a `TestOpenGraphProperties` integration test using existing fixtures. Coverage is not 100% but can be improved later.

## Output on a test repo

```html
<meta property="og:title" content="Project architecture">
<meta property="og:url" content="http://localhost:3000//xvello/wiki-test/wiki/Project-architecture">
<meta property="og:description" content="description for a test project">
<meta property="og:type" content="object">
<meta property="og:image" content="http://localhost:3000/avatars/3dd4d1e4eef065d1b4ad4bdb081ab6e7">
```

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4427
Co-authored-by: Xavier Vello <xavier.vello@gmail.com>
Co-committed-by: Xavier Vello <xavier.vello@gmail.com>
2024-07-10 18:29:35 +00:00
.devcontainer Update ghcr.io/devcontainers/features/git-lfs Docker tag to v1.2.1 2024-06-20 00:01:42 +00:00
.forgejo test: add valkey to remote cache test 2024-07-09 14:26:46 +10:00
.gitea
assets [CHORE] Remove github.com/yuin/goldmark-meta 2024-07-07 03:18:13 +02:00
build
cmd fix(hook): ignore unknown push options instead of failing 2024-07-02 21:39:01 +02:00
contrib Lock file maintenance 2024-07-01 00:03:45 +00:00
custom/conf Add support for workflow_dispatch (#3334) 2024-06-28 05:17:11 +00:00
docker
models fix artifact range requests (#4218) 2024-07-10 05:28:01 +00:00
modules Merge pull request '[gitea] week 2024-28 cherry pick (gitea/main -> forgejo)' (#4391) from earl-warren/wcp/2024-28 into forgejo 2024-07-09 05:37:52 +00:00
options Merge pull request 'Make user privacy settings more clear' (#4439) from 0ko/forgejo:ui-settings-activity into forgejo 2024-07-10 06:09:52 +00:00
public
release-notes Fix opengraph meta for wiki pages (#4427) 2024-07-10 18:29:35 +00:00
releases/images
routers fix artifact range requests (#4218) 2024-07-10 05:28:01 +00:00
services Fix slow patch checking with commits that add or remove many files (#31548) 2024-07-07 07:33:01 +02:00
templates Fix opengraph meta for wiki pages (#4427) 2024-07-10 18:29:35 +00:00
tests Fix opengraph meta for wiki pages (#4427) 2024-07-10 18:29:35 +00:00
tools
web_src Merge pull request 'Port of Refactor login page' (#4400) from 0ko/forgejo:ui-login-redesign into forgejo 2024-07-10 04:15:56 +00:00
.air.toml Reduce air verbosity (#31417) 2024-06-23 12:30:09 +02:00
.deadcode-out Refactor markup code (#31399) 2024-06-23 11:53:36 +02:00
.dockerignore
.editorconfig
.eslintrc.yaml
.gitattributes
.gitignore
.gitmodules
.gitpod.yml
.golangci.yml
.ignore
.markdownlint.yaml
.npmrc
.spectral.yaml
.yamllint.yaml
BSDmakefile
build.go
CODEOWNERS
CONTRIBUTING.md
DCO
Dockerfile Fix deprecated Dockerfile ENV format (#31450) 2024-06-23 13:20:40 +02:00
Dockerfile.rootless Fix deprecated Dockerfile ENV format (#31450) 2024-06-23 13:20:40 +02:00
flake.lock
flake.nix
go.mod Update module golang.org/x/tools to v0.23.0 2024-07-10 00:01:50 +00:00
go.sum Update module golang.org/x/tools to v0.23.0 2024-07-10 00:01:50 +00:00
LICENSE
main.go
Makefile Merge pull request '[gitea] week 2024-28 cherry pick (gitea/main -> forgejo)' (#4391) from earl-warren/wcp/2024-28 into forgejo 2024-07-09 05:37:52 +00:00
package-lock.json Lock file maintenance 2024-07-05 10:42:17 +00:00
package.json Merge pull request 'Update dependency esbuild-loader to v4.2.0' (#4165) from renovate/esbuild-loader-4.x into forgejo 2024-07-04 12:54:54 +00:00
playwright.config.js
poetry.lock Lock file maintenance 2024-07-01 00:03:45 +00:00
poetry.toml
pyproject.toml
README.md
RELEASE-NOTES.md docs(release-notes): 7.0.5 [skip ci] 2024-07-03 21:02:39 +02:00
renovate.json chore(renovate): group x/tools/* upgrade 2024-07-09 07:23:22 +02:00
stylelint.config.js
tailwind.config.js
vitest.config.js
webpack.config.js

Welcome to Forgejo

Hi there! Tired of big platforms playing monopoly? Providing Git hosting for your project, friends, company or community? Forgejo (/for'd͡ʒe.jo/ inspired by forĝejo the Esperanto word for forge) has you covered with its intuitive interface, light and easy hosting and a lot of builtin functionality.

Forgejo was created in 2022 because we think that the project should be owned by an independent community. If you second that, then Forgejo is for you! Our promise: Independent Free/Libre Software forever!

What does Forgejo offer?

If you like any of the following, Forgejo is literally meant for you:

  • Lightweight: Forgejo can easily be hosted on nearly every machine. Running on a Raspberry? Small cloud instance? No problem!
  • Project management: Besides Git hosting, Forgejo offers issues, pull requests, wikis, kanban boards and much more to coordinate with your team.
  • Publishing: Have something to share? Use releases to host your software for download, or use the package registry to publish it for docker, npm and many other package managers.
  • Customizable: Want to change your look? Change some settings? There are many config switches to make Forgejo work exactly like you want.
  • Powerful: Organizations & team permissions, CI integration, Code Search, LDAP, OAuth and much more. If you have advanced needs, Forgejo has you covered.
  • Privacy: From update checker to default settings: Forgejo is built to be privacy first for you and your crew.
  • Federation: (WIP) We are actively working to connect software forges with each other through ActivityPub, and create a collaborative network of personal instances.

Learn more

Dive into the documentation, subscribe to releases and blog post on our website, find us on the Fediverse or hop into our Matrix room if you have any questions or want to get involved.

Get involved

If you are interested in making Forgejo better, either by reporting a bug or by changing the governance, please take a look at the contribution guide.