Giter Site home page Giter Site logo

asciidoc-blog's Introduction

Creating a blog using Asciidoc and Hugo

This repo contains source materials to accompany the article on opensource.com for getting started with Hugo and asciidoc as a web development platform.

Demo Website
Figure 1. The server

Installing Asciidoc and Asciidoctor.

Ubuntu

Asciidoc is available in the default repos.

sudo apt-get install asciidoc asciidoctor -y
Fedora

Asciidoctor can be installed using the gem command. Asciidoc is installed through the standard repos.

yum install asciidoc
gem install asciidoctor

For more detailed installation information, visit the following guides.

Installation Guides

Installing Hugo

The best guide for installing Hugo is on their website. I found it was worth following this guide rather than use the package maintained in the Ubuntu repo as it was older and caused problems with modern themes.

How do I use these files?

The repo contains a demo website with some sample articles in Asciidoc. The following folders are useful starting points.

Clone the repo
git clone [email protected]:opensourceway/asciidoc-blog.git
Folders Overview
Figure 2. Folder Structure

For more information, checkout the documentation on the Hugo Homepage

Starting the server

From the root directory of the cloned repo:

hugo server  --buildDrafts

This will run the server where you can see your website locally on http://localhost:1313.

Server Window
Figure 3. The server

To make changes to the setup, you can edit the config.toml file and set your website preferences up. The site contains initial setup parameters.

Content is available under the folder content/post. There are some example articles available to get you started.

Working with Asciidoc

My personal preference is to use Vim for working with Asciidoc, there are a number of plugins which make working with Asciidoc easier as well as a syntax file for highlighting your document.

If you are looking for something more visual, I would recommend the Atom editor from GitHub. It has plugins which provide a real-time preview of your work and makes it easier to work with GitHub. Using Hugo, Asciidoc and the Atom editor, you have a complete publishing system with real time previews and a local server to run validation against.

Atom Editor with preview plugin
Figure 4. Atom Editor, click for full screen

Where to go from here?

You can tailor the site in the config.toml file to personalise your setup. There are a number of themes available to further customise your site. The language behind the more dynamic elements is very well implemented and there’s excellent documentation on the Hugo website on how to get started working with content and theming. The theme used in this demo is the Strata Theme by Digitalcraftsman which has detailed documentation on configuration options available on it’s github page.

Thanks and credit due.

Thanks to Steve Francia for Hugo, for producing a fun platform to play with. The Strata theme port and the Hugo community.

Demo and source materials

asciidoc-blog's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.