Skip to content

Commit

Permalink
Merge pull request #18 from refinedmods/release/0.4.0
Browse files Browse the repository at this point in the history
Release v0.4.0
  • Loading branch information
raoulvdberge authored Aug 15, 2024
2 parents 8477acc + 325388f commit 41c2351
Show file tree
Hide file tree
Showing 24 changed files with 293 additions and 61 deletions.
17 changes: 16 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ When contributing to this repository, please first discuss the change you wish t
[GitHub issues](https://github.com/refinedmods/refinedarchitect-template/issues), [Discord](https://discordapp.com/invite/VYzsydb),
or any other method with the owners of this repository before making a change.

## Quickstart

These are the most important things to know before contributing (also explained in more detail later in this document):

- Commit messages must adhere to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
- Branch names must be formatted correctly. The format is `{category}/GH-{issue number}/{lowercase-description}`.
Category must match a
category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum). You can also use `NO-ISSUE` instead of a GitHub issue number.
- We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style. It is
recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml)
or [config/intellij-code-style.xml](../config/intellij-code-style.xml) file into your
IDE, so that formatting rules are respected.
- Branches are kept up to date by rebasing, not by merging.
- For non-technical changes, adding a changelog entry is required.

## Pull requests

- Keep your pull request (PR) as small as possible, this makes reviewing easier.
Expand Down Expand Up @@ -35,7 +50,7 @@ The format is `{category}/GH-{issue number}/{lowercase-description}` and a branc
length.

Category must match a
category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum).
category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum). You can also use `NO-ISSUE` instead of a GitHub issue number.

Valid examples are:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [ opened, synchronize, reopened ]
jobs:
build:
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.17.1
with:
mutation-testing: false
sonarqube: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: string
jobs:
draft:
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.17.1
with:
release-type: ${{ inputs.release-type }}
version-number-override: ${{ inputs.version-number-override }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-for-unsupported-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
types: [ labeled, unlabeled, reopened ]
jobs:
unsupported-labeler:
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.17.1
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- closed
jobs:
publish-release:
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.17.1
secrets: inherit
with:
project-name: 'Refined Sites'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/resolved-issue-locking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
- cron: '0 0 * * *'
jobs:
lock:
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.17.1
2 changes: 1 addition & 1 deletion .github/workflows/validate-branch-name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate branch name
on: [ pull_request ]
jobs:
validate-branch-name:
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.17.1
2 changes: 1 addition & 1 deletion .github/workflows/validate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ]
jobs:
validate-changelog:
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.17.1
2 changes: 1 addition & 1 deletion .github/workflows/validate-commit-messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate commit messages
on: [ pull_request ]
jobs:
validate-commit-messages:
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.7.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.17.1
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.4.0] - 2024-08-15

### Added

- Support for article pages.
- Support for RSS feed generation for articles.

### Changed

- Snapshot versions are no longer considered the latest version.

### Fixed

- Asciidoc Xref bug on Windows.

## [0.3.0] - 2023-12-25

### Added
Expand Down Expand Up @@ -55,7 +70,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- Initial release.

[Unreleased]: https://github.com/refinedmods/refinedsites/compare/v0.3.0...HEAD
[Unreleased]: https://github.com/refinedmods/refinedsites/compare/v0.4.0...HEAD

[0.4.0]: https://github.com/refinedmods/refinedsites/compare/v0.3.0...v0.4.0

