二、OrchardCore入門:1分鐘創(chuàng)建一個網(wǎng)站

Orchard Core目前的版本是1.0.0-beta3
https://github.com/OrchardCMS/OrchardCore
OrchardCore需要.net core框架支持,所以你需要安裝它,目前的版本是V2.2
https://dotnet.microsoft.com/download

  1. 新建一個空的Asp.net Core Web應(yīng)用程序


    image.png
image.png
  1. 通過NuGet管理包工具安裝OrchardCore.Application.Cms.Targets


    image.png

    Install-Package OrchardCore.Application.Cms.Targets -Version 1.0.0-rc1-10004

  2. 打開startup.cs注入服務(wù)
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddOrchardCms();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            //app.Run(async (context) =>
            //{
            //    await context.Response.WriteAsync("Hello World!");
            //});
            app.UseOrchardCore();
        }
  1. F5編譯,網(wǎng)站已經(jīng)跑起來了。


    配置基礎(chǔ)信息
  2. 本地化支持
    網(wǎng)站經(jīng)過簡單的設(shè)置已經(jīng)運行起來了,但是英文的-_-!!!
    https://crowdin.com/project/orchard-core下載本地化文件
    在你的項目/App_Data文件夾下,新建Localization文件夾,將下載的本地化文件*.po復(fù)制到這里。

    image.png

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容