【发布时间】:2021-10-31 05:06:19
【问题描述】:
我有一个 index.blade,标题中包含所有必要的元标记,让我们以描述为例:
<meta name="description" content="This is the description">
这是我当前的索引文件
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@yield('site_title')</title>
@yield('head_content')
<meta name="description" content="This is the description">
...
</head>
现在,对于一个特定的子页面(/page),我想要一个不同的描述,这就是我所拥有的:
@extends('layouts.app')
@section('head_content')
<meta name="description" content="This is a different description">
@endsection
不幸的是,这在最终的 html 子页面上添加了两个元描述。有没有办法让单个子页面有不同的元描述,但有全局描述?
【问题讨论】:
标签: php laravel laravel-blade meta-tags