diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d16296 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +public/ +*.pyc diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..710a519 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +build: + script: + - virtualenv venv + - source venv/bin/activate + - pip install -r requirements.txt + - patch venv/lib/python3.5/site-packages/pelican/readers.py -i patch/pelican_readers.patch + - make publish + - rm -rf /var/www/webapp_doohoyi/nosignal.hopto.org_site/ci/losttr + - cp -r public /var/www/webapp_doohoyi/nosignal.hopto.org_site/ci/losttr + - deactivate + artifacts: + paths: + - public diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9ecdbb5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 GitLab Pages examples + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c429437 --- /dev/null +++ b/Makefile @@ -0,0 +1,75 @@ +PY?=python3 +PELICAN?=pelican +PELICANOPTS= + +BASEDIR=$(CURDIR) +INPUTDIR=$(BASEDIR)/content +OUTPUTDIR=$(CURDIR)/public +CONFFILE=$(BASEDIR)/pelicanconf.py +PUBLISHCONF=$(BASEDIR)/publishconf.py + + +DEBUG ?= 0 +ifeq ($(DEBUG), 1) + PELICANOPTS += -D +endif + +RELATIVE ?= 0 +ifeq ($(RELATIVE), 1) + PELICANOPTS += --relative-urls +endif + +help: + @echo 'Makefile for a pelican Web site ' + @echo ' ' + @echo 'Usage: ' + @echo ' make html (re)generate the web site ' + @echo ' make clean remove the generated files ' + @echo ' make regenerate regenerate files upon modification ' + @echo ' make publish generate using production settings ' + @echo ' make serve [PORT=8000] serve site at http://localhost:8000' + @echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 ' + @echo ' make devserver [PORT=8000] serve and regenerate together ' + @echo ' make ssh_upload upload the web site via SSH ' + @echo ' make rsync_upload upload the web site via rsync+ssh ' + @echo ' ' + @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html ' + @echo 'Set the RELATIVE variable to 1 to enable relative urls ' + @echo ' ' + +html: + $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) + +clean: + [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR) + +regenerate: + $(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) + +serve: +ifdef PORT + $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) +else + $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) +endif + +serve-global: +ifdef SERVER + $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b $(SERVER) +else + $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b 0.0.0.0 +endif + + +devserver: +ifdef PORT + $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) +else + $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) +endif + +publish: + $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS) + + +.PHONY: html help clean regenerate serve serve-global devserver publish diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b7b719 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Example [Pelican] website using GitLab server, 'nosignal.hopto.org/gitlab' + +- located +- Check the resulting website here: +- utilizing 'SparkleShare' for real-time sync. +- CI powered by server-side gitlab-runner ! + +## patch applied + +- if there is no 'title' in '.rst' file, FILENAME_METADATA = '(?P\.*)' doesn't work! +- it works fine with '.md' files --> https://github.com/getpelican/pelican/issues/2107#issuecomment-363388649 +- but, it doesn't work with '.rst' files. +- that's because metadata being merged with a default 'title' which is empty if you don't give one in the document! +- so, if 'title' is empty, then do not add the default. that is meaningless. +- look into : patch/pelican_readers.patch diff --git a/SparkleShare.txt b/SparkleShare.txt deleted file mode 100644 index c098f89..0000000 --- a/SparkleShare.txt +++ /dev/null @@ -1,9 +0,0 @@ -Congratulations, you've successfully created a SparkleShare repository! - -Any files you add or change in this folder will be automatically synced to -ssh://git@nosignal.hopto.org/doohoyi/lost-train.git and everyone connected to it. - -SparkleShare is an Open Source software program that helps people collaborate and -share files. If you like what we do, consider buying us a beer: http://www.sparkleshare.org/ - -Have fun! :) diff --git a/content/posts/notes/20200421T223234+0900_(.).rst b/content/posts/notes/20200421T223234+0900_(.).rst new file mode 100644 index 0000000..49a520c --- /dev/null +++ b/content/posts/notes/20200421T223234+0900_(.).rst @@ -0,0 +1,3 @@ +gitlab-ci + sparkleshare + python + pelican + emacs / atom + +새로운 시작. diff --git a/content/posts/notes/20200422T014819+0900_(.).rst b/content/posts/notes/20200422T014819+0900_(.).rst new file mode 100644 index 0000000..b67cc3a --- /dev/null +++ b/content/posts/notes/20200422T014819+0900_(.).rst @@ -0,0 +1 @@ +kiki diff --git a/patch/pelican_readers.patch b/patch/pelican_readers.patch new file mode 100644 index 0000000..32e0949 --- /dev/null +++ b/patch/pelican_readers.patch @@ -0,0 +1,6 @@ +294c294,296 +< metadata.setdefault('title', parts.get('title')) +--- +> title = parts.get('title') +> if title: +> metadata.setdefault('title', parts.get('title')) diff --git a/pelicanconf.py b/pelicanconf.py new file mode 100644 index 0000000..e60d2e4 --- /dev/null +++ b/pelicanconf.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # +from __future__ import unicode_literals + +AUTHOR = 'D' +SITENAME = 'lost/tr' +SITEURL = 'https://nosignal.hopto.org/site/ci/losttr' + +PATH = 'content' +OUTPUT_PATH = 'public' + +TIMEZONE = 'Asia/Seoul' + +DEFAULT_LANG = 'en' +DEFAULT_DATE = 'fs' +#20200421T223234+0900_(testt).rst +FILENAME_METADATA = r'(?P\d{8}T\d{6}\+\d{4})_\((?P.*)\).*' +SLUGIFY_SOURCE = 'basename' + +# Feed generation is usually not desired when developing +FEED_ALL_ATOM = None +CATEGORY_FEED_ATOM = None +TRANSLATION_FEED_ATOM = None +AUTHOR_FEED_ATOM = None +AUTHOR_FEED_RSS = None + +# Blogroll +LINKS = (('Pelican', 'http://getpelican.com/'), + ('Python.org', 'http://python.org/'), + ('Jinja2', 'http://jinja.pocoo.org/'), + ('You can modify those links in your config file', '#'),) + +# Social widget +SOCIAL = (('You can add links in your config file', '#'), + ('Another social link', '#'),) + +DEFAULT_PAGINATION = 5 + +# Uncomment following line if you want document-relative URLs when developing +#RELATIVE_URLS = True + +# PLUGINS +PLUGIN_PATHS = ['/home/admin/pelican-plugins'] +PLUGINS = ['assets'] + +# THEME (customizing) +THEME = "./theme" + +# THEME / bulrush +# import bulrush +# THEME = bulrush.PATH +# JINJA_ENVIRONMENT = bulrush.ENVIRONMENT +# JINJA_FILTERS = bulrush.FILTERS + +# THEME + +# THEME = "/home/admin/pelican-themes/dev-random" # Responsive ! +# THEME = "/home/admin/pelican-themes/dev-random2" # Responsive ! +# THEME = "/home/admin/pelican-themes/pelican-cait" # Responsive ! + +# THEME = "/home/admin/pelican-themes/mnmlist" # NOT-responsive ! +# THEME = "/home/admin/pelican-themes/basic" # NOT-responsive ! +# THEME = "/home/admin/pelican-themes/nmnlist" # NOT-responsive ! +# THEME = "/home/admin/pelican-themes/monospace" # NOT-responsive ! +# THEME = "/home/admin/pelican-themes/jesuislibre" # NOT-responsive ! +# THEME = "/home/admin/pelican-themes/blue-penguin" # NOT-responsive ! + +# THEME = "/home/admin/pelican-themes/crowsfoot" # unstable? + +# THEME = "/home/admin/pelican-themes/eevee" # DOESN'T WORK, AS IS. +# THEME = "/home/admin/pelican-themes/twenty-html5up" # DOESN'T WORK, AS IS. diff --git a/publishconf.py b/publishconf.py new file mode 100644 index 0000000..02f4580 --- /dev/null +++ b/publishconf.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # +from __future__ import unicode_literals + +# This file is only used if you use `make publish` or +# explicitly specify it as your config file. + +import os +import sys +sys.path.append(os.curdir) +from pelicanconf import * + +SITEURL = '/site/ci/losttr' +RELATIVE_URLS = False + +FEED_ALL_ATOM = 'feeds/all.atom.xml' +CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' + +DELETE_OUTPUT_DIRECTORY = True + +# Following items are often useful when publishing + +#DISQUS_SITENAME = "" +#GOOGLE_ANALYTICS = "" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e04112b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +pelican ~= 4.1.0 +markdown +typogrify +bulrush +pathlib +virtualenv diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..354b554 --- /dev/null +++ b/tasks.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- + +import os +import shutil +import sys +import datetime + +from invoke import task +from invoke.util import cd +from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer +from pelican.settings import DEFAULT_CONFIG, get_settings_from_file + +SETTINGS_FILE_BASE = 'pelicanconf.py' +SETTINGS = {} +SETTINGS.update(DEFAULT_CONFIG) +LOCAL_SETTINGS = get_settings_from_file(SETTINGS_FILE_BASE) +SETTINGS.update(LOCAL_SETTINGS) + +CONFIG = { + 'settings_base': SETTINGS_FILE_BASE, + 'settings_publish': 'publishconf.py', + # Output path. Can be absolute or relative to tasks.py. Default: 'output' + 'deploy_path': SETTINGS['OUTPUT_PATH'], + # Port for `serve` + 'port': 8000, +} + +@task +def clean(c): + """Remove generated files""" + if os.path.isdir(CONFIG['deploy_path']): + shutil.rmtree(CONFIG['deploy_path']) + os.makedirs(CONFIG['deploy_path']) + +@task +def build(c): + """Build local version of site""" + c.run('pelican -s {settings_base}'.format(**CONFIG)) + +@task +def rebuild(c): + """`build` with the delete switch""" + c.run('pelican -d -s {settings_base}'.format(**CONFIG)) + +@task +def regenerate(c): + """Automatically regenerate site upon file modification""" + c.run('pelican -r -s {settings_base}'.format(**CONFIG)) + +@task +def serve(c): + """Serve site at http://localhost:$PORT/ (default port is 8000)""" + + class AddressReuseTCPServer(RootedHTTPServer): + allow_reuse_address = True + + server = AddressReuseTCPServer( + CONFIG['deploy_path'], + ('', CONFIG['port']), + ComplexHTTPRequestHandler) + + sys.stderr.write('Serving on port {port} ...\n'.format(**CONFIG)) + server.serve_forever() + +@task +def reserve(c): + """`build`, then `serve`""" + build(c) + serve(c) + +@task +def preview(c): + """Build production version of site""" + c.run('pelican -s {settings_publish}'.format(**CONFIG)) + +@task +def livereload(c): + """Automatically reload browser tab upon file modification.""" + from livereload import Server + build(c) + server = Server() + # Watch the base settings file + server.watch(CONFIG['settings_base'], lambda: build(c)) + # Watch content source files + content_file_extensions = ['.md', '.rst'] + for extension in content_file_extensions: + content_blob = '{0}/**/*{1}'.format(SETTINGS['PATH'], extension) + server.watch(content_blob, lambda: build(c)) + # Watch the theme's templates and static assets + theme_path = SETTINGS['THEME'] + server.watch('{}/templates/*.html'.format(theme_path), lambda: build(c)) + static_file_extensions = ['.css', '.js'] + for extension in static_file_extensions: + static_file = '{0}/static/**/*{1}'.format(theme_path, extension) + server.watch(static_file, lambda: build(c)) + # Serve output path on configured port + server.serve(port=CONFIG['port'], root=CONFIG['deploy_path']) + + +@task +def publish(c): + """Publish to production via rsync""" + c.run('pelican -s {settings_publish}'.format(**CONFIG)) + c.run( + 'rsync --delete --exclude ".DS_Store" -pthrvz -c ' + '{} {production}:{dest_path}'.format( + CONFIG['deploy_path'].rstrip('/') + '/', + **CONFIG)) + diff --git a/theme/LICENSE b/theme/LICENSE new file mode 100644 index 0000000..fc0f07a --- /dev/null +++ b/theme/LICENSE @@ -0,0 +1,13 @@ +DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +Version 2, December 2004 + +Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> + +Everyone is permitted to copy and distribute verbatim or modified +copies of this license document, and changing it is allowed as long +as the name is changed. + +DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/theme/README.md b/theme/README.md new file mode 100644 index 0000000..e23abb9 --- /dev/null +++ b/theme/README.md @@ -0,0 +1,18 @@ +Monospace +========== + +Theme adapted from [Monospace for Wordpress](http://wordpress.org/themes/monospace) +Here is a screenshot for your viewing pleasure: + +![screengrab](screenshot.png) + +If you are using Markdown, you need to include the following option in your settings file to enable syntax highlighting. + + MD_EXTENSIONS = ['codehilite(css_class=codehilite code)'] + +Also, you might want to include the `DESCRIPTION` option (it appears in the left sidebar): + + DESCRIPTION = 'My blog and stuff ...' + +Nice and simple, +Enjoy! diff --git a/theme/screenshot.png b/theme/screenshot.png new file mode 100644 index 0000000..bdcd139 Binary files /dev/null and b/theme/screenshot.png differ diff --git a/theme/static/css/main.css b/theme/static/css/main.css new file mode 100644 index 0000000..14f2e43 --- /dev/null +++ b/theme/static/css/main.css @@ -0,0 +1,107 @@ +/** + * Theme Name: Monospace + * Theme URI: http://vinicius.soylocoporti.org.br/monospace-wordpress-theme + * Description: A clean, extra-light, easy, objective, image free and 80 columns monospaced content theme. Made for code, manuals and e-mail publishing. Good for programming blogs, planets and posting by mail. + * Author: Vinicius Massuchetto + * Author URI: http://vinicius.soylocoporti.org.br + * Version: 1.91 + * Tags: white, blue, two-columns, fixed-width, threaded-comments, translation-ready + * License: GNU General Public License v2.0 + * License URI: http://www.gnu.org/licenses/gpl-2.0.html + */ + +@import url("pygment.css"); + +body { margin:0px; padding:20px 0px; text-align:center; font-family:Monospace; color:#585858; } +a, a:visited { text-decoration:none; color:rgb(17, 170, 34); } +a:hover { color:#FFF; background-color:#5353CB } +h1, h2, h3, h4, h5, h6, h7 { margin:0px; text-transform:uppercase; } +h4, h5, h6 { font-size:14px; } +h1 { padding:0px 0px 15px; margin:0px 0px 15px 0px; } +blockquote { font-style:italic; background:#EAEAEA; margin:20px; padding:5px 10px; } +blockquote cite { display:block; padding:10px 20px 0 0; text-align:right; } +input, textarea { padding:5px; border:1px solid #8A8A8A; background:#EAEAEA; } +input:hover, textarea:hover, blockquote:hover { background:#E5E5E5; } + +#wrap { margin:0px auto; text-align:left; font-size: 13px; line-height: 1.4; } +#container { float:right; } +#sidebar { overflow:hidden; clear:left; text-align:right; width:250px; height:auto; padding:0px 15px 0px 0px; border-right:1px dotted #C8C8C8; } +#sidebar li { list-style-type:none; } +#sidebar > li { margin:20px 0px; } +#sidebar h1 { border-bottom:1px dotted #C8C8C8; } +#sidebar .description { display:block; width:100%; height:auto; margin:0px 0px 10px 0px; } + +ul.sub-menu, ul.children { margin:0px 10px 0px 0px; } + +.post { margin:0px 0px 30px 0px; padding:0px 0px 30px 0px; border-bottom:1px dotted #C8C8C8; } +.post-edit-link { clear:both; } +.meta { margin:10px; padding:15px; background:#EAEAEA; clear:both; } +.meta span { display:block; clear:left; } +.thumbnail { margin:0px; padding:0px; } +.thumbnail img { float:right; } + +.entry { font-size: 14px; line-height: 20px; } +.entry h2, h3, h4, h5 { margin:30px 0px 10px 0px; } +.entry img { display:block; border:1px solid #BDBDBD !important; } +.entry img.wp-smiley { border:0px !important; } +.entry a img:hover { background-color:transparent; border:1px solid #E5E5E5 !important; } +.entry .aligncenter, div.aligncenter { margin:10px auto; } +.entry .alignleft { float: left; margin:10px 15px 10px 0px; } +.entry .alignright { float: right; margin:10px 0px 10px 15px; } +.entry .alignnone { margin:10px 0px; } +.entry .gallery, .wp-caption { text-align:center; background:#EAEAEA; margin:10px; padding:10px; border:0px; max-width:520px; height:auto; } +.entry .wp-caption img { border:0 none; margin:0px auto; padding:0; max-width:500px; height:auto; } +.entry .gallery:hover, .wp-caption:hover { background:#E5E5E5; } +.entry .gallery-caption, .wp-caption-text { background:transparent; } +.entry .wp-caption p.wp-caption-text { font-size:11px; line-height:17px; margin:5px 50px 0px; } +.entry .gallery-icon { width:100%; height:auto; } +.entry .gallery-icon img { margin:0px auto; } +.entry .gallery-caption { margin:5px 10px 0px 0px; padding:0px; } +.entry p.attachment img { margin:0px auto; } +.sticky { border-bottom:3px dotted #C8C8C8; } + + +.wp_syntax { padding:5px 0px; } +.wp_syntax pre { line-height:1.3; } +.wp_syntax pre.php { line-height:1; } + +.widget_recent_entries ul li, +.widget_recent_comments ul li, +.widget_rss ul li { margin:10px 0px; padding:10px 0px; border-top:1px dotted #C8C8C8; } + +.related { margin:20px 0px 0px 0px; } +.nav { margin:30px 0px; text-align:center; } + +#comments { border-top:1px dotted #C8C8C8; margin:30px 0px 0px 0px; padding:30px 0px 0px 0px; } +.commentlist li { list-style-type:none; padding:10px; margin:20px 0px 0px 0px; } +.commentlist li.even { background:#EAEAEA; } +.commentlist li.odd { background:#D6D6D6; } +.comment-author img { float:left; margin:0px 10px 10px 0px; } +ul.commentlist ul.children { padding-left:10px; } +ul.commentlist ul.children li { list-style-type:none; border:1px solid #AAA } +.form-section { margin:10px 0px; text-align:right; } +.form-section div { display:inline; } +.bypostauthor { border:3px dotted #C8C8C8; } +.form-allowed-tags { display:none; } + +#respond { margin:30px 0px 0px 0px; background:#FFF; border:1px solid #9A9A9A; margin:30px 0 0; padding:20px; } +#commentform p { text-align:right; } +#commentform input { width:50%; height:auto; margin:0px 0px 0px 10px; } +#commentform .required { font-weight:bold; } +#commentform textarea { width:95%; height:auto; margin:10px 0px 0px 0px; } +#commentform .comment-form-comment { margin-bottom:5px; text-align:right; } +#commentform .form-allowed-tags { color:#8A8A8A; margin-top:0px; font-size:10px; } + +input#submit { font-weight:bold; } +input#s { width:70%; height:auto; margin:5px 0px; } + +#footer { text-align:center; clear:both; } +#footer div { margin:30px 0px 0px 0px; padding:30px 0px 0px 0px; border-top:1px dotted #C8C8C8; } +#footer li { list-style-type:none; } +#footer .widget_tag_cloud h2 { display:none; } + +/* LWM EDITS */ +#page-title{ + position : relative; + top : 8px; +} diff --git a/theme/static/css/pygment.css b/theme/static/css/pygment.css new file mode 100644 index 0000000..f4581c2 --- /dev/null +++ b/theme/static/css/pygment.css @@ -0,0 +1,2 @@ +.highlight code,.highlight pre{color:#fdce93;background-color:#3f3f3f;padding:10px;}.highlight .hll{background-color:#222}.highlight .c{color:#7f9f7f}.highlight .err{color:#e37170;background-color:#3d3535}.highlight .g{color:#7f9f7f}.highlight .k{color:#f0dfaf}.highlight .l{color:#ccc}.highlight .n{color:#dcdccc}.highlight .o{color:#f0efd0}.highlight .x{color:#ccc}.highlight .p{color:#41706f}.highlight .cm{color:#7f9f7f}.highlight .cp{color:#7f9f7f}.highlight .c1{color:#7f9f7f}.highlight .cs{color:#cd0000;font-weight:bold}.highlight .gd{color:#cd0000}.highlight .ge{color:#ccc;font-style:italic}.highlight .gr{color:red}.highlight .gh{color:#dcdccc;font-weight:bold}.highlight .gi{color:#00cd00}.highlight .go{color:gray}.highlight .gp{color:#dcdccc;font-weight:bold}.highlight .gs{color:#ccc;font-weight:bold}.highlight .gu{color:purple;font-weight:bold}.highlight .gt{color:#0040D0}.highlight .kc{color:#dca3a3}.highlight .kd{color:#ffff86}.highlight .kn{color:#dfaf8f;font-weight:bold}.highlight .kp{color:#cdcf99}.highlight .kr{color:#cdcd00}.highlight .kt{color:#00cd00}.highlight .ld{color:#cc9393}.highlight .m{color:#8cd0d3}.highlight .s{color:#cc9393}.highlight .na{color:#9ac39f}.highlight .nb{color:#efef8f}.highlight .nc{color:#efef8f}.highlight .no{color:#ccc}.highlight .nd{color:#ccc}.highlight .ni{color:#c28182}.highlight .ne{color:#c3bf9f;font-weight:bold}.highlight .nf{color:#efef8f}.highlight .nl{color:#ccc}.highlight .nn{color:#8fbede}.highlight .nx{color:#ccc}.highlight .py{color:#ccc}.highlight .nt{color:#9ac39f}.highlight .nv{color:#dcdccc}.highlight .ow{color:#f0efd0}.highlight .w{color:#ccc}.highlight .mf{color:#8cd0d3}.highlight .mh{color:#8cd0d3}.highlight .mi{color:#8cd0d3}.highlight .mo{color:#8cd0d3}.highlight .sb{color:#cc9393}.highlight .sc{color:#cc9393}.highlight .sd{color:#cc9393}.highlight .s2{color:#cc9393}.highlight .se{color:#cc9393}.highlight .sh{color:#cc9393}.highlight .si{color:#cc9393}.highlight .sx{color:#cc9393}.highlight .sr{color:#cc9393}.highlight .s1{color:#cc9393}.highlight .ss{color:#cc9393}.highlight .bp{color:#efef8f}.highlight .vc{color:#efef8f}.highlight .vg{color:#dcdccc}.highlight .vi{color:#ffffc7}.highlight .il{color:#8cd0d3} + diff --git a/theme/templates/analytics.html b/theme/templates/analytics.html new file mode 100644 index 0000000..ba174fc --- /dev/null +++ b/theme/templates/analytics.html @@ -0,0 +1,11 @@ +{% if GOOGLE_ANALYTICS %} + <script type="text/javascript"> + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); + </script> + <script type="text/javascript"> + try { + var pageTracker = _gat._getTracker("{{GOOGLE_ANALYTICS}}"); + pageTracker._trackPageview(); + } catch(err) {}</script> +{% endif %} \ No newline at end of file diff --git a/theme/templates/archives.html b/theme/templates/archives.html new file mode 100644 index 0000000..9425abf --- /dev/null +++ b/theme/templates/archives.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} +{% block content %} +<section id="content" class="body"> +<h1>Archives for {{ SITENAME }}</h1> + +<dl> +{% for article in dates %} + <dt>{{ article.locale_date }}</dt> + <dd><a href='{{ SITEURL }}/{{ article.url }}'>{{ article.title }}</a></dd> +{% endfor %} +</dl> +</section> +{% endblock %} diff --git a/theme/templates/article.html b/theme/templates/article.html new file mode 100644 index 0000000..f952131 --- /dev/null +++ b/theme/templates/article.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} +{% block title %}{{ super() }} : {{ article.title }}{% endblock %} +{% block content %} +<header> +<h1><a href="{{ SITEURL }}" id="site-title"> {#{{ SITENAME }}#} {% if SITESUBTITLE %} <strong>{{ SITESUBTITLE }}</strong>{% endif %}</a> {#:#} + <a href="{{ SITEURL }}/{{ article.url }}" id="page-title">{{ article.title }}</a></h1> + {% if not HIDE_DATE %}<time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>{% endif %} +</header> +<article> + {{ article.content }} + {% if DISQUS_SITENAME and SITEURL and article.status != "draft" %} + <h2>Comments</h2> + <div id="disqus_thread"></div> + <script type="text/javascript"> + var disqus_shortname = '{{ DISQUS_SITENAME }}'; + var disqus_identifier = '{{ article.url }}'; + var disqus_url = '{{ SITEURL }}/{{ article.url }}'; + (function() { + var dsq = document.createElement('script'); + dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || + document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); + </script> + <noscript>Please enable JavaScript to view the comments.</noscript> + {% endif %} +</article> +{% endblock %} diff --git a/theme/templates/author.html b/theme/templates/author.html new file mode 100644 index 0000000..0b37290 --- /dev/null +++ b/theme/templates/author.html @@ -0,0 +1,2 @@ +{% extends "index.html" %} +{% block title %}{{ SITENAME }} - {{ author }}{% endblock %} diff --git a/theme/templates/authors.html b/theme/templates/authors.html new file mode 100644 index 0000000..e69de29 diff --git a/theme/templates/base.html b/theme/templates/base.html new file mode 100644 index 0000000..369422a --- /dev/null +++ b/theme/templates/base.html @@ -0,0 +1,71 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>{% block title %}{{ SITENAME }}{%endblock%} + + + + {% if FEED_RSS %} + + {% endif %} + + + + + + + + + + +
+
+ {% include 'github.html' %} + + +
+ {% block content %} + {% endblock %} +
+
+ + + + + + + {% include 'analytics.html' %} + {% include 'piwik.html' %} + {% include 'disqus_script.html' %} + +
+ + + diff --git a/theme/templates/categories.html b/theme/templates/categories.html new file mode 100644 index 0000000..e29be0c --- /dev/null +++ b/theme/templates/categories.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% block content %} +
    +{% for category, articles in categories %} +
  • {{ category }}
  • +{% endfor %} +
