-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplatedev1.html
More file actions
916 lines (379 loc) · 24.2 KB
/
templatedev1.html
File metadata and controls
916 lines (379 loc) · 24.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>模板开发目录结构 · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="gitbook/style.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="globalVariable.html" />
<link rel="prev" href="install.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="header">第一节 MRCMS介绍</li>
<li class="chapter " data-level="1.1" data-path="./">
<a href="./">
MRCMS 简介
</a>
</li>
<li class="chapter " data-level="1.2" data-path="features.html">
<a href="features.html">
MRCMS 特性
</a>
</li>
<li class="chapter " data-level="1.3" data-path="images.html">
<a href="images.html">
MRCMS 界面
</a>
</li>
<li class="chapter " data-level="1.4" data-path="history.html">
<a href="history.html">
MRCMS 历史
</a>
</li>
<li class="header">第二节 MRCMS安装</li>
<li class="chapter " data-level="2.1" data-path="deploying1.html">
<a href="deploying1.html">
快速体验
</a>
</li>
<li class="chapter " data-level="2.2" data-path="deploying2.html">
<a href="deploying2.html">
发布文件部署
</a>
</li>
<li class="chapter " data-level="2.3" data-path="deploying3.html">
<a href="deploying3.html">
源码部署
</a>
</li>
<li class="chapter " data-level="2.4" data-path="install.html">
<a href="install.html">
安装步骤
</a>
</li>
<li class="header">第三节 网站模板开发</li>
<li class="chapter active" data-level="3.1" data-path="templatedev1.html">
<a href="templatedev1.html">
模板开发目录结构
</a>
</li>
<li class="chapter " data-level="3.2" data-path="globalVariable.html">
<a href="globalVariable.html">
系统内置变量
</a>
</li>
<li class="chapter " data-level="3.3" >
<span>
数据内容模型
</span>
<ul class="articles">
<li class="chapter " data-level="3.3.1" data-path="article.html">
<a href="article.html">
文章内容模型
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.4" data-path="taglibs.html">
<a href="taglibs.html">
系统内置标签
</a>
<ul class="articles">
<li class="chapter " data-level="3.4.1" data-path="taglib01.html">
<a href="taglib01.html">
URL绝对路径标签
</a>
</li>
<li class="chapter " data-level="3.4.2" data-path="taglib02.html">
<a href="taglib02.html">
子栏目遍历标签
</a>
</li>
<li class="chapter " data-level="3.4.3" data-path="taglib03.html">
<a href="taglib03.html">
执行时间标签
</a>
</li>
<li class="chapter " data-level="3.4.4" data-path="taglib04.html">
<a href="taglib04.html">
时间格式化标签
</a>
</li>
<li class="chapter " data-level="3.4.5" data-path="taglib05.html">
<a href="taglib05.html">
条件判断标签
</a>
</li>
<li class="chapter " data-level="3.4.6" data-path="taglib06.html">
<a href="taglib06.html">
遍历集合标签
</a>
</li>
<li class="chapter " data-level="3.4.7" data-path="taglib07.html">
<a href="taglib07.html">
遍历栏目下的内容标签
</a>
</li>
<li class="chapter " data-level="3.4.8" data-path="taglib08.html">
<a href="taglib08.html">
插件调用标签
</a>
</li>
<li class="chapter " data-level="3.4.9" data-path="taglib09.html">
<a href="taglib09.html">
在线人数标签
</a>
</li>
<li class="chapter " data-level="3.4.10" data-path="taglib10.html">
<a href="taglib10.html">
执行SQL标签
</a>
</li>
<li class="chapter " data-level="3.4.11" data-path="taglib11.html">
<a href="taglib11.html">
字符串截取标签
</a>
</li>
<li class="chapter " data-level="3.4.12" data-path="taglib12.html">
<a href="taglib12.html">
URL重写标签
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.5" data-path="taglibh.html">
<a href="taglibh.html">
高级指令
</a>
<ul class="articles">
<li class="chapter " data-level="3.5.1" data-path="taglibh01.html">
<a href="taglibh01.html">
@Nav
</a>
</li>
<li class="chapter " data-level="3.5.2" data-path="taglibh02.html">
<a href="taglibh02.html">
@NavChild
</a>
</li>
<li class="chapter " data-level="3.5.3" data-path="taglibh03.html">
<a href="taglibh03.html">
@Boostrap3Nav
</a>
</li>
<li class="chapter " data-level="3.5.4" data-path="index2.html">
<a href="index2.html">
@JSONPaserDirective
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.6" data-path="extends.md">
<span>
扩展支持
</a>
<ul class="articles">
<li class="chapter " data-level="3.6.1" data-path="ext/extpage.html">
<a href="ext/extpage.html">
栏目分页查询数据
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.7" data-path="intenational.html">
<a href="intenational.html">
网站国际化
</a>
<ul class="articles">
<li class="chapter " data-level="3.7.1" data-path="intenational01.html">
<a href="intenational01.html">
国际化语言数据
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.8" data-path="index2.html">
<a href="index2.html">
模板优化
</a>
<ul class="articles">
<li class="chapter " data-level="3.8.1" data-path="seo.html">
<a href="seo.html">
SEO 关键字优化
</a>
</li>
<li class="chapter " data-level="3.8.2" data-path="static.html">
<a href="static.html">
页面静态化
</a>
</li>
<li class="chapter " data-level="3.8.3" data-path="gzip.html">
<a href="gzip.html">
Gzip代码压缩
</a>
</li>
</ul>
</li>
<li class="header">第四节 URL重写规则</li>
<li class="chapter " data-level="4.1" data-path="rules.html">
<a href="rules.html">
规则引擎介绍
</a>
</li>
<li class="header">第四节 插件</li>
<li class="chapter " data-level="5.1" data-path="index2.html">
<a href="index2.html">
留言插件模块
</a>
</li>
<li class="header">第四节 高级部署</li>
<li class="chapter " data-level="6.1" data-path="nginx.html">
<a href="nginx.html">
Nginx配置
</a>
</li>
<li class="chapter " data-level="6.2" data-path="index2.html">
<a href="index2.html">
Redis做Session存储
</a>
</li>
<li class="chapter " data-level="6.3" data-path="index2.html">
<a href="index2.html">
Docker部署
</a>
</li>
<li class="header">文档贡献者</li>
<li class="chapter " data-level="7.1" data-path="marker.html">
<a href="marker.html">
marker
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="." >模板开发目录结构</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="模板开发目录结构">模板开发目录结构</h1>
<p>以下的目录结构可以根据自己需要调整。</p>
<pre><code> MRCMS/
├── database/ 主题配套的数据库
├── themes/ 主题文件夹
├── common/ 所有主题模板的公共代码
├── flatweb/
├── images/ 存放主题固定的图片
├── js/ Javascript存放路径
├── css/ CSS样式表存放路径
├── demo.jpg 主题样例图
├── index.html 主页
├── config.groovy 主题配置信息
├── upload/ 建议配置文件上传路径。
</code></pre><h3 id="configgroovy-配置文件"><code>config.groovy</code> 配置文件</h3>
<p>主题 <code>config.groovy</code> 配置内容,该文件采用 <code>Groovy</code> 脚本定义,在后台选择模板时会读取配置文件内容,如果配置文件语言错误将导致主题功能不能正常使用。<code>groovy</code>语言更多信息参考官方网站。</p>
<pre><code>/** 模板配置文件 */
_config = [
icon: "demo.jpg",
name: "flatweb",
author: "marker"
];
</code></pre><h3 id="第一个模板页面文件">第一个模板页面文件</h3>
<p>首页页面文件,定义该文件需要在后台栏目管理新增一个栏目指向该文件。</p>
<pre><code><!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="${current.description!}">
<meta name="keywords" content="${current.keywords!}">
<meta name="author" content="marker">
<title>${current.name!}</title>
</head>
<body>
Hello MRCMS!
</body>
</html>
</code></pre><p>文件定义好后,进入后台配置主题路径,具体配置如下
<img src="_image/2018-08-12/2018-08-12-09-08-26.png" alt="">
<code>注意:这里需要根据您的开发路径决定。</code>
刷新后台界面后,进入主题设置,设置test主题,也就是当前我自己的模板项目。
<img src="_image/2018-08-12/2018-08-12-09-30-19.png" alt=""></p>
<p>配置首页栏目,将模板指向<code>index.html</code>
<img src="_image/2018-08-12/2018-08-12-09-32-37.png" alt=""></p>
<h3 id="访问hello-mrcms">访问Hello MRCMS</h3>
<p>访问首页输出<code>Hello MRCMS!</code>文字,这个是最简单的页面模板了,但包含了SEO信息。
<img src="_image/2018-08-12/2018-08-12-09-31-11.png" alt="">
这个时候只要改动模板,将输出最新的代码编译后的结果。</p>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="install.html" class="navigation navigation-prev " aria-label="Previous page: 安装步骤">
<i class="fa fa-angle-left"></i>
</a>
<a href="globalVariable.html" class="navigation navigation-next " aria-label="Next page: 系统内置变量">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"模板开发目录结构","level":"3.1","depth":1,"next":{"title":"系统内置变量","level":"3.2","depth":1,"path":"globalVariable.md","ref":"globalVariable.md","articles":[]},"previous":{"title":"安装步骤","level":"2.4","depth":1,"path":"install.md","ref":"install.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"templatedev1.md","mtime":"2018-08-12T01:34:21.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-04T01:50:53.778Z"},"basePath":".","book":{"language":""}});
});
</script>
</div>
<script src="gitbook/gitbook.js"></script>
<script src="gitbook/theme.js"></script>
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="gitbook/gitbook-plugin-search/search.js"></script>
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>