This is an automated email from the ASF dual-hosted git repository.

msahyoun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pdfbox-docs.git


The following commit(s) were added to refs/heads/master by this push:
     new 16dc1c2  PDFBOX-4848: add missing content when using maven/node.js 
based build
16dc1c2 is described below

commit 16dc1c28022442b5708a386cf7cf93fae059c023
Author: Maruan Sahyoun <sahy...@fileaffairs.de>
AuthorDate: Sun Jun 14 20:18:51 2020 +0200

    PDFBOX-4848: add missing content when using maven/node.js based build
---
 .eleventy.js                        |  4 ++++
 content/_includes/head.html         |  2 +-
 content/_layouts/documentation.html |  4 ++++
 content/_sass/documentation.scss    | 10 ++++++++++
 content/index.md                    | 30 ++++++++++++++++++++++++++++++
 package.json                        |  3 +++
 6 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/.eleventy.js b/.eleventy.js
index e75d848..bc15e93 100644
--- a/.eleventy.js
+++ b/.eleventy.js
@@ -7,6 +7,10 @@ module.exports = function(eleventyConfig) {
   const options = {
     html: true
   };
+
+  const pluginTOC = require('eleventy-plugin-nesting-toc');
+  eleventyConfig.addPlugin(pluginTOC, {tags: ['h2', 'h3']});
+
   const markdownLib = markdownIt(options).use(markdownItAnchor);
   eleventyConfig.setLibrary("md", markdownLib);
 
diff --git a/content/_includes/head.html b/content/_includes/head.html
index cb85eac..12a6d8a 100644
--- a/content/_includes/head.html
+++ b/content/_includes/head.html
@@ -4,7 +4,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <meta name="description" content="{{site.description}}">
 
-    <title>Apache PDFBox | {% if page.title %}{{ page.title }}{% endif 
%}</title>
+    <title>Apache PDFBox |  {% if page.title %}{{ page.title }}{% else 
%}{{title}}{% endif %}</title>
 
     <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
     <link href="/css/pygments-github.css" rel="stylesheet">
diff --git a/content/_layouts/documentation.html 
b/content/_layouts/documentation.html
index 0d28430..c9d0bc5 100644
--- a/content/_layouts/documentation.html
+++ b/content/_layouts/documentation.html
@@ -55,7 +55,11 @@
     </section>
     <aside>
       <h1>Table of Contents</h1>
+      {% if title.length > 0 %}
+      {{ content | toc | safe }}
+      {% else %}
       {% include toc.html html=content h_min=2 h_max=3 %}
+      {% endif %}
     </aside>
   </div>
 
diff --git a/content/_sass/documentation.scss b/content/_sass/documentation.scss
index 7ccb865..9941251 100644
--- a/content/_sass/documentation.scss
+++ b/content/_sass/documentation.scss
@@ -58,6 +58,16 @@
       text-transform: uppercase;
     }
 
+    ol {
+      list-style: none;
+      padding: 0 1rem;
+    }
+
+    & > ol {
+      list-style: none;
+      padding: 0;
+    }
+
     ul {
       list-style: none;
       padding: 0 1rem;
diff --git a/content/index.md b/content/index.md
index 5ce6fc9..6cba4cb 100644
--- a/content/index.md
+++ b/content/index.md
@@ -26,6 +26,21 @@ title:   A Java PDF Library
     documents and the ability to extract content from documents. Apache PDFBox 
also includes several
     command-line utilities. Apache PDFBox is published under the Apache 
License v2.0.</p>
 
+    {% comment %}
+As we transition from Jekyll to Eleventy because of the new maven/node.js 
based build
+there are two loops with different collection objects to be able to render 
with Jekyll
+as well as with Eleventy. will be cleaned up after the transisiton has been 
completed.
+{% endcomment %}
+{% comment %}this block will be handled by Eleventy{% endcomment %}
+{% if collections.posts.length > 0 %}
+{% assign items = collections.posts  | reverse %}
+{% for post in items limit:1%}
+<h2>{{ post.data.title }}<br><small>{{ post.data.page.date | date: 
"%Y-%m-%d"}}</small></h2>
+{{ post.templateContent }}
+{% endfor %}
+{% endif %}
+
+{% comment %}this block will be handled by Jekyll{% endcomment %}
 {% for post in site.categories.news limit:1 %}
 <h2>{{ post.title }}<br><small>{{ post.date  | date: "%Y-%m-%d"}}</small></h2>
 {{ post.content }}
@@ -81,6 +96,21 @@ skills. Subscribe to the [Mailing Lists](/mailinglists.html) 
and find out how yo
 </div>
 
 ## News
+
+{% comment %}
+As we transition from Jekyll to Eleventy because of the new maven/node.js 
based build
+there are two loops with different collection objects to be able to render 
with Jekyll
+as well as with Eleventy. will be cleaned up after the transisiton has been 
completed.
+{% endcomment %}
+{% comment %}this block will be handled by Eleventy{% endcomment %}
+{% if collections.posts.length > 0 %}
+{% assign items = collections.posts %}
+{% for post in items offset:1 limit:5 %}
+<h2>{{ post.data.title }}<br><small>{{ post.data.page.date | date: 
"%Y-%m-%d"}}</small></h2>
+{{ post.templateContent }}
+{% endfor %}
+{% endif %}
+
 {% for post in site.categories.news offset:1 limit:5 %}
 <h3>{{ post.title }}<br><small>{{ post.date  | date: "%Y-%m-%d"}}</small></h3>
 {{ post.content }}
diff --git a/package.json b/package.json
index 3dd13bb..70fe983 100644
--- a/package.json
+++ b/package.json
@@ -22,5 +22,8 @@
     "markdown-it-anchor": "^5.3.0",
     "npm-run-all": "^4.1.5",
     "sass": "^1.26.8"
+  },
+  "dependencies": {
+    "eleventy-plugin-nesting-toc": "^1.2.0"
   }
 }

Reply via email to