+{% endblock %} diff --git a/theme/templates/category.html b/theme/templates/category.html new file mode 100644 index 0000000..56f8e93 --- /dev/null +++ b/theme/templates/category.html @@ -0,0 +1,2 @@ +{% extends "index.html" %} +{% block title %}{{ SITENAME }} - {{ category }}{% endblock %} diff --git a/theme/templates/comments.html b/theme/templates/comments.html new file mode 100644 index 0000000..bb033c0 --- /dev/null +++ b/theme/templates/comments.html @@ -0,0 +1 @@ +{% if DISQUS_SITENAME %}

There are comments.

{% endif %} diff --git a/theme/templates/disqus_script.html b/theme/templates/disqus_script.html new file mode 100644 index 0000000..c4f442c --- /dev/null +++ b/theme/templates/disqus_script.html @@ -0,0 +1,11 @@ +{% if DISQUS_SITENAME %} + +{% endif %} diff --git a/theme/templates/github.html b/theme/templates/github.html new file mode 100644 index 0000000..75592ac --- /dev/null +++ b/theme/templates/github.html @@ -0,0 +1,9 @@ +{% if GITHUB_URL %} + +{% if GITHUB_POSITION != "left" %} +Fork me on GitHub +{% else %} +Fork me on GitHub +{% endif %} + +{% endif %} diff --git a/theme/templates/index.html b/theme/templates/index.html new file mode 100644 index 0000000..32d4e36 --- /dev/null +++ b/theme/templates/index.html @@ -0,0 +1,34 @@ +{% extends "base.html" %} +{% block content_title %}{% endblock %} +{% block content %} +{% if articles %} + {% for article in articles %} + + {# First item #} + {% if loop.first %} +
+

{# {{ SITENAME }} #} {% if SITESUBTITLE %} {{ SITESUBTITLE }}{% endif %} {#:#} {{ article.title }}

+ {% if not HIDE_DATE %}{% endif %} +
+ +
+ {{ article.content }}{% include 'comments.html' %} +
+ {% if loop.length > 1 %} +
+

All posts

+
    + {% endif %} + {# other items #} + {% else %} +
  1. {{ article.title }}
  2. + {% endif %} + {% if loop.length > 1 %} +
+
+ {% endif %} + {% endfor %} +{% else %} + No posts found. +{% endif %} +{% endblock content %} diff --git a/theme/templates/page.html b/theme/templates/page.html new file mode 100644 index 0000000..c9d5ff6 --- /dev/null +++ b/theme/templates/page.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% block title %}{{ page.title }}{% endblock %} +{% block content %} +
+

{# {{ SITENAME }} #} {% if SITESUBTITLE %} {{ SITESUBTITLE }}{% endif %} {#:#} + {{ page.title }}

+
+
+ {{ page.content }} +
+{% endblock %} diff --git a/theme/templates/pagination.html b/theme/templates/pagination.html new file mode 100644 index 0000000..83c587a --- /dev/null +++ b/theme/templates/pagination.html @@ -0,0 +1,15 @@ +{% if DEFAULT_PAGINATION %} +

+ {% if articles_page.has_previous() %} + {% if articles_page.previous_page_number() == 1 %} + « + {% else %} + « + {% endif %} + {% endif %} + Page {{ articles_page.number }} / {{ articles_paginator.num_pages }} + {% if articles_page.has_next() %} + » + {% endif %} +

+{% endif %} diff --git a/theme/templates/piwik.html b/theme/templates/piwik.html new file mode 100644 index 0000000..ff459af --- /dev/null +++ b/theme/templates/piwik.html @@ -0,0 +1,16 @@ +{% if PIWIK_URL and PIWIK_SITE_ID %} + +{% endif %} \ No newline at end of file diff --git a/theme/templates/tag.html b/theme/templates/tag.html new file mode 100644 index 0000000..68cdcba --- /dev/null +++ b/theme/templates/tag.html @@ -0,0 +1,2 @@ +{% extends "index.html" %} +{% block title %}{{ SITENAME }} - {{ tag }}{% endblock %} diff --git a/theme/templates/taglist.html b/theme/templates/taglist.html new file mode 100644 index 0000000..c792fd7 --- /dev/null +++ b/theme/templates/taglist.html @@ -0,0 +1,2 @@ +{% if article.tags %}

tags: {% for tag in article.tags %}{{ tag }}{% endfor %}

{% endif %} +{% if PDF_PROCESSOR %}

get the pdf

{% endif %} diff --git a/theme/templates/tags.html b/theme/templates/tags.html new file mode 100644 index 0000000..a6011a0 --- /dev/null +++ b/theme/templates/tags.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} +{% block content %} +
    +{% for tag, articles in tags %} +
  • {{ tag }}
  • +{% endfor %} +
+{% endblock %} + diff --git a/theme/templates/translations.html b/theme/templates/translations.html new file mode 100644 index 0000000..0079883 --- /dev/null +++ b/theme/templates/translations.html @@ -0,0 +1,6 @@ +{% if article.translations %} +Translations: + {% for translation in article.translations %} + {{ translation.lang }} + {% endfor %} +{% endif %} diff --git a/theme/templates/twitter.html b/theme/templates/twitter.html new file mode 100644 index 0000000..c6b159f --- /dev/null +++ b/theme/templates/twitter.html @@ -0,0 +1,3 @@ +{% if TWITTER_USERNAME %} + +{% endif %} \ No newline at end of file