Skip to content

Commit

Permalink
Fix minimal-dark-theme header button size on small screen, `DeployP…
Browse files Browse the repository at this point in the history
…agesTask` use convention from extension instead of `set`
  • Loading branch information
hanggrian committed Aug 18, 2024
1 parent 4f203a7 commit c19d6d9
Show file tree
Hide file tree
Showing 15 changed files with 520 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ ij_kotlin_packages_to_use_import_on_demand = unset
ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset
ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than = unset

[*.gradle]
indent_size = 4
max_line_length = 100
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![CircleCI](https://img.shields.io/circleci/build/gh/hanggrian/pages-gradle-plugin)](https://app.circleci.com/pipelines/github/hanggrian/pages-gradle-plugin/)
[![Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/com.hanggrian.pages)](https://plugins.gradle.org/plugin/com.hanggrian.pages)
[![Java](https://img.shields.io/badge/java-8+-informational)](https://www.java.com/en/download/help/java8.html)
[![Java](https://img.shields.io/badge/java-8+-informational)](https://docs.oracle.com/javase/8/)

# Pages Gradle Plugin

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ developerName=Hendra Anggrian
developerUrl=https://github.com/hanggrian/
releaseGroup=com.hanggrian.pages
releaseArtifact=pages-gradle-plugin
releaseVersion=0.1
releaseVersion=0.2
releaseDescription=Static webpage generator for GitHub Pages
releaseUrl=https://github.com/hanggrian/pages-gradle-plugin/

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dokka = { id = "org.jetbrains.dokka", version.ref = "kotlin" }
ktlint = "org.jlleitschuh.gradle.ktlint:12.1.1"
gradle-publish = "com.gradle.plugin-publish:1.2.1"
git-publish = "org.ajoberstar.git-publish:4.2.2"
pages = "com.hanggrian.pages:0.1"
pages = "com.hanggrian.pages:0.2"

[libraries]
# lint
Expand Down
5 changes: 2 additions & 3 deletions pages-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val developerId: String by project
val releaseArtifact: String by project
Expand Down Expand Up @@ -52,10 +51,10 @@ dependencies {
}

tasks {
withType<JavaCompile> {
compileJava {
options.release = jreVersion.asInt()
}
withType<KotlinCompile> {
compileKotlin {
compilerOptions.jvmTarget
.set(JvmTarget.fromTarget(JavaVersion.toVersion(jreVersion).toString()))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public open class PagesPlugin : Plugin<Project> {
project.tasks.register<DeployPagesTask>(TASK_DEPLOY_PAGES) {
group = GROUP
description = "Write webpages and their resources."
staticResources.set(pages.staticResources)
dynamicResources.set(pages.dynamicResources)
webpages.set(pages.webpages)
outputDirectory.set(pages.outputDirectory)
staticResources.convention(pages.staticResources)
dynamicResources.convention(pages.dynamicResources)
webpages.convention(pages.webpages)
outputDirectory.convention(pages.outputDirectory)
fencedCodeBlockIndent.set(pages.fencedCodeBlockIndent)
dependsOn(deployResources)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ internal class MinimalThemeFactory(
options.buttons.isEmpty() -> 0
else -> 270 / options.buttons.size - (options.buttons.size * 1)
}
val miniButtonPct =
when {
options.buttons.isEmpty() -> 99
else -> 99 / options.buttons.size
}
return """
/* Modification */
Expand Down Expand Up @@ -498,7 +503,7 @@ internal class MinimalThemeFactory(
}
header li, header ul li + li + li {
width: 33%;
width: $miniButtonPct%;
}
footer button {
Expand Down
2 changes: 1 addition & 1 deletion samples/cayman-theme/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
repositories.mavenCentral()
dependencies {
classpath files('../pages-gradle-plugin-0.1.jar')
classpath files('../pages-gradle-plugin-0.2.jar')
classpath libs.kotlinx.html.jvm
classpath libs.commonmark.ext.gfm.tables
}
Expand Down
2 changes: 1 addition & 1 deletion samples/many-documents/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
repositories.mavenCentral()
dependencies {
classpath files('../pages-gradle-plugin-0.1.jar')
classpath files('../pages-gradle-plugin-0.2.jar')
classpath libs.kotlinx.html.jvm
classpath libs.commonmark.ext.gfm.tables
}
Expand Down
3 changes: 2 additions & 1 deletion samples/materialist-theme/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
repositories.mavenCentral()
dependencies {
classpath files('../pages-gradle-plugin-0.1.jar')
classpath files('../pages-gradle-plugin-0.2.jar')
classpath libs.kotlinx.html.jvm
classpath libs.commonmark.ext.gfm.tables
}
Expand All @@ -18,6 +18,7 @@ pages {
'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-groovy.min.js',
)
languageAliases.put("gradle", "groovy")
outputDirectory.set(file("output1"))
materialist {
authorName = 'John Doe'
authorUrl = 'https://github.com/johndoe/'
Expand Down
1 change: 1 addition & 0 deletions samples/materialist-theme/output1/images/my_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions samples/materialist-theme/output1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!doctype html>
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>materialist-theme</title>
<link href="images/my_icon.svg" rel="icon">
<meta content="width=device-width, initial-scale=1, user-scalable=no" name="viewport">
<meta content="chrome=1" http-equiv="X-UA-Compatible">
<link href="styles/main.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-groovy.min.js"></script>
<!--Primary meta tags-->
<meta content="materialist-theme" name="title">
<meta content="This is an awesome example" name="description">
</head>
<body>
<div class="wrapper">
<header>
<h1>materialist-theme</h1>
<p>This is an awesome example</p>
<p class="view">
<a href="https://github.com/johndoe/project/">View the Project on GitHub <small>johndoe/project</small></a>
</p>
<ul>
<li>
<a href="documentation.html">Read<strong>Docs</strong></a>
</li>
<li>
<a href="">Download<strong>Source</strong></a>
</li>
<li>
<a href="">Report<strong>Error</strong></a>
</li>
</ul>
</header>
<section>
<p>
<a href="https://travis-ci.com/github/jetbrains/pty4j/"><img alt="Travis CI" src="https://img.shields.io/travis/com/jetbrains/pty4j"></a>
<a href="https://search.maven.org/artifact/org.jetbrains.kotlin/kotlin-stdlib/"><img alt="Maven Central" src="https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-stdlib"></a>
</p>

<h1>My Library</h1>

<p>Some cool stuff going on here.</p>

<h2>Download</h2>

<pre><code class="language-groovy">repositories {
mavenCentral()
}
dependencies {
implementation "com.johndoe:library:$version"
}
</code></pre>

<p>
Snapshots of the development version are available in <a href="https://s01.oss.sonatype.org/content/repositories/snapshots/">Sonatype's snapshots repository</a>.
</p>

<h2>Usage</h2>

<p>Work in progress.</p>

</section>
</div>
<footer>
<p>
This project is maintained by <a href="https://github.com/johndoe/">John Doe</a>
</p>
<small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist/">orderedlist</a></small>
</footer>
<script src="scripts/scale.fix.js"></script>
</body>
</html>
Loading

0 comments on commit c19d6d9

Please sign in to comment.