中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

公司網(wǎng)站制作企業(yè)建站平臺哪個比較權(quán)威

公司網(wǎng)站制作企業(yè),建站平臺哪個比較權(quán)威,wordpress設(shè)置會員時效,云盤建設(shè)網(wǎng)站go-bindata - embed結(jié)合嵌入靜態(tài)文件打包可執(zhí)行二進制文件 ## embed 嵌入靜態(tài)文件到可執(zhí)行二進制文件 # 安裝go-bindata go get -u github.com/jteeuwen/go-bindata/... # 打包靜態(tài)文件 go-bindata web/... 執(zhí)行次命令之后會在項目目錄下生成bindata.go文件,示例命令中模板文…

go-bindata - embed結(jié)合嵌入靜態(tài)文件打包可執(zhí)行二進制文件

## embed 嵌入靜態(tài)文件到可執(zhí)行二進制文件
# 安裝go-bindata

go get -u github.com/jteeuwen/go-bindata/...



# 打包靜態(tài)文件

go-bindata web/...


執(zhí)行次命令之后會在項目目錄下生成bindata.go文件,示例命令中模板文件都在項目的web目錄下

# 使用embed注冊模板示例文檔

https://github.com/kataras/iris/blob/main/_examples/view/embedding-templates-into-app/main.go

https://github.com/kataras/iris/blob/main/_examples/view/embedding-templates-into-app/main.go



示例代碼:

package mainimport (
"embed"
"github.com/kataras/iris/v12"
)//go:embed embedded/*
var embeddedFS embed.FSfunc main() {
app := iris.New()tmpl := iris.HTML(embeddedFS, ".html").RootDir("embedded/templates")tmpl.Layout("layouts/layout.html")
tmpl.AddFunc("greet", func(s string) string {
return "Greetings " + s + "!"
})app.RegisterView(tmpl)app.Get("/", func(ctx iris.Context) {
if err := ctx.View("page1.html"); err != nil {
ctx.HTML("<h3>%s</h3>", err.Error())
return
}
})// remove the layout for a specific route
app.Get("/nolayout", func(ctx iris.Context) {
ctx.ViewLayout(iris.NoLayout)
if err := ctx.View("page1.html"); err != nil {
ctx.HTML("<h3>%s</h3>", err.Error())
return
}
})// set a layout for a party, .Layout should be BEFORE any Get or other Handle party's method
my := app.Party("/my").Layout("layouts/mylayout.html")
{ // both of these will use the layouts/mylayout.html as their layout.
my.Get("/", func(ctx iris.Context) {
if err := ctx.View("page1.html"); err != nil {
ctx.HTML("<h3>%s</h3>", err.Error())
return
}
})
my.Get("/other", func(ctx iris.Context) {
if err := ctx.View("page1.html"); err != nil {
ctx.HTML("<h3>%s</h3>", err.Error())
return
}
})
}// http://localhost:8080
// http://localhost:8080/nolayout
// http://localhost:8080/my
// http://localhost:8080/my/other
app.Listen(":8080")
}

http://www.risenshineclean.com/news/6091.html

相關(guān)文章:

  • 中交建設(shè)集團 網(wǎng)站營銷型網(wǎng)站有哪些功能
  • 做3dmax的網(wǎng)站國內(nèi)搜索引擎排名第一
  • 網(wǎng)站服務(wù)器有哪些類型有哪些類型有哪些類型有哪些類型百度推廣一年大概需要多少錢
  • 蘭州做網(wǎng)站哪家專業(yè)株洲專業(yè)seo優(yōu)化
  • 做網(wǎng)站大圖片東莞關(guān)鍵詞排名推廣
  • html編輯器哪個軟件好用網(wǎng)站優(yōu)化的方法
  • 蘇州做公司郵箱企業(yè)網(wǎng)站營銷網(wǎng)站做的好的公司
  • 慶祝網(wǎng)站上線banner圖片外貿(mào)推廣公司
  • 我想做個網(wǎng)站百度收錄的網(wǎng)站
  • 游戲網(wǎng)站seo怎么做深圳哪里有網(wǎng)絡(luò)推廣渠避
  • 邢臺網(wǎng)站建設(shè)免費做網(wǎng)站排名吸引人的微信軟文
  • 網(wǎng)站開發(fā)用什么開發(fā)工具好呢東莞整站優(yōu)化推廣公司找火速
  • 用dw做php網(wǎng)站北京seo服務(wù)銷售
  • 贛州大余做網(wǎng)站建設(shè)官方進一步優(yōu)化
  • 哪有做網(wǎng)站的seo排名快速
  • 做網(wǎng)站怎么掙錢成人培訓班有哪些課程
  • 臺州北京網(wǎng)站建設(shè)seo公司是做什么的
  • 深圳高端網(wǎng)站建設(shè)公司seo網(wǎng)絡(luò)推廣教程
  • 品牌策劃網(wǎng)站推薦搜索引擎 磁力吧
  • 尋找設(shè)計師的網(wǎng)站長春網(wǎng)站優(yōu)化流程
  • 網(wǎng)站建設(shè)基本教程免費寫文案神器
  • seo如何提高排名seo自然排名優(yōu)化
  • 中山 網(wǎng)站建設(shè)昆明網(wǎng)站seo服務(wù)
  • 自己怎樣做公司廣告視頻網(wǎng)站百度網(wǎng)站推廣價格
  • 建設(shè)網(wǎng)站需要提供什么資料seo每日
  • c語言 做網(wǎng)站seo優(yōu)化標題
  • 網(wǎng)站建設(shè)發(fā)展方向國外獨立網(wǎng)站如何建站
  • 鎮(zhèn)江門戶網(wǎng)泰安seo排名
  • 如何做棋牌網(wǎng)站長春剛剛最新消息今天
  • 平臺網(wǎng)站做等級保護測評優(yōu)化網(wǎng)站建設(shè)