Skip to content
Permalink
Browse files

fixed conflict

  • Loading branch information
ralsina committed Jan 13, 2015
2 parents c9c7a97 + 7b3f0c6 commit 209512795de95bc53a986236defcdb44b445d9fe
Showing with 1,697 additions and 746 deletions.
  1. +2 −0 .travis.yml
  2. +3 −2 AUTHORS.txt
  3. +45 −6 CHANGES.txt
  4. +1 −1 LICENSE.txt
  5. +2 −10 appveyor.yml
  6. +38 −38 docs/creating-a-site.txt
  7. +4 −0 docs/creating-a-theme.txt
  8. +52 −13 docs/manual.txt
  9. +1 −1 docs/sphinx/conf.py
  10. +28 −22 docs/theming.txt
  11. +1 −1 nikola/__init__.py
  12. +27 −14 nikola/__main__.py
  13. +101 −20 nikola/conf.py.in
  14. +1 −0 nikola/data/samplesite/posts/1.rst
  15. +2 −0 nikola/data/themes/base-jinja/templates/archiveindex.tmpl
  16. +1 −1 nikola/data/themes/base-jinja/templates/base.tmpl
  17. +3 −1 nikola/data/themes/base-jinja/templates/tags.tmpl
  18. +1 −1 nikola/data/themes/base/assets/css/rst.css
  19. +3 −1 nikola/data/themes/base/assets/css/theme.css
  20. +2 −0 nikola/data/themes/base/templates/archiveindex.tmpl
  21. +1 −1 nikola/data/themes/base/templates/base.tmpl
  22. +3 −1 nikola/data/themes/base/templates/tags.tmpl
  23. +1 −1 nikola/data/themes/bootstrap-jinja/templates/base.tmpl
  24. +3 −1 nikola/data/themes/bootstrap-jinja/templates/tags.tmpl
  25. +0 −17 nikola/data/themes/bootstrap/assets/css/theme.css
  26. +1 −1 nikola/data/themes/bootstrap/templates/base.tmpl
  27. +3 −1 nikola/data/themes/bootstrap/templates/tags.tmpl
  28. +1 −1 nikola/data/themes/bootstrap3-jinja/templates/base.tmpl
  29. +0 −17 nikola/data/themes/bootstrap3/assets/css/theme.css
  30. +1 −1 nikola/data/themes/bootstrap3/templates/base.tmpl
  31. +2 −4 nikola/filters.py
  32. +111 −0 nikola/image_processing.py
  33. +184 −10 nikola/nikola.py
  34. +13 −4 nikola/plugin_categories.py
  35. +13 −7 nikola/plugins/basic_import.py
  36. +1 −1 nikola/plugins/command/__init__.py
  37. +1 −1 nikola/plugins/command/auto.plugin
  38. +5 −2 nikola/plugins/command/auto.py
  39. +1 −1 nikola/plugins/command/bootswatch_theme.plugin
  40. +1 −1 nikola/plugins/command/bootswatch_theme.py
  41. +1 −1 nikola/plugins/command/check.plugin
  42. +17 −5 nikola/plugins/command/check.py
  43. +1 −1 nikola/plugins/command/console.plugin
  44. +1 −1 nikola/plugins/command/console.py
  45. +1 −1 nikola/plugins/command/deploy.plugin
  46. +1 −1 nikola/plugins/command/deploy.py
  47. +1 −1 nikola/plugins/command/github_deploy.plugin
  48. +1 −1 nikola/plugins/command/github_deploy.py
  49. +1 −1 nikola/plugins/command/import_wordpress.plugin
  50. +7 −1 nikola/plugins/command/import_wordpress.py
  51. +1 −1 nikola/plugins/command/init.plugin
  52. +1 −1 nikola/plugins/command/init.py
  53. +1 −1 nikola/plugins/command/install_theme.plugin
  54. +9 −15 nikola/plugins/command/install_theme.py
  55. +1 −1 nikola/plugins/command/new_page.plugin
  56. +17 −1 nikola/plugins/command/new_page.py
  57. +1 −1 nikola/plugins/command/new_post.plugin
  58. +44 −6 nikola/plugins/command/new_post.py
  59. +1 −1 nikola/plugins/command/orphans.plugin
  60. +1 −1 nikola/plugins/command/orphans.py
  61. +1 −1 nikola/plugins/command/plugin.plugin
  62. +1 −1 nikola/plugins/command/plugin.py
  63. +1 −1 nikola/plugins/command/serve.plugin
  64. +1 −1 nikola/plugins/command/serve.py
  65. +1 −1 nikola/plugins/command/version.plugin
  66. +1 −1 nikola/plugins/command/version.py
  67. +1 −1 nikola/plugins/compile/__init__.py
  68. +1 −1 nikola/plugins/compile/html.plugin
  69. +1 −1 nikola/plugins/compile/html.py
  70. +7 −4 nikola/plugins/compile/ipynb/__init__.py
  71. +1 −1 nikola/plugins/compile/markdown.plugin
  72. +1 −1 nikola/plugins/compile/markdown/__init__.py
  73. +2 −2 nikola/plugins/compile/markdown/mdx_nikola.py
  74. +1 −1 nikola/plugins/compile/markdown/mdx_podcast.py
  75. +1 −1 nikola/plugins/compile/pandoc.plugin
  76. +2 −2 nikola/plugins/compile/pandoc.py
  77. +1 −1 nikola/plugins/compile/php.plugin
  78. +1 −1 nikola/plugins/compile/php.py
  79. +1 −1 nikola/plugins/compile/rest.plugin
  80. +16 −2 nikola/plugins/compile/rest/__init__.py
  81. +1 −1 nikola/plugins/compile/rest/chart.py
  82. +1 −1 nikola/plugins/compile/rest/doc.py
  83. +73 −23 nikola/plugins/compile/rest/listing.py
  84. +1 −1 nikola/plugins/compile/rest/media.py
  85. +1 −1 nikola/plugins/compile/rest/post_list.py
  86. +1 −1 nikola/plugins/compile/rest/slides.py
  87. +9 −0 nikola/plugins/compile/rest/thumbnail.plugin
  88. +69 −0 nikola/plugins/compile/rest/thumbnail.py
  89. +1 −1 nikola/plugins/compile/rest/vimeo.py
  90. +1 −1 nikola/plugins/compile/rest/youtube.py
  91. +1 −1 nikola/plugins/loghandler/__init__.py
  92. +1 −1 nikola/plugins/loghandler/smtp.plugin
  93. +1 −1 nikola/plugins/loghandler/smtp.py
  94. +1 −1 nikola/plugins/loghandler/stderr.plugin
  95. +1 −1 nikola/plugins/loghandler/stderr.py
  96. +1 −1 nikola/plugins/task/__init__.py
  97. +1 −1 nikola/plugins/task/archive.plugin
  98. +26 −6 nikola/plugins/task/archive.py
  99. +1 −1 nikola/plugins/task/bundles.plugin
  100. +13 −7 nikola/plugins/task/bundles.py
  101. +1 −1 nikola/plugins/task/copy_assets.plugin
  102. +3 −3 nikola/plugins/task/copy_assets.py
  103. +1 −1 nikola/plugins/task/copy_files.plugin
  104. +2 −2 nikola/plugins/task/copy_files.py
  105. +1 −1 nikola/plugins/task/galleries.plugin
  106. +135 −140 nikola/plugins/task/galleries.py
  107. +1 −1 nikola/plugins/task/gzip.plugin
  108. +1 −1 nikola/plugins/task/gzip.py
  109. +1 −1 nikola/plugins/task/indexes.plugin
  110. +23 −76 nikola/plugins/task/indexes.py
  111. +1 −1 nikola/plugins/task/listings.plugin
  112. +4 −17 nikola/plugins/task/listings.py
  113. +1 −1 nikola/plugins/task/pages.plugin
  114. +2 −4 nikola/plugins/task/pages.py
  115. +1 −1 nikola/plugins/task/posts.plugin
  116. +9 −8 nikola/plugins/task/posts.py
  117. +1 −1 nikola/plugins/task/redirect.plugin
  118. +3 −14 nikola/plugins/task/redirect.py
  119. +1 −1 nikola/plugins/task/robots.plugin
  120. +2 −2 nikola/plugins/task/robots.py
  121. +1 −1 nikola/plugins/task/rss.plugin
  122. +5 −2 nikola/plugins/task/rss.py
  123. +9 −0 nikola/plugins/task/scale_images.plugin
  124. +92 −0 nikola/plugins/task/scale_images.py
  125. +1 −1 nikola/plugins/task/sitemap.plugin
  126. +6 −3 nikola/plugins/task/sitemap/__init__.py
  127. +1 −1 nikola/plugins/task/sources.plugin
  128. +2 −2 nikola/plugins/task/sources.py
  129. +1 −1 nikola/plugins/task/tags.plugin
  130. +100 −90 nikola/plugins/task/tags.py
  131. +1 −1 nikola/plugins/template/__init__.py
  132. +1 −1 nikola/plugins/template/jinja.plugin
  133. +1 −1 nikola/plugins/template/jinja.py
  134. +1 −1 nikola/plugins/template/mako.plugin
  135. +1 −1 nikola/plugins/template/mako.py
  136. +101 −15 nikola/post.py
  137. +152 −14 nikola/utils.py
  138. +1 −1 nikola/winutils.py
  139. +1 −1 requirements-tests.txt
  140. +1 −1 requirements.txt
  141. +0 −6 setup.py
  142. +3 −0 tests/test_rss_feeds.py
