Source

o-blog / example / sample.org

Full commit
   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
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
#+TITLE: o-blog
#-DESCRIPTION: A stand-alone blogging system for Org-mode.
#+DATE: 2012-11-20 11:57:02

#+STARTUP: logdone

#-TEMPLATE_DIR: templates
#+URL: http://renard.github.com/o-blog

#+DEFAULT_CATEGORY: Tips
#+DISQUS: renard-o-blog
#+FILENAME_SANITIZER: ob-sanitize-string
#+POST_SORTER: ob-sort-posts-by-title

#+POST_BUILD_SHELL: cmd 1
#+POST_BUILD_SHELL: cmd 2
#+POST_BUILD_SHELL: cmd 3
#+POST_BUILD_SHELL: cmd 4


* Quick start Guide
  :PROPERTIES:
  :PAGE:     index.html
  :TEMPLATE: blog_static_no_title.html
  :END:

#+begin_o_blog_row 8

#+begin_o_blog_hero_unit
#+HTML: <h1>o-blog</h1>

A stand-alone blog and publication tool for [[http://orgmode.org/][Org-mode]].
#+end_o_blog_hero_unit

#+HTML: <h1 style="font-size: 500%;">Quick start guide</h1>

#+o_blog_row_column 4


#+HTML: <div class="hero-unit" style="font-size: 200%;">

[[file:{lisp}(ob:path-to-root){/lisp}/features.html][/icon-cog icon-white/ Features]]

[[https://github.com/renard/o-blog][/icon-github-sign icon-white/ Github]]

[[file:{lisp}(ob:path-to-root){/lisp}/testimonials.html][/icon-comments-alt icon-white/ Testimonials]]

[[file:{lisp}(ob:path-to-root){/lisp}/changelog.html][/icon-pencil icon-white/ Changelog]]

[[file:{lisp}(ob:path-to-root){/lisp}/bug-report.html][/icon-fire icon-white/ Bug report]]


#+HTML: </div>

#+end_o_blog_row


** Setup

First you need to install [[http://www.gnu.org/s/emacs][Emacs]] (tested with version 24, might work with 23)
and [[http://orgmode.org/][Org-mode]] (tested with version 7.8.09, other /might/ work as well). Then
you have 2 ways to install [[https://github.com/renard/o-blog][o-blog]].

#+begin_o_blog_row 5

#+HTML: <h4>Using el-get</h4>

If you are using [[https://github.com/dimitri/el-get][el-get]] it would be very easy to install. All you need to do
is to add =o-blog= to =el-get-sources= and type:

=M-x el-get-install o-blog=

If you are using =el-get= 4 or greater, you only need to type:

=M-x el-get-install o-blog=.

#+o_blog_row_column  6

#+HTML: <h4>Manual setup</h4>

Start by cloning the /git/ repository from [[http://github.com][Github]].

#+begin_src bash
cd ~/.emacs.d
git clone https://github.com/renard/o-blog.git
#+end_src

And add following to your =~/.emacs.d/init.el= file:

#+begin_src emacs-lisp
  (add-to-list 'load-path "~/.emacs.d/o-blog")
  (require 'o-blog)
#+end_src

#+end_o_blog_row


** Publish

Open the =~/.emacs.d/o-blog/example/sample.org= file and type =M-x
org-publish-blog=. The result site would be published by default in
=~/.emacs.d/o-blog/out=.

See the [[file:Tips/index.html][tips]] for more details.


* Blog details
** Copyright
  :PROPERTIES:
  :SNIPPET:  t
  :END:

Copyright © 2008-2012 [[mailto:seb%2520%E2%9D%A8%C9%91%C6%A6%C9%B5%CF%90%C9%91%CA%82%C9%9B%E2%9D%A9%2520chezwam%2520%E2%9D%A8%C6%A4%C9%B5%C9%A9%C9%B2%CA%88%E2%9D%A9%2520org][Sébastien Gross]]. Published under the therm of the
[[http://creativecommons.org/licenses/by-nc-sa/2.0/fr/][Creative Commons Attribution-Noncommercial-Share Alike 2.0 France License]].

** About
  :PROPERTIES:
  :SNIPPET:  t
  :END:

This is a sample blog to explain how [[https://github.com/renard/o-blog][o-blog]] works.

** Navigation
  :PROPERTIES:
  :SNIPPET:  t
  :END:

- [[file:{lisp}(ob:path-to-root){/lisp}/features.html][/icon-cog icon-white/ Features]]

- [[#][/icon-book icon-white/ Documentation]]
  - [[file:{lisp}(ob:path-to-root){/lisp}/templates.html][Templates]]
  - [[file:{lisp}(ob:path-to-root){/lisp}/structures.html][Structures]]
  - [[file:{lisp}(ob:path-to-root){/lisp}/functions.html][Functions]]
  - 
  - [[file:{lisp}(ob:path-to-root){/lisp}/faq.html][FAQ]]
  - 
  - [[file:{lisp}(ob:path-to-root){/lisp}/bug-report.html][Bug report]]

- [[#][/icon-file icon-white/ Tips]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 0))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 0)){/lisp}]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 1))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 1)){/lisp}]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 2))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 2)){/lisp}]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 3))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 3)){/lisp}]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 4))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 4)){/lisp}]]

- [[file:{lisp}(ob:path-to-root){/lisp}/tags.html][/icon-tags icon-white/ Tags]]

- [[file:{lisp}(ob:path-to-root){/lisp}/archives.html][/icon-list icon-white/ Archives]]

- [[file:{lisp}(ob:path-to-root){/lisp}/testimonials.html][/icon-comments-alt icon-white/ Testimonials]]

- [[file:{lisp}(ob:path-to-root){/lisp}/index.xml][/icon-rss icon-white/ RSS]]

- [[file:{lisp}(ob:path-to-root){/lisp}/changelog.html][/icon-pencil icon-white/ Changelog]]

- [[file:{lisp}(ob:path-to-root){/lisp}/roadmap.html][/icon-tasks icon-white/ Roadmap]]

- [[file:{lisp}(ob:path-to-root){/lisp}/debug.html][(debug)]]

** Navigation Footer
  :PROPERTIES:
  :SNIPPET:  t
  :END:

  - [[file:{lisp}(ob:path-to-root){/lisp}/index.html][/icon-home icon-white/ {lisp}(ob:gettext :home){/lisp}]]

  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips"))){/lisp}][/icon-file icon-white/ Tips]]

  - [[file:{lisp}(ob:path-to-root){/lisp}/tags.html][/icon-tags icon-white/ Tags]]

  - [[file:{lisp}(ob:path-to-root){/lisp}/archives.html][/icon-list icon-white/ Archives]]

  - [[file:{lisp}(ob:path-to-root){/lisp}/testimonials.html][/icon-comments-alt icon-white/ Testimonials]]

  - [[file:{lisp}(ob:path-to-root){/lisp}/roadmap.html][/icon-tasks icon-white/ Roadmap]]

  - [[file:{lisp}(ob:path-to-root){/lisp}/index.xml][/icon-rss icon-white/ RSS]]

** Articles by tags
  :PROPERTIES:
  :PAGE:     tags.html
  :TEMPLATE: blog_post-by-tags.html
  :END:


* Changelog
  :PROPERTIES:
  :PAGE:     changelog.html
  :END:

- 2012-06-21
  - Add a post-sorter option.

- 2012-06-05
  - Update to
    - Font-Awesome 2.0.0-6-g35fca03
    - bootstrap 2.0.4

- 2012-05-21
  - Use responsive bootstrap features.

- 2012-05-07
  - Update to:
    - less.js v1.0-547-ga2df119
  - Bootstrap widgets:
    - label
    - badge
    - progress bar
    - well
    - page header
    - hero unit

- 2012-05-04
  - Update to:
    - bootstrap v2.0.3-5-gb261f97.

- 2012-04-17
  - Update to:
    - less 1.3.0.
    - Font-Awesome v1.0.0-7-g563a6f3.
    - bootstrap v2.0.2-3-g6506ede.

- 2012-04-10
  - Add i18n support.

- 2012-04-06
  - Add org-mode CUSTOM\_ID.

- 2012-03-28
  - Add support for [[http://en.wikipedia.org/wiki/QR_code][QR-code]].

- 2012-03-20
  - Add [[http://disqus.com][Disqus]] support.
  - User can select the file name sanitizer function.
  - Add [[file:{lisp}(ob:path-to-root){/lisp}/bug-report.html][bug report howto]].

- 2012-03-06
  - Add support for Font-Awesome

- 2012-02-28
  - Switched to bootstrap 2.0.1
  - Switched to lesscss 1.2.2

- 2012-01-23
  - Change tag system from "Tags" to org tagging system.


* Documentation
** Debug
   :PROPERTIES:
   :PAGE:     debug.html
   :TEMPLATE: debug.html
   :SITEMAP:  f
   :END:


** Features
  :PROPERTIES:
  :PAGE:     features.html
  :END:

o-blog transforms the simple and powerful markup of Org-mode documents
to a full-featured, easily deployed web site, ready to serve online to
a wide range of devices.

- Appearance - modern, dynamic, and customizable:
  - Dynamic template system (using elisp functions) with [[file:{lisp}(ob:path-to-root){/lisp}/debug.html][nice debugging
    features]] and easy embedded [[file:{lisp}(ob:path-to-root){/lisp}/bug-report.html][bug report tool]]
  - Syntax highlighting for exported code snippets
  - [[http://twitter.github.com/bootstrap/][Bootstrap 2]] support
  - [[http://fortaweso.me/font-awesome/][Font-Awesome]] support
  - [[http://lesscss.org/][LESS CSS]] support
  - [[http://jquery.com/][jQuery]] support
  - HTML5 / CSS3 ready
  - Custom [[http://www.google.com/webfonts][Google web fonts]] support
  - [[http://twitter.github.com/bootstrap/scaffolding.html#responsive][Responsive design]] for many devices
- Blog - all the key features are here:
  - Static pages
  - [[file:{lisp}(ob:path-to-root){/lisp}/tags/index.html][Tag cloud]]
  - Multiple blogs
  - [[file:{lisp}(ob:path-to-root){/lisp}/archives.html][Archives]]
  - [[http://disqus.com][Disqus]] support
  - [[http://en.wikipedia.org/wiki/QR_code][QR code]] support
- Publication - fast and convenient:
  - Both synchronous and asynchronous publication
  - Publish directly to the webserver (using tramp)
- [[http://twitter.github.com/bootstrap/][Bootstrap]] flair and widgets:
  - Alert boxes
  - Icons ([[http://glyphicons.com/][glyphicons]]) support
  - Widgets such as labels, badges, progress bar, well, etc.

** Templates
  :PROPERTIES:
  :PAGE:     templates.html
  :END:

Templates, which are a big part of the [[https://github.com/renard/o-blog][o-blog]] export process, are
HTML-based files. Within templates, Lisp code can be interpreted as
long as =<lisp>= tags surrounds the code.

#+begin_src html
<h1><lisp>(ob:blog-title BLOG)</lisp></h1>
#+end_src

The above would be exported to something like:

#+begin_src html
<h1>o-blog</h1>
#+end_src

#+begin_o_blog_alert info Information
[[https://github.com/renard/o-blog][o-blog]] only needs =blog_= prefixed templates, as long as they do not need any
other templates (using =ob:insert-template= function).

All other templates are defined for convenience.
#+end_o_blog_alert


*** Required templates

=blog_= prefixed templates.

 - =blog_static.html=: Exports any static page (function =ob-write-static=).
 - =blog_post.html=: Exports a blog post (function =ob-write-posts=).
 - =blog_tags.html=: Exports a tag cloud page (function =ob-write-tags=).
 - =blog_tags-detail.html=: Exports page matching a specific tag (function
   =ob-write-tags=).
 - =blog_archive.html=: Exports the whole archives (all categories, all
   years, all months) page (function =ob-write-index=).
 - =blog_rss.html=: Exports the rss feed (function =ob-write-index=).
 - =blog_index_month.html= Export index page for a given month (function
   =ob-write-index=).
 - =blog_index_year.html= Export index page for a given year (function
   =ob-write-index=).
 - =blog_index_catery.html= Export index page for a given category (function
   =ob-write-index=).

*** Index-page templates

=index_= prefixed templates. They are used by all =blog_index_*.html=
templates to generate a list of articles matching given category, year and
month, and the entire archives.

 - =index_archives.html=
 - =index_category.html=
 - =index_month.html=
 - =index_year.html=

*** Navigation templates

=nav_= prefixed templates are used to generate navigation snippets:

 - =nav_links.html=: Used to generate navigation menu used in both the
   page header and footer.
 - =nav_tag-cloud.html=: Used to generate tag cloud on page bottom.

*** Page templates

=page_= prefixed templates used for both HTML header and footer.


** Structures
  :PROPERTIES:
  :PAGE:     structures.html
  :END:

Some variables are available when publishing lisp parts of templates. These
variables are defined using [[http://www.gnu.org/software/emacs/manual/html_node/cl/Structures.html][defstruct]], then any slot (or property) is
available using a =(type-slot variable)= form.

*** Structures

**** Structures: =ob:blog=

Structure used to define a blog:

 - =file=: The blog source file (read-only).
 - =buffer=: Buffer visiting the blog file (read-only).
 - =publish-dir=: Where to publish the blog, defined by the =#+PUBLISH_DIR:=
   header directive or =out= in the same directory as the blog source file.
 - =template-dir=: Location of the template directory defined by the
   =#+TEMPLATE_DIR:= header directive or the =templates= directory of the
   =o-blog= library.
 - =style-dir=: Path of the /css/ files defined by the =#STYLE_DIR:= header
   directive or =style=. This directory is relative to =template-dir=.
 - =posts-filter=: Default filter for posts defined by the =#POSTS_FILTER:=
   header directive or =+TODO={DONE}=.
 - =static-filter=: Default filter for static pages defined by the
   =#STATIC_FILTER:= header directive or =+PAGES={.*}=.
 - =snippet-filter=  Default filter for snippets defined by the
   =#SNIPPET_FILTER:= header directive or =+SNIPPET={.*}=.
 - =title=: Blog title defined by the =#+TITLE:= header directive.
 - =description=: Blog description defined by the =#+DESCRIPTION:= header
   directive.
 - =url=: Blog base URL defined by the =#+URL:= header.
 - =default-category=: Default category for posts defined by the
   =#DEFAULT_CATEGORY:= header or =Blog=.
 - =disqus=: The [[http://docs.disqus.com/developers/universal/][Disqus]] account (called a forum on [[http://disqus.com][Disqus]]) this o-blog
   site belongs to. Defined by the =#+DISQUS:= header.
 - =filename-sanitizer=: A 1-argument function to be used to sanitize
   post filenames. Defined by =#+FILENAME_SANITIZER:= or
   =ob-sanitize-string=.
 - =post-sorter=: A 2-argument function to be used to sort the
   posts. Defined by =#+POST_SORTER:= or =ob-sort-posts-by-date=.

Example:

#+begin_src emacs-lisp
;; get the title of the current blog defined in variable BLOG.
(ob:blog-title BLOG)
#+end_src

**** Structures: =ob:post=

 - =id=: The post's numerical id. Posts are sort by reversed chronological
   order. The most recent post get the id 0.
 - =title=: The post title, read from the entry title.
 - =timestamp=: The post timestamp given by the =CLOSED= property or the
   current time.
 - =year=: Numerical year computed from =timestamp=.
 - =month=: Numerical month computed from =timestamp=.
 - =day=: Numerical day computed from =timestamp=.
 - =category=: Category read from =CATEGORY= property org =blog=.
 - =tags=: List of =ob:tags=.
 - =template=: Template to use for current post read from =TEMPLATE=
   property or =blog_post.html=.
 - =filepath=: Relative path from the blog root directory to the post
   directory (directory only).
 - =filename=: Sanitized filename generated from =title=.
 - =htmlfile=: Full relative path to the post html file (file and
   directory).
 - =path-to-root=: Relative path from the post html file to the blog root.
 - =content=: Raw content of the post (Org-mode format).
 - =content-html=: HTML export of the post.

Example:

#+begin_src emacs-lisp
;; Get the HTML content of the post defined in variable POST.
(ob:post-content-html POST)
#+end_src

**** Structures: =ob:tags=

Structure used to define a tag:

 - =name=: The string defining the tag name.
 - =safe=: Web/URL-safe tag name.
 - =count=: How many times the tag is used across posts.
 - =size=: The font size in percent.

Example:

#+begin_src emacs-lisp
;; get the name of the tag defined in variable TAG.
(ob:tags-name TAG)
#+end_src

*** Variables

The following variables are always available when publishing a blog:

 - =BLOG= (=ob:blog=): Information about the blog being published.
 - =POSTS= (list of =ob:post=): List of all posts of the blog or restricted
   list of posts (depending on what is exported).
 - =ALL-POSTS=: A copy of =POSTS= except this *always* contains all the
   posts from the blog.
 - =STATIC= (list of =ob:post=): List of static pages.
 - =SNIPPETS= (list of =ob:post=): List of snippets pages.
 - =TAGS= (list of =ob:tags=): List of all tags.

Some variables may be defined in some functions:

 - =POST= (=ob:post=): The post (or static page) being currently published.
 - =TAG= (=ob:tags=): The tag being currently published.
 - =CATEGORY= (=string=): The category being published.
 - =YEAR=, =MONTH (=integer=): The year and month being published.
 - =PATH-TO-ROOT= (=string=): (internal use only, use =ob:path-to-root=
   instead) Path to blog root used by =ob:path-to-root=.

** Functions
  :PROPERTIES:
  :PAGE:     functions.html
  :END:

Basically any elisp function could be used within an o-blog template,
as long as they are known when exporting. Meanwhile some functions are
specifically made to be used within templates. These functions are
prefixed by =ob:=.

Descriptions are taken from function docstrings.

*** Function: =(ob:get-posts &optional PREDICATE COUNT SORTFUNC COLLECT)=

Return posts (from =POSTS= as defined in =org-publish-blog=) matching
=PREDICATE=. Limit to =COUNT= results if defined and sorted using
=SORTFUNC=.

=PREDICATE= is a function that runs for each post, with the post
itself as argument. If =PREDICATE= is nil, no filtering will be done
on posts.

=SORTFUNC= uses a =sort= =PREDICATE=.

If =COLLECT= is defined, only returns the =COLLECT= field of a
=ob:post= structure.

Examples:

Getting the last 10 posts:

#+begin_src emacs-lisp
   (ob:get-posts nil 10)
#+end_src


Getting posts from January 2012:

#+begin_src emacs-lisp
   (ob:get-posts
      (lambda (x)
         (and (= 2012 (ob:post-year x))
              (= 1 (ob:post-month x)))))
#+end_src

Getting all categories:

#+begin_src emacs-lisp
    (ob:get-posts nil nil nil 'category)
#+end_src


**** Template usages

For archive navigation:

#+begin_src html
  <nav id="archives">
    <h1>Archives</h1>
    <ul>
      <lisp>
        (loop for p in (ob:get-posts nil 10)
              do (insert (format "<li><a href=\"%s/%s\">%s</a></li> "
                                 (ob:path-to-root)
                                 (ob:post-htmlfile p)
                                 (ob:post-title p))))
      </lisp>
    </ul>
  </nav>
#+end_src

*** Function: =(ob:get-post-by-id ID)=

Return post whose id is =ID=.

**** Template usages

Posts navigation, setting up links to previous and next post:

#+begin_src html
  <nav class="articles-nav">
    <ul>
      <lisp>
        (progn
          ;; Get previous post
          (let ((ppost (ob:get-post-by-id (1+ (ob:post-id POST)))))
            (if ppost
                (insert (format "<li class=\"prev\"><a href=\"%s/%s\">%s</a></li>"
                                (ob:path-to-root)
                                (ob:post-htmlfile ppost)
                                (ob:post-title ppost)))
              (insert "<li>&nbsp;</li>")))
          ;; Get next post
          (let ((npost (ob:get-post-by-id (1- (ob:post-id POST)))))
            (if npost
                (insert (format "<li class=\"next\"><a href=\"%s/%s\">%s</a></li>"
                                (ob:path-to-root)
                                (ob:post-htmlfile npost)
                                (ob:post-title npost)))
              (insert "<li>&nbsp;</li>"))))
      </lisp>
    </ul>
  </nav>
#+end_src

*** Function: =(ob:get-snippet NAME)=

Get first snippet matching =NAME=.

**** Template usages

Insert the /About/ section in page footer:

#+begin_src html
  <h1>About</h1>
  <address>
    <lisp>(ob:post-content-html (ob:get-snippet "About"))</lisp>
  </address>
#+end_src

*** Function: =(ob:get-header HEADER &optional ALL)=

Get =HEADER= from blog buffer as defined in =BLOG= global context variable.

Returns only the first match, unless =ALL= is defined.

**** Template usages

Get the last updated header for RSS export:

#+begin_src html
  <updated><lisp>(ob:format-date (ob:get-header "DATE"))</lisp></updated>
#+end_src

*** Function: =(ob:insert-template TEMPLATE)=

Insert =TEMPLATE= in current buffer.

**** Template usages

Insert html header:

#+begin_src html
  <lisp>(ob:insert-template "page_header.html")</lisp>
#+end_src

*** Function: =(ob:format-date DATE &optional FORMAT LOCALE)=

Format =DATE= using =FORMAT= and =LOCALE=.

=DATE= can either be a string suitable for =parse-time-string= or a list of
integers using =current-time= format.

=FORMAT= is a =format-time-string= compatible definition. If not
set, ISO8601 =%Y-%m-%dT%TZ= format will be used.

**** Template usages

Add a human-readable timestamp for a post:

#+begin_src html
  Posted on <time datetime="<lisp> (ob:format-date (ob:post-timestamp POST)) </lisp>">
    <lisp> (ob:format-date (ob:post-timestamp POST) "%A %B, %d %Y at %H:%M:%S") </lisp>
  </time>.
#+end_src

** Bug report
  :PROPERTIES:
  :PAGE:     bug-report.html
  :END:

To report a bug please be sure your issue is =o-blog= related.

You can bootstrap a simple clean environment:

#+begin_src sh
rm -rf ~/dev/.emacs.d
mkdir -p ~/dev/.emacs.d
cd ~/dev/.emacs.d
git clone git://github.com/renard/o-blog.git
git clone git://orgmode.org/org-mode.git
#+end_src


Then launch =emacs=:

#+begin_src sh
  cd ~/dev
  rm -rf .emacs.d/o-blog/example/out
  emacs --debug-init -Q  -l .emacs.d/o-blog/sample-init.el --eval \
      '(progn (setq browse-url-generic-program "x-www-browser"
        browse-url-browser-function (quote browse-url-generic))
        (ob-build-sample))'
#+end_src

You can change =x-www-browser= to your favorite browser.

If everything runs fine emacs will exit normally. Otherwise a buffer
called =o-blog Bug-report= is created and its content is copied to
primary X selection (if available). This buffer contains useful
information for debugging your issue. A browser window will open to
the [[https://github.com/renard/o-blog/issues/new][o-blog new issue page]]. Then you can either paste content of the
=o-blog Bug-report= buffer, or use the X primary selection (middle
click).

Please describe as much as possible your issue (in English). Do not hesitate
to paste your blog file to https://gist.github.com/ as this might be useful in
debugging.



** Testimonials
  :PROPERTIES:
  :PAGE:     testimonials.html
  :TEMPLATE: blog_static_no_title.html
  :END:

#+begin_o_blog_row 6


#+HTML: <h1>Testimonials</h1>

#+begin_quote
/“o-blog, great static site generator from emacs Org-mode.”/

-- Pierre-Yves Ritschard [[https://twitter.com/pyr/status/160466727195521024][@pyr]] ([[http://openbds.org][OpenBSD]] relayd original author)

-- Sergey Konoplev [[http://twitter.com/gray_hemp][@gray\_hemp]] ([[http://PostgreSQL-Consulting.com][PostgreSQL Consultant]])

-- Olivier Berger [[http://twitter.com/olberger][@olberger]] ([[http://www.april.org][APRIL administrator]])

-- Dimitri Fontaine [[http://twitter.com/tapoueh][@tapoueh]] ([[http://tapoueh.org/projects.html][el-get and other]] author)

-- Julien Danjou [[http://twitter.com/juldanjou][@juldanjou]] ([[http://awesome.naquadah.org/][Awesome window manager]] and [[http://julien.danjou.info/software/][other]] author)

-- Daniel Farina [[http://twitter.com/danfarina][@danfarina]] (member of the [[http://www.heroku.com/][Heroku]] Department of Data)
#+end_quote

#+begin_quote
/“o-blog, a cool static blog generator from org-mode markup with some nice
Bootstrap integration.”/

-- [[http://from-the-cloud.com/en/Random/2012/06/17_sites-back.html][Fabián Ezequiel Gallina]]
#+end_quote

#+begin_quote
/“Thank you so much for the truly excellent elisp app. I am learning many
things from it.”/

-- [[https://github.com/priyadarshan][priyadarshan]]
#+end_quote

#+begin_quote
/“o-blog looks awesome!”/

-- [[https://github.com/djcb][Dirk-Jan C. Binnema]] (Author of [[http://www.djcbsoftware.nl/code/mu4e][mu4e]] and [[http://emacs-fu.blogspot.com][emacs-fu]])
#+end_quote

#+begin_quote
/“o-blog is amazing. After using Wordpress seemingly since the dawn of time, then Jekyll for a couple of years, this is like a spring breeze after a long, cold winter.”/

-- [[https://github.com/fravashi][Farasha Euker]]
#+end_quote



#+o_blog_row_column 6

#+begin_o_blog_hero_unit

#+HTML: <h1>They use it</h1>

- [[http://renard.github.com/o-blog][O-blog Project]]
- [[http://docs.chezwam.org][Mes doc à moi]]
- [[http://from-the-cloud.com/][From the cloud]]
- [[http://exaos.github.com/o-blog/][exaos]]
- [[http://mikio.github.com/index.html][Mikio Kun]]
- [[http://mimes.is/][Journal of the creative imagination]]
- [[http://www.djcbsoftware.nl][DJCB Software]]
- [[http://dimilar.com/de/index.html][Erlang Vision]]
- [[http://pharos-alexandria.github.com][Pharos (Annette von Stockhausen)]]

#+end_o_blog_hero_unit


#+begin_o_blog_hero_unit
If you do use o-blog, please [[https://github.com/renard/o-blog/issues/new][drop me a line]].
#+end_o_blog_hero_unit


#+end_o_blog_row


** Roadmap
  :PROPERTIES:
  :PAGE:     roadmap.html
  :END:

Here are some ideas for future versions

- Use other source engines such as
  - [[http://www.methods.co.nz/asciidoc/][AsciiDoc]]
  - [[http://mwolson.org/projects/EmacsMuse.html][Emacs Muse]]
  - etc...

- Find a other name for the project such as
  - Web Hypertext Otimized Rendering Easy System
  - Building the Interweb from Texts Classic Hypermedia
  - Build All Internet Standard E-documents
  - Publication Unifiée de Tous E-documents
  - el-site
  - el-sitemanage
  - el-sitepublish
  - el-sitepress

If you have any ideas please [[https://github.com/renard/o-blog/issues/new][drop me a line]].



** FAQ
  :PROPERTIES:
  :PAGE:     faq.html
  :END:

*** Why does my page look ugly/un-styled?

Maybe you are using [[https://www.google.com/chrome/][Google Chrome]] and you're trying to view your site
locally using a =file:///path/to/your/site/out/index.html= scheme.
Open the JavaScript console =Ctrl+Shift+I= and you should see
something like:

#+begin_example
XMLHttpRequest cannot load file:///path/to/your/site/out/out/style/css/o-blog.less. Cross origin requests are only supported for HTTP.
less-1.2.1.min.js:8Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101
#+end_example

If so, that is a known Chrome issue with loading local javascript
files, and is actually a /security feature/ in Chrome.

You can disable this with the =--allow-file-access-from-files= option
in Chrome, or you can use another browser like Firefox, or setup a
local webserver.

To use a local webserver, there are many complex solutions such as
[[http://nginx.org/][nginx]] or [[http://httpd.apache.org/][Apache]] or many [[http://en.wikipedia.org/wiki/Comparison_of_web_server_software][others]]. If you prefer a lighter and simpler
solution using Python, simply run:

#+begin_src sh
cd /path/to/your/site && python -m SimpleHTTPServer
#+end_src

...and browse http://localhost:8000

Or within Emacs you can run the [[https://github.com/jrhbailey/emacs-http-server][emacs-http-server]]:

#+begin_src emacs-lisp
(require 'httpd)
(setq httpd-root "/path/to/your/site")
(httpd-start)
#+end_src

...and browse http://localhost:8080

Another alternative would be the use of [[http://www.emacswiki.org/emacs/Elnode][elnode]] but it seems to be more
complex.


*** Why html pages are not minified?

HTML compression very tricky. Things can easily go wrong. Using a
[[http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/][GZip
compression]] would be more efficient.

Anyway if you still want to minify your pages, you can have a look to
[[http://code.google.com/p/htmlcompressor/][htmlcompressor]],
[[http://developer.yahoo.com/yui/compressor/][yuicompressor]] and
[[https://developers.google.com/closure/compiler/][Closure compiler]]. You
can also read Juriy Zaytsev's articles on
[[http://perfectionkills.com/optimizing-html/][optimizing HTML]] and
[[http://perfectionkills.com/experimenting-with-html-minifier/][experimenting
with html minifier]].

So here is the magic! Once your site is generated, you can run the following command:

#+BEGIN_SRC sh
htmlcompressor --compress-js --compress-css --recursive --mask '*.js;*.html;*.xml;*.css;*.less' -o /path/to/out/ /path/to/out
#+END_SRC


* Tips
** DONE Creating a blog					       :usage:o@blog:
  CLOSED: [2012-01-07 Sat 00:13]

In o-blog, a site is contained in a single Org-mode file specifying
both pages and a blog; in turn, the blog consists of Org-mode entries,
specifically, [[http://orgmode.org/manual/TODO-Items.html#TODO-Items][Org-mode TODO items]]. Each entry has a headline/title,
some properties and some text. Exporting a blog means publishing all
the entries of an Org-mode file (to their own HTML5 files) that are
=TODO= items marked =DONE=.

A minimal o-blog Org-mode file could look like:

#+begin_src org

  ,#+TITLE: Lorem ipsum
  ,#+DESCRIPTION: dolor sit amet
  ,#+DATE:

  ,#+STARTUP: logdone

  ,#+URL: http://blog.example.com

  ,* DONE Lorem ipsum
  ,  CLOSED: [2012-01-07 Sat 00:13]
  ,  :PROPERTIES:
  ,  :tags:     Lorem
  ,  :END:

  ,  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
  ,  tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt
  ,  et, mattis eget, convallis nec, purus. Cum sociis natoque penatibus et
  ,  magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec
  ,  vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan
  ,  nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

#+end_src

Please note the blank line between the properties section and the text itself.

Use =#+STARTUP: logdone= to automatically add a time stamp when closing an
entry.

** DONE How to use tags					       :usage:o@blog:
  CLOSED: [2012-01-07 Sat 00:28]

Tags are useful to classify o-blog articles/posts (but not for pages).
They are stored as [[http://orgmode.org/manual/Tags.html][Org-mode tags]] for each entry. To add or modify a
tag for a post, just use =C-c C-c= when on an Org-mode headline, and
enter the tag value.

If an article has more than one tag, separate them by a colon (=:=).

Special characters used in tags:

  - At sign (=@=) is converted to a dash (=-=).
  - Underscore (=_=) is converted to a blank (= =).

** DONE Example of some org syntax				  :usage:org:
   CLOSED: [2012-01-07 Sat 11:23]

*** Titles

This is a level 1

**** Level 2

This is a level 2


***** Level 3

This is a level 3

****** Level 4

This is a level 4

******* Level 5

This is a level 5

******** Level 6

This is a level 6


Up to 6 levels of indentation can be used.

*** Praragaphs

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

#+html: <div class="two-cols">

Nullam eu ante vel est convallis dignissim. Fusce suscipit, wisi nec
facilisis facilisis, est dui fermentum leo, quis tempor ligula erat quis
odio. Nunc porta vulputate tellus. Nunc rutrum turpis sed pede. Sed
bibendum. Aliquam posuere. Nunc aliquet, augue nec adipiscing interdum,
lacus tellus malesuada massa, quis varius mi purus non odio. Pellentesque
condimentum, magna ut suscipit hendrerit, ipsum augue ornare nulla, non
luctus diam neque sit amet urna. Curabitur vulputate vestibulum lorem. Fusce
sagittis, libero non molestie mollis, magna orci ultrices dolor, at
vulputate neque nulla lacinia eros. Sed id ligula quis est convallis
tempor. Curabitur lacinia pulvinar nibh. Nam a sapien.

Pellentesque dapibus suscipit ligula. Donec posuere augue in quam. Etiam vel
tortor sodales tellus ultricies commodo. Suspendisse potenti. Aenean in sem
ac leo mollis blandit. Donec neque quam, dignissim in, mollis nec, sagittis
eu, wisi. Phasellus lacus. Etiam laoreet quam sed arcu. Phasellus at dui in
ligula mollis ultricies. Integer placerat tristique nisl. Praesent
augue. Fusce commodo. Vestibulum convallis, lorem a tempus semper, dui dui
euismod elit, vitae placerat urna tortor vitae lacus. Nullam libero mauris,
consequat quis, varius et, dictum id, arcu. Mauris mollis tincidunt
felis. Aliquam feugiat tellus ut neque. Nulla facilisis, risus a rhoncus
fermentum, tellus tellus lacinia purus, et dictum nunc justo sit amet elit.

#+html: </div>


#+begin_verse
Great clouds overhead
Tiny black birds rise and fall
Snow covers Emacs

-- AlexSchroeder
#+end_verse

#+begin_quote
Everything should be made as simple as possible,
but not any simpler -- Albert Einstein
#+end_quote

#+BEGIN_CENTER
Everything should be made as simple as possible, \\
but not any simpler
#+END_CENTER

*** Lists

As taken from the Org-mode manual:

My favorite scenes are (in this order)
        1. The attack of the Rohirrim
        2. Eowyn's fight with the witch king
           + this was already my favorite scene in the book
           + I really like Miranda Otto.
        3. Peter Jackson being shot by Legolas
           - on DVD only
           He makes a really funny face when it happens.
But in the end, no individual scenes matter but the film as a whole.
Important actors in this film are:
        - Elijah Wood :: He plays Frodo
        - Sean Austin :: He plays Sam, Frodo's friend.  I still remember
          him very well from his role as Mikey Walsh in The Goonies.

*** Footnotes

The Org-mode homepage[fn:1] now looks a lot better than it used to.

[fn:1] The link is: http://orgmode.org

*** Emphasis and monospace

You can make words *bold*, /italic/, _underlined_, =code= and ~verbatim~,
and, if you must, ‘+strike-through+’. Text in the code and verbatim string
is not processed for Org-mode specific syntax; it is exported verbatim.

*** Horizontal rules

A line consisting of only dashes, and at least 5 of them, will be exported
as a horizontal line (‘<hr/>’ in HTML and \hrule in LaTeX).

------

As shown previously.

*** Comment lines

Lines starting with ‘#’ in column zero are treated as comments and will
never be exported. If you want an indented line to be treated as a comment,
start it with ‘#+ ’. Also, entire subtrees starting with the word ‘COMMENT’
will never be exported. Finally, regions surrounded by ‘#+BEGIN\_COMMENT’
... ‘#+END\_COMMENT’ will not be exported.

#+begin_comment
C-c ;
Toggle the COMMENT keyword at the beginning of an entry.
#+end_comment

*** Images and Tables

Table

#+CAPTION: This is the caption for the next table (or link)
#+LABEL:   tbl:basic-data
|----------+----------+----------+----------+----------------------------------------------------------------------|
| Header 1 | Header 2 | Header 3 | Header 4 | Header 5                                                             |
|----------+----------+----------+----------+----------------------------------------------------------------------|
|      1.1 |      1.2 |      1.3 | X        | This /cell/ has a *very* =long= ~line~ _with_  _{special} ^{layouts} |
|      2.1 |      2.2 |      3.3 | Y        |                                                                      |
|----------+----------+----------+----------+----------------------------------------------------------------------|
|      3.1 |      3.1 |      C.1 | D.1      | E.1                                                                  |
|----------+----------+----------+----------+----------------------------------------------------------------------|


Image

#+CAPTION: This is the caption for the next figure link (or table)
#+LABEL:   fig:SED-HR4049
[[file:200px-Org-mode-unicorn.svg.png][file:org-mode-unicorn.png]]

*** Literal examples

#+BEGIN_EXAMPLE
Some example from a text file.
#+END_EXAMPLE


Here is an example
        : Some example from a text file.

#+BEGIN_SRC emacs-lisp
  (defun org-xor (a b)
    "Exclusive or."
    (if a (not b) b))
#+END_SRC

#+BEGIN_SRC emacs-lisp -n -r
  (save-excursion                  (ref:sc)
     (goto-char (point-min)))       (ref:jump)
#+END_SRC

In line [[(sc)]] we remember the current position.  [[(jump)][Line (jump)]]
jumps to point-min.

*** Special symbols

Angles are written as Greek letters \alpha, \beta and \gamma.

*** Subscripts and superscripts

The mass of the sun is M_sun = 1.989 x 10^30 kg.  The radius of
the sun is R_{sun} = 6.96 x 10^8 m.

*** links

- outsite (page): [[https://github.com/renard/o-blog][/o-blog/ home]].
- [[Creating a blog]]
- insite (file): [[file:o-blog.el]]
- in page (anchor): [[Literal examples]]
** DONE Some HTML5 samples					     :html_5:
   CLOSED: [2012-01-10 Tue 20:58]

*** tag: <details>

This tag works only with the Chrome browser.

#+HTML: <details>
#+HTML: <summary>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</summary>
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
- Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.
- Sed diam.
- Nam vestibulum accumsan nisl.
#+HTML: </details>

#+begin_src org
  ,#+HTML: <details>
  ,#+HTML: <summary>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</summary>
  ,- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  ,- Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.
  ,- Sed diam.
  ,- Nam vestibulum accumsan nisl.
  ,#+HTML: </details>
#+end_src

** DONE Alerts 							      :usage:
   CLOSED: [2012-01-15 Sun 20:40]

Alerts are declared in =o_blog_alert= blocks. There are 4 types of
them:

 - info
 - success
 - warning
 - error

#+begin_src org
  ,#+begin_o_blog_alert <TYPE> <title>
  ,Text of the alert
  ,#+end_o_blog_alert
#+end_src


#+begin_o_blog_alert error

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

#+end_o_blog_alert


#+begin_o_blog_alert error Danger

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

#+end_o_blog_alert

#+begin_o_blog_alert warning Caution

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

#+end_o_blog_alert



#+begin_o_blog_alert success Tip

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

#+end_o_blog_alert

#+begin_o_blog_alert info Information

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

#+end_o_blog_alert

** DONE Using modal source code				    :usage:Bootstrap:
   CLOSED: [2012-02-09 Thu 23:13]

The [[http://twitter.github.com/bootstrap/javascript.html#modals][Modal]] bootstrap script can be used to display the content of an external
file in a modal window. The magic line is:

#+begin_src org
  ,#+O_BLOG_SOURCE: path/to/file [mode]
#+end_src

The /org template shorcut/ is =<os= =TAB=. Two parameters might be used:
- The mandatory =/path/to/file= which is the path to the file from which
  content should be read.
- The optional =mode= parameter, which can be determined if omitted.

Here is an example of the =sample-init.el= file:

#+o_blog_source ../sample-init.el emacs-lisp

** DONE Adding icons					    :usage:Bootstrap:
   CLOSED: [2012-02-10 Fri 00:19]

Icons from [[http://glyphicons.com/][glyphicons]] are supported, by simply naming the icon using
italics style forward-slashes:

#+begin_o_blog_row 6


*Source example*

#+begin_src org
  ,/icon-calendar/ calendar
#+end_src

#+o_blog_row_column 6

*Rendered output*

/icon-calendar/ calendar

#+end_o_blog_row



Icons can also be used for the top /navbar/ using something like:

#+begin_o_blog_row 6

*Source example*

#+begin_src org

  ,- [[#][/icon-book icon-white/ Documentation]]
  ,  - [[file:{lisp}(ob:path-to-root){/lisp}/templates.html][Templates]]
  ,  - [[file:{lisp}(ob:path-to-root){/lisp}/structures.html][Structures]]
  ,  - [[file:{lisp}(ob:path-to-root){/lisp}/functions.html][Functions]]
  ,  -
  ,  - [[file:{lisp}(ob:path-to-root){/lisp}/faq.html][FAQ]]

  ,- [[#][/icon-file icon-white/ Blog]]
  ,  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 0))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 0)){/lisp}]]
  ,  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 1))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 1)){/lisp}]]
  ,  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 2))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 2)){/lisp}]]
  ,  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 3))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 3)){/lisp}]]
  ,  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 4))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 4)){/lisp}]]

  ,- [[file:{lisp}(ob:path-to-root){/lisp}/tags/index.html][/icon-tags icon-white/ Tags]]

#+end_src

#+o_blog_row_column 6

*Rendered output*


#+begin_html
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<div class="nav-collapse">
#+end_html

- [[#][/icon-book icon-white/ Documentation]]
  - [[file:{lisp}(ob:path-to-root){/lisp}/templates.html][Templates]]
  - [[file:{lisp}(ob:path-to-root){/lisp}/structures.html][Structures]]
  - [[file:{lisp}(ob:path-to-root){/lisp}/functions.html][Functions]]
  -
  - [[file:{lisp}(ob:path-to-root){/lisp}/faq.html][FAQ]]

- [[#][/icon-file icon-white/ Blog]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 0))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 0)){/lisp}]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 1))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 1)){/lisp}]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 2))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 2)){/lisp}]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 3))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 3)){/lisp}]]
  - [[file:{lisp}(format "%s/%s" (ob:path-to-root) (ob:post-htmlfile (ob:get-last-post "Tips" 4))){/lisp}][{lisp}(ob:post-title (ob:get-last-post "Tips" 4)){/lisp}]]

- [[file:{lisp}(ob:path-to-root){/lisp}/tags/index.html][/icon-tags icon-white/ Tags]]

#+begin_html
</div>
</div>
</div>
</div>
#+end_html

Please note the blank line between menu items. If blanks are omitted, the
rendered result might be damaged.

#+end_o_blog_row



** DONE Using Bootstrap grid				    :usage:Bootstrap:
   CLOSED: [2012-02-10 Fri 01:19]

[[http://twitter.github.com/bootstrap/scaffolding.html][Bootstrap scaffolding]] can be defined using both =#+begin_o_blog_row= and
=#+end_o_blog_row= directives (or =<og= =TAB= shortcut). A new column can
be started using =#+o_blog_row_column= single directive (or =<ogr= =TAB=
shortcut).


#+begin_o_blog_row 6 0 show-grid
*Example*

#+begin_src org
  ,#+begin_o_blog_row 2 -1 show-grid
  ,Column 1
  ,#+o_blog_row_column 2
  ,Column 2
  ,#+end_o_blog_row
#+end_src


#+o_blog_row_column 6

*Output*

#+begin_o_blog_row 2 -1 show-grid

Column 1

#+o_blog_row_column 2

Column 2

#+end_o_blog_row

#+end_o_blog_row


The syntax is:

#+begin_src org
  ,#+begin_o_blog_row SPAN OFFSET GRID-CLASS
  ,Column 1
  ,#+o_blog_row_column SPAN OFFSET
  ,Column 2
  ,...
  ,#+o_blog_row_column SPAN OFFSET
  ,Column n
  ,#+end_o_blog_row

#+end_src

** DONE Some Bootstrap features                            :usage:Bootstrap:
   CLOSED: [2012-05-03 Thu 21:40]

*** Hero-unit

#+begin_o_blog_row 7

#+BEGIN_SRC org
  ,#+begin_o_blog_hero_unit
  ,#+HTML: <h1>Heading</h1>

  , tagline

  ,#+BEGIN_HTML
  ,    <a class="btn btn-primary btn-large">
  ,      Learn more
  ,    </a>
  ,#+END_HTML
  ,#+end_o_blog_hero_unit
#+END_SRC

#+o_blog_row_column 4

#+begin_o_blog_hero_unit

#+HTML: <h1>Heading</h1>

tagline

#+BEGIN_HTML
    <a class="btn btn-primary btn-large">
      Learn more
    </a>
#+END_HTML
#+end_o_blog_hero_unit

#+end_o_blog_row

*** Page header

#+begin_o_blog_row 7

#+BEGIN_SRC org
  ,#+begin_o_blog_page_header
  ,#+HTML: <h1>Page header</h1>
  ,Some text
  ,#+end_o_blog_page_header
#+END_SRC

#+o_blog_row_column 4

#+begin_o_blog_page_header
#+HTML: <h1>Page header</h1>
Some text
#+end_o_blog_page_header

#+end_o_blog_row

*** Using labels

    Label and annotate text using a =label:TYPE= link prefix where =TYPE= is
    one of =default=, =success=, =warning=, =important=, =info= or
    =reverse=. The URL part of the link is used as the label text.

#+begin_o_blog_row 7

#+BEGIN_SRC txt
   [[ob-label:default][Default]]
   [[ob-label:success][Success]]
   [[ob-label:warning][Warning]]
   [[ob-label:important][Important]]
   [[ob-label:info][Info]]
   [[ob-label:inverse][Inverse]]
#+END_SRC

#+o_blog_row_column 4
   - [[ob-label:default][Default]]
   - [[ob-label:success][Success]]
   - [[ob-label:warning][Warning]]
   - [[ob-label:important][Important]]
   - [[ob-label:info][Info]]
   - [[ob-label:inverse][Inverse]]
#+end_o_blog_row

*** Using badges

    Indicators and unread counts as for labels. Use the =badge:TYPE= link
    prefix.

#+begin_o_blog_row 7

#+BEGIN_SRC  text
   [[ob-badge:default][Default]]
   [[ob-badge:success][Success]]
   [[ob-badge:warning][Warning]]
   [[ob-badge:important][Important]]
   [[ob-badge:info][Info]]
   [[ob-badge:inverse][Inverse]]
#+END_SRC

#+o_blog_row_column 4
   - [[ob-badge:default][Default]]
   - [[ob-badge:success][Success]]
   - [[ob-badge:warning][Warning]]
   - [[ob-badge:important][Important]]
   - [[ob-badge:info][Info]]
   - [[ob-badge:inverse][Inverse]]
#+end_o_blog_row

*** Using progress bars

    For loading, redirecting, or action status. Use a =progress:TYPE= link
    where =TYPE= is one of =info=, =success=, =warning= or
    =danger=. Additional classes (=striped= or =active=) can be added using comma.
    The URL is the progress percent.

#+begin_o_blog_row 7

#+BEGIN_SRC  text
    [[ob-progress:info][25]]
    [[ob-progress:success,striped][50]]
    [[ob-progress:warning,striped,active][75]]
    [[ob-progress:danger][100]]
#+END_SRC

#+o_blog_row_column 4
    [[ob-progress:info][25]]
    [[ob-progress:success,striped][50]]
    [[ob-progress:warning,striped,active][75]]
    [[ob-progress:danger][100]]
#+end_o_blog_row


*** Well

Use the well as a simple effect on an element to give it an inset effect.

#+begin_o_blog_row 7

#+BEGIN_SRC  text
 , #+begin_o_blog_well
 , Look, I'm in a well!
 , #+end_o_blog_well
#+END_SRC

#+o_blog_row_column 4


#+begin_o_blog_well
Look, I'm in a well!
#+end_o_blog_well

#+end_o_blog_row

** DONE Add a custom font			     :usage:Bootstrap:o@blog:
   CLOSED: [2012-05-07 Mon 16:38]

[[http://www.google.com/webfonts][Google webfonts]] can be easily used in o-blog in 2 different ways: using
the Google API, or by providing resources in the =templates/style= directory.

#+begin_o_blog_alert warning Caution
Using many font styles can slow down your webpage, so only select the font
styles that you actually need on your webpage.
#+end_o_blog_alert

Both examples below use the [[http://www.yanone.de/typedesign/kaffeesatz/][Yanone Kaffeesatz]] font.

*** Using Google API

The [[http://www.google.com/webfonts#QuickUsePlace:quickUse/Family:][quick use]] provides an import snippet such as:

#+BEGIN_SRC css
@import url("http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,200,300,700&subset=latin,latin-ext");
#+END_SRC

That line should be included into the
=templates/style/less/o-blog-default.less= file in which you should also add
something like:

#+BEGIN_SRC css
h1, h2, h3, h4, h5, h6 {
    font-family: "Yanone Kaffeesatz", sans-serif;
}
#+END_SRC

And that's it.

*** Providing resources

That is less efficient in terms of network resources but provides a good
alternative for offline publications.


The script =get-font= does all needed jobs.

#+O_BLOG_SOURCE: ../get-font sh

You can run:

#+BEGIN_SRC sh
./get-font 'http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,200,300,700&subset=latin,latin-ext'
#+END_SRC

And add the font declaration in =templates/style/less/o-blog-default.less=:

#+BEGIN_SRC css
@import "font-Yanone-Kaffeesatz.less";
#+END_SRC

Finally, declare its use as in the Google API version:

#+BEGIN_SRC css
h1, h2, h3, h4, h5, h6 {
    font-family: "Yanone Kaffeesatz", sans-serif;
}
#+END_SRC
** DONE Create static pages			     :usage:Bootstrap:o@blog:
   CLOSED: [2012-05-21 Mon 12:48]

#+begin_o_blog_row 7


Static pages are create exactly like blog pages. The only thing you need to
add is a =PAGE= property. The exported path is relative to =#+PUBLISH_DIR:=.

You can also specify a custom template for your static page by adding a
=TEMPLATE= property. The template path is relative to =#+TEMPLATE_DIR:=.

#+o_blog_row_column 4

#+BEGIN_SRC org
  ,* Static page
  ,   :PROPERTIES:
  ,   :PAGE:     path/to/static/page.html
  ,   :TEMPLATE: static-page.html
  ,   :END:
#+END_SRC

#+end_o_blog_row
** DONE Adding an image into a post			       :usage:o@blog:
   CLOSED: [2012-08-21 Tue 10:43]


#+begin_o_blog_row 8

Adding an image to a post is simple since [[http://orgmode.org][Org-mode]] offers a special
link scheme for that. An image file can be stored anywhere in your
local directory structure with a valid path. During the export
process, the image file is copied into a folder related to the post,
and all exported links are corrected to point to its new location.


#+begin_o_blog_row 5

For example, the Org-mode markup of =file:emacs-logo.png= surrounded
by [[http://orgmode.org/org.html#Link-format][double square brackets]] will result (upon export/publishing) in
copying that image from its current location (in the same directory as
this sample.org file) to its target location of
=tips/2012/08/21_adding-an-image-into-a-post/emacs-logo.png=.

#+o_blog_row_column 3

#+BEGIN_SRC org
# NOTE: double square brackets should surround file:emacs-logo.png but are not shown:
file:emacs-logo.png
#+END_SRC

#+end_o_blog_row


#+o_blog_row_column 4
[[file:emacs-logo.png]]

#+end_o_blog_row


The exported HTML result will resemble:

#+BEGIN_SRC html
 <img src="21_adding-an-image-into-a-post/emacs-logo.png"  alt="21_adding-an-image-into-a-post/emacs-logo.png" />
#+END_SRC



To keep files organized, you can place all files under a subfolder,
e.g. =media/=. Then you can create a sub-folder for each post, such
as:
- =/media/post1/file1=
- =/media/post1/file2=
- =/media/post2/file=
- etc.