简体   繁体   中英

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.

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 . 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. For me on Awesome Inc it is class called

    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. The whole url would look like this:

    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.

  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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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