我有一个脚本可以创建我所有帖子的存档,在更改域名并将https从https更改为https之后,我们设法通过一些帮助使其再次起作用。
现在的问题是,它不会加载文本格式,而是输出看起来很丑陋的未格式化文本。
尝试将css作为单独的脚本放置,但这没有区别(也没有意义)。
这是脚本的页面:https : //www.tecnoriales.com/p/sitemap.html
脚本的样式部分可以在下面的末尾找到
<script>
var LoadTheArchive = function(TotalFeed) {
var PostTitles = new Array();
var PostURLs = new Array();
var PostYears = new Array();
var PostMonths = new Array();
var PostDays = new Array();
if ("entry" in TotalFeed.feed) {
var PostEntries = TotalFeed.feed.entry.length;
for (var PostNum = 0; PostNum < PostEntries; PostNum++) {
var ThisPost = TotalFeed.feed.entry[PostNum];
PostTitles.push(ThisPost.title.$t);
PostYears.push(ThisPost.published.$t.substring(0, 4));
PostMonths.push(ThisPost.published.$t.substring(5, 7));
PostDays.push(ThisPost.published.$t.substring(8, 10));
var ThisPostURL;
for (var LinkNum = 0; LinkNum < ThisPost.link.length; LinkNum++) {
if (ThisPost.link[LinkNum].rel == "alternate") {
ThisPostURL = ThisPost.link[LinkNum].href;
break
}
}
PostURLs.push(ThisPostURL);
}
}
DisplaytheTOC(PostTitles, PostURLs, PostYears, PostMonths, PostDays);
}
var DisplaytheTOC = function(PostTitles, PostURLs, PostYears, PostMonths, PostDays) {
var MonthNames = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"];
var NumberOfEntries = PostTitles.length;
var currentMonth = "";
var currentYear = "";
for (var EntryNum = 0; EntryNum < NumberOfEntries; EntryNum++) {
NameOfMonth = MonthNames[parseInt(PostMonths[EntryNum], 10) - 1]
if (currentMonth != NameOfMonth || currentYear != PostYears[EntryNum]) {
currentMonth = NameOfMonth;
currentYear = PostYears[EntryNum];
它应该使用Trebuchet MS字体加载格式化的文本,使用粗体显示几个月的日期,并且每个项目仅使用一行,而不是两行。
相关分类