【问题标题】:What CMS systems can be used with static code? [closed]哪些 CMS 系统可以与静态代码一起使用? [关闭]
【发布时间】:2016-04-17 00:21:08
【问题描述】:

我知道这不是一个编码问题,但我一直在谷歌搜索和谷歌搜索,我似乎可以找到关于这个主题的任何内容...如果你愿意,我可以删除这篇文章,但我真的很想知道,所以请试一试!


我有一个我一直在制作的网站(只是编写 HTML 和 CSS),我希望有一个博客页面,我不想每次写博客文章时都重写代码,但是我不想为我的整个网站使用 CMS。有没有办法只为一页使用 CMS?或者以其他方式简化它?

感谢您的宝贵时间!

【问题讨论】:

    标签: html css content-management-system


    【解决方案1】:

    在我看来,您应该关注一个更加动态的数据系统。 CMS 是一个简单的解决方案,但可能是一种臃肿的方法。

    如果您只是希望能够使用静态页面模板并动态填写数据,则可以使用简单的 JSON 文件或 XML。

    您使用的是 Javascript,更具体地说是 Angular 还是 jQuery?

    可能还有数千种方法可以做到这一点,但如果没有更好的项目细节,那就有点投掷硬币了。

    一个非常简单的解决方案是简单地创建一个 AngularJS 组件并将其粘贴到您的单个博客页面 html 中。然后,仅使用外部 JSON 文件,您就可以将所有博客文章动态填充到单个模板文件中。

    HTML:

    <div ng-app='app' ng-controller='mainCtrl'>
        <div ng-repeat="blog in myJson" class="blog-post">
            <ul class="blog-list">
              <li class="blog-post-item">
                <h3>{{blog.title}}</h3>
                <p>{{blog.body}}</p>
                <p>{{blog.date}}</p>            
                <p>{{blog.misc}}</p>
              </li>
            </ul>
        </div>   
    </div>
    

    Javascript:

    angular.module('app',['QuickList']).controller('mainCtrl', function($scope){
        $scope.myJson = [{
            title: "Some title here",
          body: "Main blog post body here with <b> html content </b>",
          date: "Jan, 1, 2016",
          misc: "other info"
        },{
            title: "Some title here 2",
          body: "Main blog post body here with <b> html content </b>",
          date: "Jan, 1, 2016",
          misc: "other info"
        },{
            title: "Some title here 3",
          body: "Main blog post body here with <b> html content </b>",
          date: "Jan, 1, 2016",
          misc: "other info"
        },{
            title: "Some title here 4",
          body: "Main blog post body here with <b> html content </b>",
          date: "Jan, 1, 2016",
          misc: "other info"
        }]
    })
    

    并确保在您的 index.html 中包含角度源

    Here is a Fiddle Example

    【讨论】:

    • 感谢您的回答!我正在使用 JavaScript,但目前没有 jQuery 或 Angular。我将研究 AngularJS 和 JSON,但现在我都没有这方面的经验。非常感谢,这一直困扰着我!
    • 如何包含“角度源”?我遇到了麻烦,对JS不太了解,对不起!
    • 要查看我得到了什么以及我正在使用的代码,请转到jeffarries.com/blog,这可能是一个菜鸟错误,但有些东西不起作用。谢谢!
    • 我得到了它的工作,我没有正确包括快速 ngRepeat。感谢您的帮助和代码,祝您好运!
    【解决方案2】:

    试试 perch,它非常适合这个用例。

    https://grabaperch.com

    【讨论】:

    • 感谢您的回复,但我想我会先尝试免费的编码选项!但这肯定会在我的备份计划中!谢谢!
    • 还不错,免费 = 好 :)
    • 可以,只要“免费”是安全且私密的!
    猜你喜欢
    • 2014-11-01
    • 1970-01-01
    • 2010-10-17
    • 2015-03-20
    • 2011-02-09
    • 1970-01-01
    • 1970-01-01
    • 2011-07-01
    • 1970-01-01
    相关资源
    最近更新 更多