简体   繁体   English

如何将登录页面添加到Blogger?

[英]How do I add a landing page to Blogger?

Current solutions found on the web include adding a page to the blog and setting an auto redirect to that page off of the index something like "/p/landing.html", or styling down the undesired elements through CSS and JS. 在网络上找到的当前解决方案包括将页面添加到博客,并设置从索引到“ /p/landing.html”之类的页面的自动重定向,或者通过CSS和JS设置不需要的元素的样式。

See here: 看这里:

page redirect 页面重定向

style down 风格化

What other alternatives exist, if any? 还有其他替代方案吗?

This is the way I found most useful for my needs after a little more research from here: handy blogger conditional syntax . 在从这里进行了更多研究之后,这就是我发现对自己的需求最有用的方式: 方便的Blogger条件语法 The general concept is to build a router within the template. 一般概念是在模板内构建路由器。 This can be a nightmare to maintain for larger projects I am sure, but for my simple purposes it works. 我敢肯定,对于大型项目而言,这可能是一场噩梦,但出于我的简单目的,它确实可行。

  1. Create a new Page (NOT Post) called 创建一个新页面(不发布),名为

    blog 博客

  2. Edit the html of your current blogger template ( I suggest setting the theme to "awesome inc" to make it simple, it is what I used) Find the beginning of the blog content. 编辑当前博客模板的html(我建议将主题设置为“ awesome inc”,以使其变得简单,这就是我所使用的模板)查找博客内容的开头。 For me on Awesome Inc it is class called 对我来说,在Awesome Inc上是

    body-fauxcolumns 假肢柱

  3. Insert this conditional being sure to change the url to your domain just above the beginning of your blog content with the addition of the new blog page we just created. 插入此条件,以确保在添加了我们刚刚创建的新博客页面之后,将您博客的URL更改为博客内容开头的上方。 The whole url would look like this: 整个网址如下所示:

    http://www.yoursweetblogname.com/p/blog.html http://www.yoursweetblogname.com/p/blog.html

Insert this just above the beginning of our body-fauxcolumns: 将其插入人体假肢的开头上方:

<b:if cond='data:blog.url == "the above uri"'>

在此处输入图片说明

  1. Close this conditional where the content ends, 在内容结束处关闭此条件,

    </b:if>

for me I was able to put it just above the closing body tag: 对我来说,我能够将其放在结束标签的上方:

在此处输入图片说明

  1. The last steps are sort of a gotcha. 最后的步骤有点麻烦。 If by this point you do not feel compelled to log into google domains and use a different tool for managing your website - Please note that the above will not actually work as your blog, but it does demonstrate how to hack a simple router into a blogger template for various static pages. 如果此时您不被迫登录Google域并使用其他工具来管理您的网站-请注意,以上内容实际上不能用作您的博客,但它确实演示了如何将简单的路由器入侵博客各种静态页面的模板。

  2. Create a second blog. 创建第二个博客。 This will be your actual blog. 这将是您的实际博客。 Ideally this is step one. 理想情况下,这是第一步。 Point your first blog with the landing page at your second blog. 将第一个博客和登录页面指向第二个博客。 Use that blog to manage your blog and the other to manage your static content being sure to change the above to: 使用该博客来管理您的博客,使用另一个博客来管理您的静态内容,请确保将以上内容更改为:

<b:if cond='false'>

There are better ways to do all of the above with different technology and if you have come this far I would recommend to stop and check it out: 有更好的方法可以使用不同的技术来完成上述所有操作,如果您走了这么远,我建议您停止并检查一下:

Google Domains FAQ Google网域常见问题解答

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM