mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	feat: use auto-generated meta and link tags in ACP, closes #9991
This commit is contained in:
		| @@ -40,6 +40,7 @@ middleware.renderHeader = async (req, res, data) => { | |||||||
| 		configs: meta.configs.list(), | 		configs: meta.configs.list(), | ||||||
| 		latestVersion: getLatestVersion(), | 		latestVersion: getLatestVersion(), | ||||||
| 		privileges: privileges.admin.get(req.uid), | 		privileges: privileges.admin.get(req.uid), | ||||||
|  | 		tags: meta.tags.parse(req, {}, [], []), | ||||||
| 	}); | 	}); | ||||||
|  |  | ||||||
| 	const { userData } = results; | 	const { userData } = results; | ||||||
| @@ -61,6 +62,8 @@ middleware.renderHeader = async (req, res, data) => { | |||||||
| 		configJSON: jsesc(JSON.stringify(res.locals.config), { isScriptContext: true }), | 		configJSON: jsesc(JSON.stringify(res.locals.config), { isScriptContext: true }), | ||||||
| 		relative_path: res.locals.config.relative_path, | 		relative_path: res.locals.config.relative_path, | ||||||
| 		adminConfigJSON: encodeURIComponent(JSON.stringify(results.configs)), | 		adminConfigJSON: encodeURIComponent(JSON.stringify(results.configs)), | ||||||
|  | 		metaTags: results.tags.meta, | ||||||
|  | 		linkTags: results.tags.link, | ||||||
| 		user: userData, | 		user: userData, | ||||||
| 		userJSON: jsesc(JSON.stringify(userData), { isScriptContext: true }), | 		userJSON: jsesc(JSON.stringify(userData), { isScriptContext: true }), | ||||||
| 		plugins: results.custom_header.plugins, | 		plugins: results.custom_header.plugins, | ||||||
|   | |||||||
| @@ -2,8 +2,9 @@ | |||||||
| <html> | <html> | ||||||
| 	<head> | 	<head> | ||||||
| 		<title>{title}</title> | 		<title>{title}</title> | ||||||
| 		<meta name="viewport" content="width=device-width, initial-scale=1.0"> |  | ||||||
|  |  | ||||||
|  | 		{{{each metaTags}}}{function.buildMetaTag}{{{end}}} | ||||||
|  | 		{{{each linkTags}}}{function.buildLinkTag}{{{end}}} | ||||||
| 		<link rel="stylesheet" type="text/css" href="{relative_path}/assets/admin.css?{cache-buster}" /> | 		<link rel="stylesheet" type="text/css" href="{relative_path}/assets/admin.css?{cache-buster}" /> | ||||||
| 		<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | 		<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user