Использование заголовка переднего вопроса как для постоянной ссылки

Вот код, иллюстрирующий java.lang.NoClassDefFoundError. Пожалуйста, см. ответ Джареда для подробного объяснения.

NoClassDefFoundErrorDemo.java

public class NoClassDefFoundErrorDemo {
    public static void main(String[] args) {
        try {
            // The following line would throw ExceptionInInitializerError
            SimpleCalculator calculator1 = new SimpleCalculator();
        } catch (Throwable t) {
            System.out.println(t);
        }
        // The following line would cause NoClassDefFoundError
        SimpleCalculator calculator2 = new SimpleCalculator();
    }

}

SimpleCalculator.java

public class SimpleCalculator {
    static int undefined = 1 / 0;
}

1
задан mrpbennett 16 January 2019 в 17:45
поделиться

2 ответа

_config.yml

collections:
  news:
    output: true
    permalink: /news/:title
0
ответ дан JoostS 16 January 2019 в 17:45
поделиться

Вы можете определить slug в начале:

---
layout: newspost
title:  "Fracture announces exclusive 3 year deal with Drake & Morgan."
date:   2019-01-16
slug: "fracture-announces-exclusive-3-year-deal-with-drake-and-morgan"
---

И определить значение по умолчанию permalink для новостей:

collections:
  news:
    output: true
    permalink: "/:collection/:slug/"

ИЛИ

Вы может немного больше работать с именами файлов и в итоге получить имя файла fracture-announces-exclusive-3-year-deal-with-drake-and-morgan.md . ; -)

0
ответ дан David Jacquel 16 January 2019 в 17:45
поделиться
Другие вопросы по тегам:

Похожие вопросы: