1 log 修改
pre = “ "
2 doit 修改:
1 sitemap.xml 加单独的txt内容。 1 seo.html 修改 增加keyword desc 。是将网站信息以 JSON-LD 格式放入页面 head 标签内,其中包含了网站的 URL、语言、作者、描述、图像、许可等信息。如果你想在这里显示 keywords,可以按以下方式修改: 3 posts/single.html 增加 related-extent.html relate-meta.html random.html 65行。去掉 本来也没有用 因为关联3个html。新版本 这些文件是没有的。 sidebar.html –>recent_post.html categories.html
4 grep -r “link-to-report” themes/DoIt/ single 下的footer.html 修改 删除一些foot信息。
5 grep -r “post-meta” themes/DoIt/ _default/summary.html
6 google 谷歌放 partials/footer.html 放head/seo.html 无反应 还需测试
7 themes/DoIt/assets/js/theme.js const isTocStatic = window.matchMedia && window.matchMedia(‘only screen and (max-width: 1000px)’).matches
8 https://instant.page/5.1.1 打不开
https://www.moewah.com/archives/1675.html hugo –gc –minify –config config-f2bb.toml
:1,$ s/post/posts/g 老模板超宽问题 find . -name ‘*.md’ -exec bash -c ‘mv “$0” “${0%.md}.zh-cn.md”’ {} ;
– shortcode; wordkeys desc 调整; 页面调整 ;tag数目调整 f2bb 调整code显示行数; 宽度调整;右侧目录去掉h2 。 3fff github 提醒调整 短码调整 ;3fff字体颜色 ,版式调整。 翻译标题 成英文; 手册 ,hot 空白页跳转
3 seo 信息
grep -r “description” -l themes/DoIt/ |grep -v js |grep layout themes/DoIt/layouts/partials/head/meta.html themes/DoIt/layouts/partials/head/seo.html
grep -r “keywords” -l themes/DoIt/ themes/DoIt/layouts/partials/head/seo.html
这是一段结构化数据,它是在页面head部分使用JSON-LD格式描述页面上的信息,通常用于向搜索引擎和其他机器人提供更丰富的页面信息。该信息可以用于改进页面的搜索引擎排名,并使搜索结果中的页面更加简洁明了。
<script type=application/ld+json>{"@context":"http://schema.org","@type":"BlogPosting","headline":"ESET NOD32 Antivirus,NOD32 Internet Security,NOD32 SmartSecurityPremium最新激活码【2023年01月30日】part2","inLanguage":"zh-CN","mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/www.f2bb.com\/eset-nod32-antivirusnod32-internet-securitynod32-smartsecuritypremium%E6%9C%80%E6%96%B0%E6%BF%80%E6%B4%BB%E7%A0%812023%E5%B9%B401%E6%9C%8830%E6%97%A5part2\/"},"image":["https:\/\/www.f2bb.com\/images\/Apple-Devices-Preview.png"],"genre":"posts","keywords":"nod32key, nod32激活码, 福利","wordcount":313,"url":"https:\/\/www.f2bb.com\/eset-nod32-antivirusnod32-internet-securitynod32-smartsecuritypremium%E6%9C%80%E6%96%B0%E6%BF%80%E6%B4%BB%E7%A0%812023%E5%B9%B401%E6%9C%8830%E6%97%A5part2\/","datePublished":"2023-01-30T00:00:00+00:00","dateModified":"2023-01-30T00:00:00+00:00","license":"This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.","publisher":{"@type":"Organization","name":"xxxx","logo":{"@type":"ImageObject","url":"https:\/\/www.f2bb.com\/images\/avatar.webp","width":528,"height":560}},"author":{"@type":"Person","name":"Ydy"},"description":""}</script>
这种方式好,还是这样好里面有keywords
两种方式都可以,关键词在页面的任何地方出现都是有利于SEO的。 "meta name=keywords" 和 "meta name=description" 是在HTML中提供关键词和网页描述的传统方法,而 "script type=application/ld+json" 包含的 JSON-LD 数据结构是一种更新的、用于描述网页内容的方法,有利于提高搜索引擎排名。因此,您可以根据自己的需求使用这两种方法中的任意一个,或者同时使用它们。{{- $desc := .Description }} {{- if eq $desc "” }} {{- $desc = .Content | plainify | truncate 30 }} {{- if eq $desc "" }} {{- $desc = (slice .Content.Pages 0 1).GetPage “title” | safeHTML }} {{- end -}} {{- end -}}
“description”: {{ $desc | safeHTML }}
如果没有Description,将使用该页面的前30个字符作为描述,如果还是没有,则使用该页面的标题。
{{- else -}} {{- with .Params.author | default .Site.Author.name | default (T “author”) -}} “author”: { “@type”: “Person”, “name”: {{ . | safeHTML }} }, {{- end -}} {{- end -}} “description”: {{ .Description | safeHTML }} } 如果md文件没有 Description, 则取所有h2, 如果取不到取文章前30个字符。怎么写
{{- $desc := .Description -}}
{{- if eq $desc "" -}}
{{- $desc = .Content | markdownify | truncate 30 -}}
{{- end -}}
“description”: {{ $desc | safeHTML }}
请仔细看题:python实现 查找 Z:\work\f2bb\content文件夹下的所有.md文件,包括子目录。特别注意:【有些文件的后缀是这样的.zh-cn.md,如果以.作为划分符的话要注意。特别注意文件20行后的内容不能丢失。文件读和写utf-8格式。】 查找所有文件的前20行。md在文章的frontmatter里 tags: 是否含有
- “nod32key” 或者 - “nod32激活码” 。有则在date: “变量2023-01-30"这行的下面 添加一行定义hiddenFromHomePage: true 要这个md文章不在首页显示 并把日志 (文件名 有nod32key 已添加 hiddenFromHomePage: true )追加到 url2slug.log
4 在上面代码的基础上改2点: 1 排除Z:\work\f2bb\content下的Z:\work\f2bb\content\posts\2021 这个目录。 2
在if ‘- “nod32key”’ in line or ‘- “nod32激活码”’ in line:成功后,在判断是否已经有含hiddenFromHomePage:的行。没有在添加hiddenFromHomePage: true到date: “{date}下面
现在用的 做标签图标。能不能推荐常用类似的图标代码。
1 hugo md文件头定义块中的url:跟slug:的区别 ? 2 设置posts = “:slug” , md文件如果url: 和slug: 分别没有定义。默认的url地址是怎么生成的? 3 设置posts = “:slug/:filefilename” , md文件如果url: slug: 分别没有定义。默认的url地址是怎么生成的? 。如果md文件有slug定义, url是什么样的。 如果md文件有url: 定义 ,url是什么样的。 4 设置posts = “:filefilename” ,contenxt/posts/19202122/python/1992.md url是多少 5 怎样做到老md文件 /slug 。 新文件以:filefilename
if not filename.endswith(".md”): if file.endswith(’.md’) or file.endswith(’.zh-cn.md’):
5 定制 xml
要定制hugo的sitemap 需要修改上面的代码哪里,以满足下面的要求: 首页 changefreq是daily priority是1.0 比如首页 https://www.2urs.com。 普通页面 changefreq是monthly priority是0.7 比如 https://www.2urs.com/2824.html 等所有普通页面。 tags页面 changefreq是Weekly priority是0.5 比如 https://www.2urs.com/tag/python 所有tags页面。 category页面 changefreq是Weekly priority是0.5 比如 https://www.2urs.com/category/jishu所有category页面。
对 /home/wwwroot/xdjhcg/content/post/ 目录下的所有的md文件进行重命名。包括所有子文件夹, 除了2021这个子文件夹外。 1 如果文件名是否含有中文字符【不包含中文特殊字符】 则进行重命名 。 2 重命名的名字是 调用process_title(title): 比如传入文字名 “记 - springmvc使用POI,快速实现Excel导入导出” 输出的英文名,remember-springmvc-uses-poi-to-quickly-implement-excel-import-and-export 3 重命名 文件后缀md文件 比如 remember-springmvc-uses-poi-to-quickly-implement-excel-import-and-export.md
对public/categories/目录下的所有子文件夹(不包括文件) 生成以下xml信息:
随机文章
语音合成相关总结
python100问
要定制hugo的sitemap 需要代码满足下面的要求: 首页 changefreq是daily priority是1.0 比如首页 https://www.2urs.com 普通页面 changefreq是monthly priority是0.7 比如 https://www.2urs.com/2824.html 等所有普通页面 tags页面 changefreq是Weekly priority是0.5 比如 https://www.2urs.com/tag/python 等所有tags页面 category页面 changefreq是Weekly priority是0.5 比如 https://www.2urs.com/category/jishu等所有category页面。
hugo主题doit 支持中英文,英文文章是xxx.md;中文文章是xxx.zh-cn.md 。如果只要中文。 Please enable Javascript support to see the free keys
python实现抓取https://t2bot.ru/en/esetkeys/页面中
的内容 写入md文件, md文件细节要求: 要求使用 浏览器头请求页面 1: 文件名为 ESET NOD32 latest key【 时间变量 格式为:2023年1月24日 】 2: md文件的文件头部yaml代码为:6 其它
访问https://www.fo.com/posts是正常的 但访问 https://www.fo.com/posts/page/2/ 变成https://www.fo.com/了。这是错误的。改怎么改下 hugo 。主题是DoIt 。现在有个问题请教你 在首页中翻页功能正常 https://www.fo.com/page/2/ https://www.fo.com/page/3/ 在文章页面中 翻页功能不正常 https://www.2urs.com/posts/ 可以打开。但是 https://www.fo.com/page/2/ 就跳转为 https://www.fo.com 你知道是哪里控制这个跳转的吗。我看了nginx没有posts的rewrite。root 就是 hugo的public目录 可能我改了/layouts/ 一些代码导致这样。 但不知具体是哪个文件。
./layouts/index.rss.xml: {{- range where .Site.RegularPages “Type” “posts” | first (.Site.Params.home.rss | default 10) -}} ./layouts/index.html: {{- $posts := .Site.Params.home.posts -}} ./layouts/index.html: <div class=“page home”{{ if ne $posts.enable false | or .Content }} posts{{ end }}> ./layouts/index.html: {{- if ne $posts.enable false | and .Site.RegularPages -}} ./layouts/index.html: {{- $pages := where .Site.RegularPages “Type” “posts” -}} ./layouts/index.html: {{- with $posts.paginate | default .Site.Params.paginate -}} ./layouts/partials/recent_post.html: {{ range first 10 (where (where .Site.Pages “Type” “in” (slice “post” “posts”)) “Kind” “page”) }} ./layouts/partials/comment.html: data-numposts=”{{ $facebook.numPosts }}" ./layouts/partials/related-extent.html: {{- $paginator := .Paginate (where .Site.RegularPages “Type” “in” (slice “post” “posts”)) }} config.toml看到 [params.list] paginate = 20 然后搜索主题中 paginate 只搜到下面文件 root@superb-bliss-2 DoIt]# grep -r “paginate” .|grep -v “i18n” |grep -v “exampleSite” |grep -v “.js” ./layouts/taxonomy/list.html: {{- with .Site.Params.list.paginate | default .Site.Params.paginate -}} ./layouts/index.html: {{- with $posts.paginate | default .Site.Params.paginate -}} ./layouts/_default/section.html: {{- with .Site.Params.section.paginate | default .Site.Params.paginate -}} hugo 。主题是DoIt 。现在有个问题请教你。
nginx rewrite相关的也已经关闭 但是出现下面问题:https://www.fo.com/posts/ 可以打开。但是点第二页 https://www.fo.com/page/2/ 就跳转为 https://www.fo.com 下面是nginx 日志: 199.19.108.231 - - [15/Mar/2023:11:10:36 +0800] “GET /posts/ HTTP/2.0” 304 0 “https://www.fo.com/use-chatgpt-in-china-chatgpt-personal-version/" “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36” – - 0.002 199.19.108.231 - - [15/Mar/2023:11:10:40 +0800] “GET / HTTP/2.0” 304 0 “https://www.fo.com/posts/" “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36” – - 0.002 请仔细看题: nginx 一个静态站 root为 /www/public/ 。现在有个问题请教你。 首页可以打开。 但是 下面文章页有问题。 问题:文章页https://www.fo.com/posts/ 可以打开。但是点第二页 https://www.fo.com/page/2/ 不能正常访问。访问就跳转为 https://www.fo.com
说明【第二页 html源码部分为 2 】ls -alh /www/public/posts/page/2 有文件 index.htmllocation / { rewrite ^/go/(.)$ /go.html?url=$1 last; #注意 go.html 的实际路径,默认为网站根目录 location / { try_files $uri $uri/ /index.php?$args; ### 共同 rewrite ^/java$ /categories/java$1 permanent ; rewrite ^/nod32key$ /tags/nod32key/$1 permanent ; rewrite ^/nod32key/$ /tags/nod32key/$1 permanent ; rewrite ^/avg-internet-security-key$ /tags/avg-internet-security-key/$1 permanent ; rewrite ^/kubernetes$ /categories/kubernetes$1 permanent ; rewrite ^/wordpress$ /categories/wordpress$1 permanent ; rewrite ^/tag/(.)$ /tags/$1 permanent ; #rewrite ^/数据库/([^/]+)/([^/]+)/.$ /categories/数据库/ permanent; rewrite ^/数据库/(.)$ /categories/数据库/ permanent; rewrite ^/云大数据/(.)$ /categories/云大数据/ permanent; rewrite ^/web-server/(.)$ /categories/web-server/ permanent; rewrite ^/提问$ /question/$1 permanent ; rewrite ^/dwqa-answer/回答(.*)$ /question/$1 permanent; }
hugo –gc –minify –config /home/wwwroot/ydy/config.toml -d /home/wwwroot/ydy/public3 –theme /home/wwwroot/ydy/themes/DoIt0.3.0
Section (所有文章) 页面配置
[params.section] # special amount of posts in each section page # section 页面每页显示文章数量 paginate = 20
[Permalinks] posts = “:filename”
[languages.zh-cn.menu] [[languages.zh-cn.menu.main]] identifier = "posts" # 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标 pre = "" # 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标 post = "" name = "文章" url = "/posts/"
其它修改 https://blog.csdn.net/Beyond_F4/article/details/125779359
h1 { font-size: 28px; word-wrap: break-word; color: #222226; font-weight: 600; margin: 0; word-break: break-all; } /home/wwwroot/ydy/themes/DoIt/assets/css/_core /home/wwwroot/ydy/themes/DoIt/layouts/shortcodes 您可以在相应的CSS文件中修改.code-header元素的display属性。例如,您可以将其display属性设置为block,以便在页面加载时显示代码区。 https://www.f2bb.com/python%E5%B8%B8%E7%94%A8%E6%96%B9%E6%B3%95___%E6%97%A5%E8%A1%8C%E4%B8%80%E5%96%84g.md/ display: flex;
随机文章