@@ -40,3 +40,5 @@ notifications:
- "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}"
- "Change view: %{compare_url}"
- "Build details: %{build_url}"
skip_join: true
use_notice: true
@@ -10,7 +10,7 @@ do a PR :-)
Alberto Berti <https://github.com/azazel75>
Aru Sahni <https://github.com/arusahni>
Bluerise <https://github.com/Bluerise>
Chris “Kwpolska” Warrick <https://github.com/Kwpolska>
Chris Warrick <https://github.com/Kwpolska>
Daniel Aleksandersen <https://github.com/Aeyoun>
Dmitry Verkhoturov <https://github.com/paskal>
DoctorMalboro <https://github.com/DoctorMalboro>
@@ -77,4 +77,5 @@ yarko <https://github.com/yarko>
Alex Walters <https://github.com/tritium21>
Carsten Grohmann <https://github.com/CarstenGrohmann>
Aurelien Naldi <https://github.com/aurelien-naldi>
Andreas Linz <https://github.com/KLINGTdotNET>
Andreas Linz <https://github.com/KLINGTdotNET>
小明 <https://github.com/dongweiming>
@@ -4,6 +4,34 @@ New in master
Features
--------

* Added ``-a``, ``--author`` option to set post author field
* Added option INDEXES_PRETTY_PAGE_URL to make URLs for indexes
pages more pretty. (Issue #1548)
* Added ``-i``, ``--import`` argument to ``new_post`` for importing
existing post contents (Issue #1385)
* Added warning about ``password`` in posts being insecure
(Issue #1547)
* INDEXES_TITLE and INDEXES_PAGES are translatable (Issue #1544)
* Added new option ARCHIVES_ARE_INDEXES which allows archive pages
which list posts to be rendered with the post contents.
(Issue #1537)
* Added new option INDEXES_STATIC which allows to define the
page ordering for indexes (Issue #1537). Also, if tag pages are
created as indexes, they will behave more close to the
default indexes.
* Use ``table`` line-numbering style with reST code, making
copy-pasting code possible (Issue #1285)
* Tag and category pages are now more separated. The prefix for
category pages can be changed and the folder can be modified
independently of the tags' folder. (Issue #1535)
* Writing the tag cloud data file can now be disabled. Will be
disabled by default in the future. (Issue #1535)
* The ``utils.config_changed`` function now takes an optional extra
argument, ``identifier``, used to identify the source of a specific
dependency save. As such, ALL your files will be rebuilt after
upgrading. (Issue #1526 via #1521)
* New option GALLERY_FOLDERS replacing GALLERY_PATH (Issue #1511)
* New PANDOC_OPTIONS option (Issue #1492)
* New tab-width option in code-block directive (Issue #1514)
* New option TAG_PAGES_DESCRIPTIONS for optionally making individual
tag pages more unique and interesting (Issue #1486)
@@ -22,17 +50,27 @@ Features
* Added Swedish translation (by Johan Sommerfeld)
* New advanced option RSS_LINKS_APPEND_QUERY for tracking traffic
from RSS subscribers
* Add `robots` meta tag with value `noindex` for drafts (Issue #1489)
* Add ``robots`` meta tag with value ``noindex`` for drafts
(Issue #1489)
* New option TAGLIST_MINIMUM_POSTS allows hiding unpopular tags from
the tag index page (Issue #1484)
* New options CREATE_FULL_ARCHIVES and CREATE_DAILY_ARCHIVE which allow
to create non-hierarchical archives and archives for days, respectively
(Issue #1494)
* New options CREATE_FULL_ARCHIVES and CREATE_DAILY_ARCHIVE which
allow to create non-hierarchical archives and archives for days,
respectively (Issue #1494)
* New plugin for creating image thumbnails, and a corresponding reST
plugin (Issue #1527)

Bugfixes
--------

* Handle over-and-under-lined titles in rst fr guessing title (Issue #1539)
* Turned minify_lines into a no-op (Issue #1497)
* Don’t classify unpublished posts as pages (Issue #1577)
* Fixed a ``TranslatableSetting.langformat`` race condition
* Fixed ``TranslatableSetting`` instantiation in
``TranslatableSetting.langformat`` (Issue #1571)
* Fixed ``rss.xsl`` path for blogs not deployed to server root
(Issue #1563)
* Respect SHOW_UNTRANSLATED_POSTS = False in archives
and for untranslated source files (Issue #1360)
* Make sure drafts don’t appear in sitemaps with multiple languages
@@ -43,7 +81,8 @@ Bugfixes
* Use ADDITIONAL_METADATA with the two-file format (Issue #1471)
* Make previewimage compatible with sites deployed to subdirectories
(Issue #1473)
* Make sitemaps work on sites deployed to subdirectories (Issue #1472)
* Make sitemaps work on sites deployed to subdirectories
(Issue #1472)

New in v7.2.0
=============
@@ -702,7 +741,7 @@ Bugfixes
* Added .rst to the default reStructuredText extensions (via Issue #542)
* Moved the sample site to the new one-file format (Issue #542)
* Escape HTML in titles (Issue #537)
* Fixed issues with index pages indices (Issue #532)
* Fixed issues with index pages indexes (Issue #532)
* Fixed IPython plugin to work with the latest IPython.nbconvert machinery
* Fixed failing build because of hidden folders and files inside post folder

@@ -1,4 +1,4 @@
Copyright © 2012-2014 Roberto Alsina and others.
Copyright © 2012-2015 Roberto Alsina and others.

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
@@ -2,26 +2,18 @@
build: false
environment:
matrix:
#- PYTHON: "C:/Python34"
- PYTHON: "C:/Python27"
#- PYTHON: "C:/Python34"
init:
- "ECHO %PYTHON%"
- ps: "ls C:/Python*"
install:
- ps: (new-object net.webclient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'C:/get-pip.py')
- "%PYTHON%/python.exe C:/get-pip.py"
- ps: (new-object net.webclient).DownloadFile('https://pypi.python.org/packages/2.7/l/lxml/lxml-3.3.5.win32-py2.7.exe', 'C:/Python27/get-lxml.exe')
#- ps: (new-object net.webclient).DownloadFile('http://www.lfd.uci.edu/~gohlke/pythonlibs/5hgp4h3m/lxml-3.3.5.win32-py3.4.exe', 'C:/Python34/get-lxml.exe')
- "%PYTHON%/Scripts/easy_install.exe %PYTHON%/get-lxml.exe"
# can't install coverage etc.
- "%PYTHON%/Scripts/pip.exe install --upgrade setuptools"
- "%PYTHON%/Scripts/pip.exe install -r requirements-extras.txt pytest mock freezegun"
# temporary change, install with setup.py install so symlinks are expanned
# - "%PYTHON%/Scripts/pip.exe install ."
- "%PYTHON%/python.exe setup.py install"

# temp workaround
- "%PYTHON%/Scripts/pip.exe uninstall -y webassets"

test_script:
- "set path=%PYTHON%/Scripts;%path%"
- "%PYTHON%/python.exe --version"
@@ -1,5 +1,5 @@
.. slug: creating-a-site-not-a-blog-with-nikola
.. date: 2013/03/01 12:49:41
.. date: 2015-01-10 10:00:00 UTC
.. tags: nikola, python
.. link:
.. description:
@@ -10,19 +10,22 @@ Creating a Site (Not a Blog) with Nikola

.. class:: lead

One of the most frequent questions I get about Nikola is "but how do
I create a site that's not a blog?". And of course, that's because the
documentation is heavily blog-oriented. This document will change that ;-)
One of the most frequent questions I get about Nikola is but how do
I create a site thats not a blog?. And of course, thats because the
documentation is heavily blogoriented. This document will change that ;-)

Since it started, Nikola has had the capabilities to create generic sites. For example,
Nikola's `own site <http://getnikola.com>`_ is a fairly generic one. Let's go
Nikolas `own site <https://getnikola.com/>`_ is a fairly generic one. Lets go
step by step on how you can do something like that.

As usual when starting a nikola site, you start with ``nikola init`` which creates a
empty semi-configured site::
empty (mostly) configured site::

$ nikola init mysite
Created empty site at mysite.
Creating Nikola Site
====================
[1970-01-01T00:00:00Z] INFO: init: Created empty site at mysite.

Then we go into the new ``mysite`` folder, and make the needed changes in the ``conf.py``
configuration file:
@@ -40,8 +43,8 @@ configuration file:
BLOG_TITLE = "Not a Blog"
# This is the main URL for your site. It will be used
# in a prominent link
SITE_URL = "http://notablog.ralsina.com.ar/"
BLOG_EMAIL = "ralsina@kde.org"
SITE_URL = "http://getnikola.com/"
BLOG_EMAIL = "ralsina@example.com"
BLOG_DESCRIPTION = "This is a demo site (not a blog) for Nikola."

#
@@ -58,12 +61,13 @@ configuration file:

And now we are ready to create our first page::

$ nikola new_post -p
Creating New Post
$ nikola new_page
Creating New Page
-----------------

Enter title: index
Your post's text is at: pages/index.txt
Title: index
Scanning posts....done!
[1970-01-01T00:00:00Z] INFO: new_page: Your page's text is at: stories/index.rst

.. note:: The ``-p`` option in the ``nikola new_post`` command means we are creating a page and not a blog post.

@@ -74,32 +78,30 @@ We can now build and preview our site::
. render_site:output/categories/index.html
. render_sources:output/index.txt
. render_rss:output/rss.xml
:
:
: [Much more of the same]

$ nikola serve
Serving HTTP on 127.0.0.1 port 8000 ...
[1970-01-01T00:00:00Z] INFO: serve: Serving HTTP on 0.0.0.0 port 8000...


And you can see your (very empty) site in http://localhost:8000
And you can see your (very empty) site in http://localhost:8000/

So, what's in that ``pages/index.txt`` file?
So, whats in that ``pages/index.txt`` file?

.. code-block:: rest

.. title: index
.. slug: index
.. date: 2013/03/01 10:26:17
.. date: 1970-01-01 00:00:00 UTC
.. tags:
.. link:
.. description:


Write your post here.

Title is the page title, slug is the name of the generated HTML file
(in this case it would be ``index.html``) the date doesn't matter much in
not-blogs, same for tags and link. Description is useful for SEO purposes
``title`` is the page title, ``slug`` is the name of the generated HTML file
(in this case it would be ``index.html``). ``date``, ``tags`` and ``link``
doesn’t matter at all in stories. ``description`` is useful for SEO purposes
if you care for that.

And below, the content. By default you are expected to use
@@ -108,32 +110,31 @@ Nikola supports a ton of formats, including Markdown, plain HTML, BBCode,
Wiki, and Textile.

So, let's give the page a nicer title, and some fake content. Since the default
Nikola theme (called "bootstrap") is based on `bootstrap 2 <http://getbootstrap.com/2.3.2/>`_
Nikola theme (called ``bootstrap3``) is based on `Bootstrap <http://getbootstrap.com/>`_
you can use anything you like from it:

.. code-block:: rest

.. title: Welcome To The Fake Site
.. slug: index
.. date: 2013/03/01 10:26:17
.. date: 1970-01-01 00:00:00 UTC
.. tags:
.. link:
.. description: Fake Site version 1, welcome page!


.. class:: hero-unit span6
.. class:: jumbotron col-md-6

.. admonition:: This is a Fake Site

It pretends to be about things, but is really just an example.
So, don't click this button, it leads nowhere.

.. class:: btn
.. raw:: html

Click Me!
<a href="https://getnikola.com/" class="btn btn-primary btn-lg">Click Me!</a>


.. class:: span5
.. class:: col-md-5

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris non nunc turpis.
Phasellus a ullamcorper leo. Sed fringilla dapibus orci eu ornare. Quisque
@@ -146,15 +147,13 @@ you can use anything you like from it:
aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
himenaeos.

[And more in the same vein]

.. admonition:: TIP: Nice URLs

If you like your URLs without the ".html" then you want to create folders and
If you like your URLs without the ``.html`` then you want to create folders and
put the pages in ``index.html`` inside them using the ``PRETTY_URLS`` option.

And that's it. You will want to change the NAVIGATION_LINKS option to create a reasonable
"menu" for your site, you will want to hack the theme (check ``nikola help bootswatch_theme``
menu for your site, you will want to modify the theme (check ``nikola help bootswatch_theme``
for a quick & dirty solution), and you may want to add a blog later on, for company news
or whatever.

@@ -167,9 +166,10 @@ or whatever.
POSTS = [("posts/*.txt", "blog", "post.tmpl", True)]

Create a post with ``nikola new_post`` and that's it, you now have a blog
in http://yoursite.com/blog (you may want to add links to it in NAVIGATION_LINKS of course).
in the ``/blog/`` subdirectory of your site — you may want to link to
it in ``NAVIGATION_LINKS``.

You can see the finished site in http://notablog.ralsina.com.ar and its full configuration in
http://ralsina.me/listings/notablog/conf.py.html
If you want to see a site implementing all of the above, check out `the Nikola
website <https://getnikola.com/>`_.

I hope this was helpful!
@@ -17,6 +17,10 @@ so we get good support for slides and galleries.

I will try to create a theme that looks like `Vinicius Massuchetto's Monospace Theme <http://wordpress.org/themes/monospace>`_.

.. danger::

This document is outdated! Recommendations in this post may not work!

.. TEASER_END

Starting The Theme

0 comments on commit 2095127

Please sign in to comment.
You can’t perform that action at this time.