Skip to content
快速导航

DedeCMS网站模板的title、description、keywords应该怎么写?

首页

html
<title>{dede:global.cfg_webname /} - {dede:global.cfg_websubtitle /}</title>
<meta name="description" content="{dede:global.cfg_description /}">
<meta name="keywords" content="{dede:global.cfg_keywords /}">

注:

{dede:global.cfg_websubtitle /} 变量为网站副标题,默认没有,自行添加一下即可。

image

栏目页

html
<title>{dede:field.seotitle /} - {dede:global.cfg_webname /}</title>
<meta name="description" content="{dede:field.description /}">
<meta name="keywords" content="{dede:field.keywords /}">

注:

{dede:field.seotitle /} 变量为栏目SEO标题,在 栏目高级选项 里设置。

DedeCMS栏目SEO

栏目页的 title 也可使用 {dede:field.title /}{dede:field.typename /}

  • {dede:field.title /} 为栏目名 (带父级栏目名)
  • {dede:field.typename /} 为栏目名 (不带父级栏目名)

推荐使用 {dede:field.seotitle /}

文章页

html
<title>{dede:field.title /} - {dede:global.cfg_webname /}</title>
<meta name="description" content="{dede:field.description function='html2text(@me)' /}">
<meta name="keywords" content="{dede:field.keywords /}">

title连接符

<title> 中的连接符,可以根据个人喜好使用 -(中划线)、_(下划线)、|(竖线)等。

也可根据个人喜好在连接符前后各加一个空格。

唯一需要注意的是,不要在正式商用的网站上随心所欲改来改去改着玩!