/wp-pdf

This repo provides a Makefile and setup instructions to easily deploy/create WordPress pages and corresponding pdf versions based on AsciiDoc text files alone. The Demo Case at http://asciidoc.the-huck.com uses the AsciiDoc userguide itself. See announcement at https://groups.google.com/d/topic/asciidoc/Sio9vxclWkY/discussion

Primary LanguageShell

wp-pdf

  • WordPress / asciidoc / blogpost / a2x / docbook / latex / pdf

  • using asciidoc userguide.txt as content example

setup wordpress

  • setup site in Linode VPS:
    http://library.linode.com/hosting-website#sph_configuring-name-based-virtual-hosts

  • create mysql database on Linode VPS:
    http://library.linode.com/hosting-website#sph_creating-a-database

  • install Wordpress:
    http://library.linode.com/web-applications/cms-guides/wordpress

  • add the following to wp-config.php (replace accordingly)

    ```
    // forces the filesystem method: "direct", "ssh", "ftpext", or "ftpsockets"
    define('FS_METHOD', 'direct');
    // absolute path to root installation directory
    define('FTP_BASE', '/home/patrick/public/asciidoc.the-huck.com/public/');
    // absolute path to "wp-content" directory
    define('FTP_CONTENT_DIR', '/home/patrick/public/asciidoc.the-huck.com/public/wp-content/');
    // absolute path to "wp-plugins" directory
    define('FTP_PLUGIN_DIR ', '/home/patrick/public/asciidoc.the-huck.com/public/wp-content/plugins/');
    // absolute path to your SSH public key
    define('FTP_PUBKEY', '/home/patrick/.ssh/<your-key>.pub');
    // absolute path to your SSH private key
    define('FTP_PRIVKEY', '/home/patrick/.ssh/<your-key>');
    // either your FTP or SSH username
    define('FTP_USER', '<username>');
    // hostname:port combo for your SSH/FTP server
    define('FTP_HOST', 'the-huck.com');
    ```
  • $ sudo chown -R www-data:www-data public/

  • install Foghorn theme, adjust Appearance → Theme Options

  • install the following wordpress plugins:

    • Options Framework

    • Disable Comments

    • CMS Page Order

    • Multi-level Navigation Plugin

    • WP Google Fonts (I use Gentium Book Basic)

    • WP PHP widget

    • MathJax-Latex (change options: Force Load, Use wp-latex syntax?, Use MathJax CDN Service?)

  • set up Sidebar in Appearance→Widgets:

    • Search

    • Section Index

    • PHP Widget w/ the following code:

      -------------------
      next page: <?php echo next_page_not_post('%title','expand','sort_column=menu_order'); ?><br>
      previous page: <?php echo previous_page_not_post(' %title','expand','sort_column=menu_order'); ?>
      --------------------
  • go to Settings→Permalinks and use post name as URL

  • after you pushed your front page, go to Settings→Reading and choose it as static front page

install blogpost

The official README and source code of blogpost can be found at http://srackham.wordpress.com/blogpost1/ and https://code.google.com/p/blogpost/. I implemented two changes on top of version 0.9.5:

  1. allow more than the 10 last most recent posts/pages to show up in info

  2. fix inline-latex via the config macro
    http://www.mail-archive.com/asciidoc@googlegroups.com/msg00104.html

Clone it from https://github.com/tschaume/blogpost and see the note at the top of README for install instructions.

prepare for deployment

in your working dir (see Makefile):

  • adjust docinfo.xml

  • if you’ll be including images, create a symbolic link named images linking to your image directory (adjust SYMLINK in Makefile)

  • and/or adjust Makefile

use Makefile for hp, pdf & latex

let wp-pdf do the magic by: make, make pdf, make hp, make latex, make out/Introduction/Introduction.txt, make clean

after publishing a page for the first time: use Pages→Page Order to arrange pages