mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-08 10:22:47 -04:00
feat: add license frontmatter field for link header
This commit adds the "license" frontmatter property which sets a link with the "license" relation in the head of the HTML page. Furthermore, this commit restructures the other head elements for a note altogether into a single component that can be used to inject all head elements at once. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
91e7056882
commit
cf34df21b7
11 changed files with 59 additions and 11 deletions
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { useAppTitle } from '../../hooks/common/use-app-title'
|
||||
import { useNoteTitle } from '../../hooks/common/use-note-title'
|
||||
import Head from 'next/head'
|
||||
import React, { useMemo } from 'react'
|
||||
|
||||
/**
|
||||
* Sets the note and app title for the browser window
|
||||
*/
|
||||
export const NoteAndAppTitleHead: React.FC = () => {
|
||||
const noteTitle = useNoteTitle()
|
||||
const appTitle = useAppTitle()
|
||||
|
||||
const noteAndAppTitle = useMemo(() => {
|
||||
return noteTitle + ' - ' + appTitle
|
||||
}, [appTitle, noteTitle])
|
||||
|
||||
return (
|
||||
<Head>
|
||||
<title>{noteAndAppTitle}</title>
|
||||
</Head>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue