Statirator Documentation

Similar documents
Socrates Documentation

Djam Documentation. Release Participatory Culture Foundation

django-dajaxice Documentation

django-session-security Documentation

django_podcasting Documentation

django-selenium Documentation

django-intercom Documentation

Aldryn Installer Documentation

SYMFONY2 WEB FRAMEWORK

django-fluent-dashboard Documentation

Django Map Widgets Documentation

Django Wordpress API Documentation

django-ad-code Documentation

Tomasz Szumlak WFiIS AGH 23/10/2017, Kraków

Quoting Wikipedia, software

cmsplugin-blog Release post 0 Øyvind Saltvik

django-konfera Documentation

Technology modeling. Ralf Lämmel Software Languages Team University of Koblenz-Landau

Tangent MicroServices Documentation

django-dajax Documentation

Django Phantom Theme Documentation

Web logs (blogs. blogs) Feed support BLOGS) WEB LOGS (BLOGS

Django-frontend-notification Documentation

django-private-chat Documentation

Learn how to login to Sitefinity and what possible errors you can get if you do not have proper permissions.

django-avatar Documentation

wagtailmenus Documentation

django-avatar Documentation

Pulp Python Support Documentation

djangotribune Documentation

Blogger Frequently Asked Questions

Django File Picker Documentation

Django starting guide

django-baton Documentation

Brunch Documentation. Release Brunch team

django-slim Documentation

wagtailmenus Documentation

Django IPRestrict Documentation

Easy-select2 Documentation

Spade Documentation. Release 0.1. Sam Liu

Getting started with Convertigo Mobilizer

yawrap Documentation Release Michal Kaczmarczyk

Building a Django Twilio Programmable Chat Application

Reminders. Full Django products are due next Thursday! CS370, Günay (Emory) Spring / 6

CMS Pages. Overview. The top menu- The side page menu-

Django PAM Documentation

Ninja Typers Web Application Design Document By Marvin Farrell C

my6docs Documentation

Package radix. September 17, 2018

webkitpony Documentation

How to use playframework 2.0 Documentation

Django QR Code Documentation

Blog Pro for Magento 2 User Guide

The Django Web Framework Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013

Diving into Big Data Workshop

Get feedback by using Voice of the Customer surveys Install the Voice of the Customer solution Plan a survey Design a basic survey Distribute a

Unifer Documentation. Release V1.0. Matthew S

django-scaffold Documentation

DJOAuth2 Documentation

django-model-report Documentation

django-inplaceedit Documentation

The RestructuredText Book Documentation

With Google documents, you can easily create, share, and edit documents online.

Standard 1 The student will author web pages using the HyperText Markup Language (HTML)

Qlik Deployment Framework

staff Documentation Release 1.2

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

django-baton Documentation

Django Mail Queue Documentation

HPCI CMS for Information Sharing User Manual Ver. 1

Insert/Edit Image. Overview

django-embed-video Documentation

DjNRO Release September 30, 2014

Django Leaflet Documentation

django-app-metrics Documentation

Index A Access data formats, 215 exporting data from, to SharePoint, forms and reports changing table used by form, 213 creating, cont

django-reinhardt Documentation

Webdev: Building Django Apps. Ryan Fox Andrew Glassman MKE Python

django-osm-field Release 0.3.1

LFC - Lightning Fast CMS Documentation

docs-python2readthedocs Documentation

Realistic 3D FlipBook Experience. for Magazines, Photographers, Portfolios, Brochures, Catalogs, Manuals, Publishing and more...

django-embed-video Documentation

django-precise-bbcode Documentation

Django Test Utils Documentation

For more info on Cloud9 see their documentation:

Backend Web Frameworks

AtomGen Documentation

Bishop Blanchet Intranet Documentation

CSCI 1320 Creating Modern Web Applications. Content Management Systems

SagePay payment gateway package for django-oscar Documentation

Quick Desktop Application Development Using Electron

mongodb-tornado-angular Documentation

Pluggable Patterns. For Reusable Django Applications

Manual Html Image Src Url Path Not Working

Django File Picker Documentation

Django Groups Manager Documentation

django-sticky-uploads Documentation

Classroom Blogging. Training wiki:

appendix Introduction to Foundation, the front-end framework

Transcription:

Statirator Documentation Release 0.2.0 Meir Kriheli June 21, 2014

Contents 1 Reason 3 2 Source Code 5 2.1 Quick Start................................................ 5 2.2 Modus operandi............................................. 9 3 Indices and tables 11 i

ii

Multilingual static site and blog generator. Contents 1

2 Contents

CHAPTER 1 Reason Needed good multilingual static site generator, which enables: Blog post in restructuredtext Single resource (file) for all the translations of that post or page Explicitly specifying slug for various non-latin links in addition to posts (e.g: Tag names, pages, etc.) Separate RSS feeds for each language and each tag/language Keeps reference between the translations Optional Multi-domain support - One for each language (TODO) Translated elements in pages No need to reinvent the wheel: Many know Django, we can reuse the knowledge Make use of reusable apps Hack around i18n bits of Django. Use Django s Internationalization and localization 3

4 Chapter 1. Reason

CHAPTER 2 Source Code For the project from GitHub: https://github.com/meirkriheli/statirator Contents: 2.1 Quick Start 2.1.1 Installation TODO 2.1.2 Initialize The Site Once installed, use the statirator init command to initialize the site. The command reference: Usage: statirator init [options] [directory] Init the static site project Options: -t TITLE, --title=title Site title [Default: "Default site"] -d DOMAIN, --domain=domain Domain name [Default: "example.com"] -l LANGUAGES, --languages=languages Supported languages. [Default: "he,en"] -z TIMEZONE, --timezone=timezone Time Zone. [Default: "America/Chicago"] Let s init the site: statirator init example.com This will create example.com directory and the default site skeleton based on html5 boilerplate: $ tree example.com/ example.com/ -- blog -- README -- conf -- init.py 5

-- settings.py -- urls.py -- locale -- README -- manage.py -- pages -- index.html -- static -- crossdomain.xml -- css -- main.css -- normalize.css -- normalize_rtl.css -- favicon.ico -- humans.txt -- img -- apple-touch-icon-114x114-precomposed.png -- apple-touch-icon-144x144-precomposed.png -- apple-touch-icon-57x57-precomposed.png -- apple-touch-icon-72x72-precomposed.png -- apple-touch-icon.png -- apple-touch-icon-precomposed.png -- js -- main.js -- plugins.js -- vendor -- jquery-1.8.0.min.js -- modernizr-2.6.1.min.js -- robots.txt -- templates -- README 10 directories, 25 files Notable directories and files: blog: posts location conf: The django project s settings and url patterns. manage.py: Django s manage.py. Will be used from now on. pages: Site s pages (non blog posts, e,g: about us). static: Static media files. The files under that directory will be copied as is. templates: Used override the default templates by placing them here. 2.1.3 Create a Blog Post Use the create_post management command. reference: Usage:./manage.py create_post [options] <english title or slug> Create a new rst blog post Options: -d, --draft Is is a draft (unpublished)? [Default: "False"] 6 Chapter 2. Source Code

So for example: $./manage.py create_post "Welcome to my blog" Created post blog/welcome-to-my-blog.rst Will create a stub for that blog post: $ ls -1 blog/ README welcome-to-my-blog.rst 2.1.4 Default Post Structure Here s the content of the post: :slug: welcome-to-my-blog :draft: 0 :datetime: 2012-09-22 19:16:45.. -- ============================================================= Welcome to my blog ============================================================= :lang: en :tags: Tag 1 tag-1, Tag 2 tag-2 English content goes here.. -- ============================================================= ============================================================= :lang: he :tags: 1 tag-1, 2 tag-2 This is valid restructuredtext document. The content sections are separated with.. comment by restructuredtext). Metadata is specified with fields. The 1st section is generic metadata for the post. -- (which is interpreted as Following sections are one per language (lang is mandatory). As you can see, the tags are comma separated and each specifies a tag name and it s slug, separated by. After the metadata for each language comes the content. 2.1.5 Generate the Static Site To generate the static site run the generate command. The will create the static site in the BUILD_DIR directory (default: build). Example run: [example.com]$./manage.py generate Syncing in memory db 2.1. Quick Start 7

-------------------- Creating tables... Creating table django_content_type Creating table django_site Creating table taggit_tag Creating table taggit_taggeditem Creating table blog_i18ntag Creating table blog_i18ntaggeditem Creating table blog_post Creating table pages_page Installing custom SQL... Installing indexes... Reading resource ---------------- Processing /home/meir/devel/projects/meirkriheli/example.com/blog/welcome-to-my-blog.rst Processing /home/meir/devel/projects/meirkriheli/example.com/pages/index.html Generating static pages ----------------------- Skipping app conf... (No renderers.py ) Skipping app django.contrib.contenttypes... (No renderers.py ) Skipping app django.contrib.sites... (No renderers.py ) Skipping app django.contrib.staticfiles... (No renderers.py ) Skipping app taggit... (No renderers.py ) Skipping app disqus... (No renderers.py ) Skipping app statirator.core... (No renderers.py ) Found renderers for statirator.blog... Found renderers for statirator.pages... example.com/build/en/2012/09/welcome-to-my-blog/index.html example.com/build/en/archive/index.html example.com/build/en/blog.rss example.com/build/2012/09/welcome-to-my-blog/index.html example.com/build/archive/index.html example.com/build/blog.rss example.com/build/en/tags/tag-1/index.html example.com/build/en/tags/tag-2/index.html example.com/build/en/tags/tag-1/tag.rss example.com/build/en/tags/tag-2/tag.rss example.com/build/en/tags/index.html example.com/build/tags/tag-1/index.html example.com/build/tags/tag-2/index.html example.com/build/tags/tag-1/tag.rss example.com/build/tags/tag-2/tag.rss example.com/build/tags/index.html example.com/build/en/index.html example.com/build/index.html Collecting static media ----------------------- example.com/static/crossdomain.xml example.com/static/humans.txt example.com/static/robots.txt example.com/static/favicon.ico example.com/static/img/apple-touch-icon-precomposed.png example.com/static/img/apple-touch-icon-114x114-precomposed.png example.com/static/img/apple-touch-icon-57x57-precomposed.png 8 Chapter 2. Source Code

example.com/static/img/apple-touch-icon.png example.com/static/img/apple-touch-icon-144x144-precomposed.png example.com/static/img/apple-touch-icon-72x72-precomposed.png example.com/static/js/main.js example.com/static/js/plugins.js example.com/static/js/vendor/jquery-1.8.0.min.js example.com/static/js/vendor/modernizr-2.6.1.min.js example.com/static/css/normalize.css example.com/static/css/main.css example.com/static/css/normalize_rtl.css 17 static files copied. 2.1.6 Serving the static site Run the command:./manage.py serve To run and auto regenrate, run:./manage.py serve -g 2.2 Modus operandi 2.2.1 Init The init command creates the basic project using a custom project template. settings.py and urls.py are under conf dir. 2.2.2 Generating the site The following steps are done when generating the site Sync in memory db Create the site enrty for the Sites app. Read the resources (posts, pages) into the db using Readers. Generate the static pages for those (and other) resources with Renderes. Copy the static media to the build directory. 2.2.3 Readers 2.2.4 Renderes 2.2.5 Static media 2.2. Modus operandi 9

10 Chapter 2. Source Code

CHAPTER 3 Indices and tables genindex modindex search 11