[0.3.0]: https://github.com/refinedmods/refinedsites/compare/v0.2.3...v0.3.0

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Refined Sites is a static site generator used by Refined Mods.
- [Issues](https://github.com/refinedmods/refinedsites/issues)
- [Refined Mods on GitHub](https://github.com/refinedmods)
- [Discord](https://discordapp.com/invite/VYzsydb)
- [Twitter](https://twitter.com/refinedmods)
- [Mastodon](https://anvil.social/@refinedmods)
- [X (Twitter)](https://x.com/refinedmods)

## Building

Expand Down
35 changes: 0 additions & 35 deletions build.gradle

This file was deleted.

41 changes: 41 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id("application")
id("com.github.johnrengelman.shadow").version("8.1.1")
id("refinedarchitect.root")
}

application {
mainClass.set("com.refinedmods.refinedsites.RefinedSites")
}

group = "com.refinedmods"
base {
archivesName.set("refinedsites")
}

dependencies {
compileOnly("org.projectlombok:lombok:1.18.30")
implementation("com.google.code.gson:gson:2.10.1")
annotationProcessor("org.projectlombok:lombok:1.18.30")
implementation("org.thymeleaf:thymeleaf:3.1.2.RELEASE")
implementation("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.3.0")
implementation("org.asciidoctor:asciidoctorj:2.5.10")
implementation("com.github.slugify:slugify:3.0.6")
implementation("com.vdurmont:semver4j:3.1.0")
implementation("org.slf4j:slf4j-api:2.0.9")
implementation("org.slf4j:slf4j-simple:2.0.9")
implementation("org.kohsuke:github-api:1.318")
implementation("org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r")
implementation("org.commonmark:commonmark:0.21.0")
implementation("com.github.dfabulich:sitemapgen4j:1.1.2")
implementation("com.rometools:rome:2.1.0")
}

// https://github.com/ultraq/thymeleaf-layout-dialect/issues/220#issuecomment-944874151
tasks {
named<ShadowJar>("shadowJar") {
mergeGroovyExtensionModules()
}
}
4 changes: 3 additions & 1 deletion config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@
<module name="MethodCount"/>
<module name="MethodLength"/>
<module name="OuterTypeNumber"/>
<module name="RecordComponentNumber"/>
<module name="RecordComponentNumber">
<property name="max" value="20"/>
</module>
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="NoWhitespaceAfter"/>
Expand Down
66 changes: 66 additions & 0 deletions config/intellij-code-style.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<code_scheme name="Refined Mods" version="173">
<JavaCodeStyleSettings>
<option name="GENERATE_FINAL_LOCALS" value="true" />
<option name="GENERATE_FINAL_PARAMETERS" value="true" />
<option name="SPACE_INSIDE_ONE_LINE_ENUM_BRACES" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="com.refinedmods" withSubpackages="true" static="false" />
<emptyLine />
<package name="java" withSubpackages="true" static="false" />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
</value>
</option>
</JavaCodeStyleSettings>
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
<codeStyleSettings language="Cookie">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="false" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="RIGHT_MARGIN" value="120" />
<option name="BLANK_LINES_BEFORE_PACKAGE" value="1" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="RESOURCE_LIST_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="ASSERT_STATEMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARAMETER_ANNOTATION_WRAP" value="1" />
<option name="VARIABLE_ANNOTATION_WRAP" value="1" />
<option name="ENUM_CONSTANTS_WRAP" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="NBTT">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="false" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
refinedarchitectVersion=0.17.1
# Gradle
org.gradle.jvmargs=-Xmx1G
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
23 changes: 23 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://maven.pkg.github.com/refinedmods/refinedarchitect")
credentials {
username = "anything"
password = "\u0067hp_oGjcDFCn8jeTzIj4Ke9pLoEVtpnZMP4VQgaX"
}
}
maven {
name = "Fabric"
url = uri("https://maven.fabricmc.net/")
}
}
val refinedarchitectVersion: String by settings
plugins {
id("refinedarchitect.root").version(refinedarchitectVersion)
}
}

rootProject.name = "refinedsites"
2 changes: 1 addition & 1 deletion src/main/java/com/refinedmods/refinedsites/model/Site.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void sortComponents(final List<Component> componentsWithSameName) {
// sort componentsWithSameName based on NEWEST-first semver version
componentsWithSameName.sort((component1, component2) -> {
if (component1.getVersion().snapshot()) {
return -1;
return 1;
}
final Semver semver1 = new Semver(component1.getVersion().name());
final Semver semver2 = new Semver(component2.getVersion().name());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.refinedmods.refinedsites.render;

import java.time.LocalDate;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public class ArticleRender {
private final String title;
private final String description;
private final String url;
private final LocalDate date;
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void process(final Document document,
final String xrefPath = matchResult.group(1);
final Path xrefPathFull = path.getParent().resolve(xrefPath);
final Path relativeToSource = Paths.get(reader.getDir()).relativize(xrefPathFull);
return "xref:" + relativeToSource;
return "xref:" + relativeToSource.toString().replace("\\", "/");
});
reader.pushInclude(fixedContent, path.toString(), path.toString(), 1, attributes);
} catch (final IOException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.refinedmods.refinedsites.render;

import java.nio.file.Path;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -29,11 +30,20 @@ public PageAttributes getAttributes(final Asciidoctor asciidoctor, final Path pa
private PageAttributes doLoadAttributes(final Asciidoctor asciidoctor, final Path path) {
final Document document = asciidoctor.loadFile(path.toFile(), Options.builder().build());
return new PageAttributes(
Optional.ofNullable(document.getAttribute("type")).map(Object::toString).orElse("page"),
document.getDoctitle(),
Optional.ofNullable(document.getAttribute("description")).map(Object::toString).orElse(""),
Optional.ofNullable(document.getAttribute("date"))
.map(Object::toString)
.map(LocalDate::parse),
Optional.ofNullable(document.getAttribute("icon")).map(Object::toString)
);
}

public record PageAttributes(String name, Optional<String> icon) {
public record PageAttributes(String type,
String name,
String description,
Optional<LocalDate> date,
Optional<String> icon) {
}
}
Loading

0 comments on commit 41c2351

Please sign in to comment.