Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Eudris Cabrera Rodriguez
    Somebody knows how to do a multi language site with jbake and thymeleaf ?
    Thanks in advance !
    Hi ~ I'm trying to upgrade to 2.6 and found out that all relative image paths such as ../images/something.png does not work anymore. Is there any configurations I missed?
    Frank Becker
    Hi. There are several problems with relative image paths espacially for index pages or rss feeds. Have you looked at https://jbake.org/docs/2.6.3/#images_path?
    I recommend using img.path.prepend.host to get full access to images. There is one bugfix regarding relative image paths which hasn't been released yet. jbake-org/jbake#554
    David Amend
    Hi, how to generate multiple standalone HTML files? I tried by reading the documentation, but no success.
    Frank Becker
    what do you mean by multiple standalone HTML files?
    David Amend
    like index.html, index.mobile.html, impressum.html, application.html, ...
    Frank Becker
    So is it basically the problem that you don't know how and where to begin? Have you tried to initalize one of the example projects (e.g. jbake -i -t thymeleaf) and played around with it? I would recommend to take a look at real life projects. like https://github.com/jbake-org/jbake.org, https://github.com/apache/sling-site or https://github.com/apache/incubator-netbeans-website/tree/master/netbeans.apache.org to see how others do it.
    David Amend
    I am using the mvn plugin. Had a look on the examples - thx. Still not clear: should I place /content files and start with content:
    = Events
    :jbake-type: page
    Frank Becker
    yes. makes sense. start with the basic types built in. which are post and page. See https://jbake.org/docs/latest/#content_files
    Frank Becker
    maybe this presentation helps you a bit. https://youtu.be/XRpBnWFL7XA?t=917
    please feel free to open an issue at https://github.com/jbake-org/jbake.org if you have any idea how to enhance the documentation to getting started with jbake or everything else that makes it difficult to understand.
    David Amend
    Thx! I will try tomorrow. Seems like: 1. create content file with type "page" 2. create page.ftl with ${content.body}
    @ancho thank! I'm gonna try to use the img.path.prepend.host config
    Tobias Roeser
    In the mood of updating JBake plugins for SBuild, sbt and newly writing one for mill, I noticed, that since 2.6.2 it is not possible to serve a local site when there is no subfolder "output".
    E.g. jbake -s dest/pathalways assumes, that my contents root is dest/path/output, which is not.
    This was not the case for jbake versions prior to 2.6.2.
    Tobias Roeser
    Isn't the "default.properties" config file loaded from the classloader?
    I get an exception when trying to run JBake from a dedicated classloader (all jars from lib/ dir included)
    Caused by: org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source default.properties
            at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:259)
            at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:238)
            at org.apache.commons.configuration.AbstractFileConfiguration.<init>(AbstractFileConfiguration.java:158)
            at org.apache.commons.configuration.PropertiesConfiguration.<init>(PropertiesConfiguration.java:252)
            at org.jbake.app.configuration.ConfigUtil.load(ConfigUtil.java:47)
            at org.jbake.app.configuration.ConfigUtil.loadConfig(ConfigUtil.java:58)
            at org.jbake.app.configuration.JBakeConfigurationFactory.createDefaultJbakeConfiguration(JBakeConfigurationFactory.java:29)
            at org.jbake.launcher.Main.run(Main.java:78)
    Tobias Roeser
    I don't have an default.properties in my src folder

    The following works:

        val proc = os.proc(
          "-cp", classpath.mkString(":"),

    but this one does not:

    val cl = new URLClassLoader(classpath, null)
    val mainClass = cl.loadClass("org.jbake.launcher.Main")
    val mainMethod = mainClass.getMethod("main", Seq(classOf[Array[String]]): _*)
    mainMethod.invoke(null, args)
    The classpathis identical for both
    Any idea?
    Tobias Roeser
    One difference might be the process working dir, but as the file is not in the filesystem, that should not be the issue.
    ancho hmm...interesting. it should be loaded from the classloader. a default.properties is located in the resources bundle of jbake-core. do you mind open a bugreport?
    Tobias Roeser
    I can do, but was not sure, if it is a bug in jbake or in my usage
    The default.properties is present in the jbake-core.jar, which is present in the classloader.
    ancho hmm....curious....
    Tobias Roeser
    Here is the classloader:
    Creating Classloader with classpath: [Vector(/tmp/jbake-2.6.4-bin/lib/args4j-2.33.jar,
     /tmp/jbake-2.6.4-bin/lib/logging, /tmp/jbake-2.6.4-bin/lib/ognl-3.1.12.jar,
    Configuration error: Cannot locate configuration source default.properties
    ancho I guess it is a bug. But need to see what's happening in the ConfigUtil first....
    Tobias Roeser
    Ok, I will open a ticket
    ancho thanks
    Tobias Roeser
    Frank Becker
    Frank Becker
    see #597 on how to make it possible to configure DEBUG logging for apache commons with logback.
    Tobias Roeser
    Ok, for the reference, here's fix to work around the TCCL issue when using JBake main as library entry point.
    Frank Becker
    nice. thanks for sharing.
    Tobias Roeser
    I also added the plugin to the documentation

    If you don’t require any of these special pages to be rendered then you can turn off the rendering of them by adding the following lines to your jbake.properties file:

    render.archive=false (these lines are not working....is there i need to install anything else?)

    Frank Becker
    after you change these options you need to purge your destination folder and bake your site again. does that help?
    Frank Becker
    Please file a bugreport at github. I'm not able to reproduce that behaviour. What Version of jbake are you using?
    Frank Becker

    A quick example:

    Create a folder and initialize a jbake project:

    mkdir /tmp/test
    cd /tmp/test
    jbake -i

    Edit the jbake.properties file:

    render.index = false
    render.archive = false

    Build the project:

    jbake -b

    There is no index.html or archive.html file present:

     ls -lR output
    insgesamt 40
    -rw-r--r-- 1 frank frank 4363 Feb 23 10:03 about.html
    drwxr-xr-x 3 frank frank 4096 Feb 23 10:03 blog
    drwxr-xr-x 2 frank frank 4096 Feb 23 10:03 css
    -rw-r--r-- 1 frank frank  894 Feb 23 10:02 favicon.ico
    -rw-r--r-- 1 frank frank 6486 Feb 23 10:03 feed.xml
    drwxr-xr-x 2 frank frank 4096 Feb 23 10:03 fonts
    drwxr-xr-x 2 frank frank 4096 Feb 23 10:03 js
    -rw-r--r-- 1 frank frank  877 Feb 23 10:03 sitemap.xml
    insgesamt 4
    drwxr-xr-x 2 frank frank 4096 Feb 23 10:03 2013
    insgesamt 32
    -rw-r--r-- 1 frank frank 4765 Feb 23 10:03 first-post.html
    -rw-r--r-- 1 frank frank 4704 Feb 23 10:03 fourth-post.html
    -rw-r--r-- 1 frank frank 4620 Feb 23 10:03 second-post.html
    -rw-r--r-- 1 frank frank 4704 Feb 23 10:03 third-post.html
    insgesamt 140
    -rw-r--r-- 1 frank frank 29015 Feb 23 10:02 asciidoctor.css
    -rw-r--r-- 1 frank frank   959 Feb 23 10:02 base.css
    -rw-r--r-- 1 frank frank 99961 Feb 23 10:02 bootstrap.min.css
    -rw-r--r-- 1 frank frank   607 Feb 23 10:02 prettify.css
    insgesamt 152
    -rw-r--r-- 1 frank frank 20335 Feb 23 10:02 glyphicons-halflings-regular.eot
    -rw-r--r-- 1 frank frank 62927 Feb 23 10:02 glyphicons-halflings-regular.svg
    -rw-r--r-- 1 frank frank 41280 Feb 23 10:02 glyphicons-halflings-regular.ttf
    -rw-r--r-- 1 frank frank 23320 Feb 23 10:02
    insgesamt 148
    -rw-r--r-- 1 frank frank 29110 Feb 23 10:02 bootstrap.min.js
    -rw-r--r-- 1 frank frank  2636 Feb 23 10:02 html5shiv.min.js
    -rw-r--r-- 1 frank frank 95786 Feb 23 10:02 jquery-1.11.1.min.js
    -rw-r--r-- 1 frank frank 14551 Feb 23 10:02 prettify.js
    For my custom jbake type, I defined an attribute jbake-title which is used in the template. For some reason, I cannot use asciidoc replacement with jbake properties here. If I for example have :jbake-title: {mavenversion}, I will get "null" in the template evaluation. It works just fine in the asciidoc text body though. Any ideas? (Prio to v2.6, it doesn't get replaces at all when used as :jabke-title:, {mavenversion} should be directly displayed as is)
    Hi, guys. How to make my website available externally
    now it only works on localhost