在 Angular 项目中添加 clean-blog 模板
clean-blog 博客模板下载
或者在下面链接下载
startbootstrap-clean-blog-4-dev.zip
解压并拷贝
解压下载的文件,将所有文件拷贝到 assets/clean-blog 目录下
拷贝代码
将 clean-blog 的 index.html 内容拷贝到 app.component.html
<!--The whole content below can be removed with the new code.--> <!-- Navigation --> <nav> <div> <button type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> Menu <i></i> </button> <a href="https://www.jb51.net/index.html">Start Bootstrap</a> <div> <ul> <li> <a href="https://www.jb51.net/index.html">Home</a> </li> <li> <a href="https://www.jb51.net/assets/clean-blog/about.html">About</a> </li> <li> <a href="https://www.jb51.net/assets/clean-blog/post.html">Sample Post</a> </li> <li> <a href="https://www.jb51.net/assets/clean-blog/contact.html">Contact</a> </li> </ul> </div> </div> </nav> <!-- Page Header --> <header> <div> <div> <div> <div> <h1>Clean Blog</h1> <span>A Blog Theme by Start Bootstrap</span> </div> </div> </div> </div> </header> <!-- Main Content --> <div> <div> <div> <div> <a href="https://www.jb51.net/assets/clean-blog/post.html"> <h2> Man must explore, and this is exploration at its greatest </h2> <h3> Problems look mighty small from 150 miles up </h3> </a> <p>Posted by <a href="#">Start Bootstrap</a> on September 24, 2017</p> </div> <hr> <div> <a href="https://www.jb51.net/assets/clean-blog/post.html"> <h2> I believe every human has a finite number of heartbeats. I don't intend to waste any of mine. </h2> </a> <p>Posted by <a href="#">Start Bootstrap</a> on September 18, 2017</p> </div> <hr> <div> <a href="https://www.jb51.net/assets/clean-blog/post.html"> <h2> Science has not yet mastered prophecy </h2> <h3> We predict too much for the next year and yet far too little for the next ten. </h3> </a> <p>Posted by <a href="#">Start Bootstrap</a> on August 24, 2017</p> </div> <hr> <div> <a href="https://www.jb51.net/assets/clean-blog/post.html"> <h2> Failure is not an option </h2> <h3> Many say exploration is part of our destiny, but it's actually our duty to future generations. </h3> </a> <p>Posted by <a href="#">Start Bootstrap</a> on July 8, 2017</p> </div> <hr> <!-- Pager --> <div> <a href="#">Older Posts →</a> </div> </div> </div> </div> <hr> <!-- Footer --> <footer> <div> <div> <div> <ul> <li> <a href="#"> <span> <i></i> <i></i> </span> </a> </li> <li> <a href="#"> <span> <i></i> <i></i> </span> </a> </li> <li> <a href="#"> <span> <i></i> <i></i> </span> </a> </li> </ul> <p>Copyright © Your Website 2017</p> </div> </div> </div> </footer>
styles.css 添加代码
/* clean-blog */ @import "assets/clean-blog/vendor/font-awesome/css/font-awesome.min.css"; @import "https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic"; @import "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800"; @import "assets/clean-blog/css/clean-blog.min.css"; .navbar-toggler { z-index: 1; } @media (max-width: 576px) { nav > .container { width: 100%; } }
index.html 添加 JS 引用
<!-- clean-blog --> <script src="https://www.jb51.net/assets/clean-blog/js/clean-blog.min.js"></script>
结果
提示: 文中的配置只是把 clean-blog 给搭建在 Angular4 的项目中,但是并没有大改其中的东西,比如链接等,现在还是一个静态的网页,后期才会添加自己的代码上去
示例代码