-
Notifications
You must be signed in to change notification settings - Fork 969
Complete major migration tasks for the new site #6538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
haneepark
wants to merge
58
commits into
line:main
Choose a base branch
from
haneepark:site-new
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+18,239
−29,997
Open
Changes from 43 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
93c645f
Add social icons in header
haneepark 5ef4cb5
Update footer copyright
haneepark fd20e73
Change navbar logo to comply with design guidelines
haneepark f116e5f
Update footer
haneepark f43fa28
Fix internal links and redirect configuration
haneepark d0623a0
Handle redirection on the /news page
haneepark 2514197
Add the StarBegging component
haneepark 7923855
Add the CookieConsent component
haneepark 831ea95
Add the StarBegging and CookieConsent components to Layout
haneepark 843ebb1
Use Docusaurus's Client API rather than browser API (such as window.l…
haneepark 0047522
Implement the custom footer
haneepark c9e4f00
Add blog posts
haneepark 2265325
Use self-hosted images
haneepark 69f6cf8
Fix format issues in blog postings
haneepark a055047
Edit relative blog post links and footnotes
haneepark cdbc1ed
Add images' background and change font colors for dark mode support
haneepark 8a1e6ab
Fix speakerdeck import script
haneepark 72454bd
Show blog post links in other languages
haneepark 55fc205
Fix broken links and let the build pass on broken links
haneepark db6b8a7
Move the design/ resources directory under src/
haneepark 0387577
Move the MDX resources directories under src/content
haneepark 65fd201
Remove test pages
haneepark ade144c
Correct relative links in a blog post
haneepark 707b39e
Add release-note.ts and install dependencies
haneepark 56b6fff
Add a version heading and filter out the dependabot from release notes
haneepark d22d9d5
Tidy up docusaurus.config.ts
haneepark aa33c44
Implement the short url plugin
haneepark 9462603
Add the gtag plugin for GA integration and add manual tracking for sh…
haneepark 1a9e3f5
Add npm script for build:dev and fix link issues
haneepark bbb2c65
Fix React hydration issues
haneepark ea6aafd
Configure SEO and PWA
2d4f1fb
Update Docusaurus version to 3.9.2
e49d375
Reflect site updates
665dc56
Update node version requirement
haneepark 42dda6f
docs: fix incorrect filename in BlogPostRequestConverter code block
haneepark 8e12e86
Add a plugin and a script for generating RSS feed
haneepark 7ebb413
Apply a custom 404 page
haneepark fbdf79b
Remove an unnecessary class in the footer
haneepark 92e019c
Release notes for 1.34.0
haneepark 3dd04bc
Bump dependencies
haneepark 764c676
Add Algolia site verification
haneepark de46f50
Release notes for 1.34.1
haneepark 7b5de92
Add build.gradle
minwoox 991d48b
Remove svgbob_cli
minwoox 27057fc
Lint
minwoox d347f7d
Remove site from settings.gradle
minwoox 3cda3a8
LInt again
minwoox f322b53
update readme
minwoox b231b62
npm install
minwoox c53fa24
Try clean and increase heap size
minwoox fb8ae7d
Try
minwoox c4d8a85
Downgrade
minwoox fd4eafe
upload npm logs
minwoox 2cef50c
Add npmrc
minwoox 031f6a1
Apply Code Rabbit's feedback
haneepark ae7a9ae
Prevent layout shift for navbar logo
haneepark 42b30b4
Update site-new/src/components/short-url-redirect.tsx
haneepark bc4f24e
Fix lint issues
haneepark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
site-new/blog/en/monitoring-prometheus-metrics-from-armeria.mdx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,236 @@ | ||
| import groovy.json.JsonBuilder | ||
| import groovy.json.JsonSlurper | ||
| import org.jsoup.Jsoup | ||
|
|
||
| import java.nio.file.Files | ||
| import java.util.concurrent.TimeUnit | ||
| import java.util.regex.Pattern | ||
| import java.util.stream.Collectors | ||
|
|
||
| buildscript { | ||
| repositories { | ||
| gradlePluginPortal() | ||
| mavenCentral() | ||
| } | ||
| dependencies { | ||
| classpath libs.jsoup | ||
| } | ||
| } | ||
|
|
||
| plugins { | ||
| id 'base' | ||
| alias(libs.plugins.node.gradle) | ||
| } | ||
|
|
||
| node { | ||
| version = '24.11.1' | ||
| npmVersion = '11.6.2' | ||
| download = true | ||
| npmInstallCommand = "ci" | ||
| } | ||
|
|
||
| tasks.register('npmClean', NpmTask) { | ||
| dependsOn tasks.npmInstall | ||
| args = ['run', 'clear'] | ||
| } | ||
|
|
||
| // Note that we didn't make `clean` depend on `npmClean`, | ||
| // because otherwise `clean` will trigger `npmInstall`. | ||
| tasks.clean.delete(project.file("${project.projectDir}/.docusaurus")) | ||
| tasks.clean.delete(project.file("${project.projectDir}/gen-src")) | ||
| tasks.clean.delete(project.file("${project.projectDir}/build")) | ||
| tasks.clean.delete(project.file("${project.projectDir}/node_modules/.cache")) | ||
|
|
||
| tasks.register('versionIndex', VersionIndexTask) | ||
| tasks.register('apiIndex', ApiIndexTask) { | ||
| dependsOn ':javadoc:javadoc' | ||
| } | ||
| tasks.register('contributorList', ContributorListTask) | ||
|
|
||
| tasks.register('generateSiteSources') { | ||
| dependsOn tasks.npmInstall | ||
| dependsOn tasks.versionIndex | ||
| dependsOn tasks.apiIndex | ||
| dependsOn tasks.contributorList | ||
| } | ||
|
|
||
| tasks.register('develop', NpmTask) { | ||
| dependsOn tasks.generateSiteSources | ||
| args = ['run', 'start'] | ||
| } | ||
|
|
||
| tasks.register('eslint', NpmTask) { | ||
| dependsOn tasks.generateSiteSources | ||
| args = ['run', 'lint'] | ||
| inputs.dir('src') | ||
| inputs.file('.eslintrc.js') | ||
| inputs.file('package.json') | ||
| inputs.file('package-lock.json') | ||
| } | ||
|
|
||
| // 'siteLint' could run separately regardless of '-PnoLint' option | ||
| tasks.register('siteLint') { | ||
| dependsOn tasks.eslint | ||
| } | ||
|
|
||
| // Note that this task is not triggered by the 'build' task | ||
| // because it takes long to build a site. | ||
| tasks.register('site', NpmTask) { | ||
| dependsOn tasks.generateSiteSources | ||
| if (!rootProject.hasProperty('noLint')) { | ||
| dependsOn tasks.siteLint | ||
| } | ||
| args = ['run', 'build'] | ||
| inputs.dir('src') | ||
| inputs.file('docusaurus.config.ts') | ||
| inputs.file('package.json') | ||
| inputs.file('package-lock.json') | ||
| inputs.file('tsconfig.json') | ||
| outputs.dir('.docusaurus') | ||
| outputs.dir('build') | ||
| } | ||
|
|
||
| class VersionIndexTask extends DefaultTask { | ||
|
|
||
| @Input | ||
| final def version = project.property('version') | ||
| @Input | ||
| final def managedVersions = project.property('managedVersions') as Map | ||
| @OutputFile | ||
| final def versionIndexFile = project.file("${project.projectDir}/gen-src/versions.json") | ||
|
|
||
| @TaskAction | ||
| def run() { | ||
| def info = new TreeMap(this.managedVersions) | ||
| info["${project.group}:armeria-bom"] = version | ||
|
|
||
| versionIndexFile.withPrintWriter('UTF-8') { out -> | ||
| out.println(new JsonBuilder(info).toPrettyString()) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| class ApiIndexTask extends DefaultTask { | ||
|
|
||
| @InputDirectory | ||
| final def javadocDir = project.file("${project.rootProject.projectDir}/javadoc/build/docs/javadoc") | ||
| @OutputFile | ||
| final def nameToHrefFile = project.file("${project.projectDir}/gen-src/api-index.json") | ||
|
|
||
| @TaskAction | ||
| def run() { | ||
| def javadocPath = javadocDir.toPath() | ||
| def nameToHref = Files.walk(javadocPath).filter({ path -> | ||
| if (Files.isDirectory(path)) { | ||
| return false | ||
| } | ||
|
|
||
| return path.getName(path.nameCount - 1).toString().matches(/[A-Z][a-zA-Z0-9._$]+\.html/) | ||
| }).sorted().flatMap({ path -> | ||
| def relativePath = "${javadocPath.relativize(path)}".replace(File.separator, '/') | ||
| def fqcn = relativePath[0..-6].replace('/', '.') | ||
| def href = "https://javadoc.io/doc/com.linecorp.armeria/armeria-javadoc/latest/${relativePath}" | ||
|
|
||
| def result = [] | ||
| result.add([fqcn, href]) | ||
|
|
||
| def simpleClassName = fqcn.substring(fqcn.lastIndexOf('.') + 1) | ||
| result.add([simpleClassName, href]) | ||
|
|
||
| def doc = Jsoup.parse(path.toFile(), 'UTF-8') | ||
| doc.select(""".constant-details .member-list .detail, | ||
| .constructor-details .member-list .detail, | ||
| .field-details .member-list .detail, | ||
| .method-details .member-list .detail""").each { | ||
| def methodSignature = it.attr("id") | ||
| def hrefWithMethod = href + '#' + methodSignature | ||
|
|
||
| def split = methodSignature.split('\\(|\\)|,') | ||
| if (split.length != 1) { | ||
| // Make the type of parameters from FQCN to Simple class name in order to use as a key. | ||
| def parameters = '' | ||
| for (int i = 1; i < split.length; i++) { | ||
| // Remove the trailing '...' in varargs | ||
| def p = split[i].replaceAll(/\.+$/, '') | ||
| parameters += ',' + p.substring(p.lastIndexOf('.') + 1) | ||
| } | ||
| methodSignature = split[0] + '(' + parameters.substring(1) + ')' | ||
| } | ||
|
|
||
| result.add([fqcn + '#' + methodSignature, hrefWithMethod]) | ||
| result.add([simpleClassName + '#' + methodSignature, hrefWithMethod]) | ||
| } | ||
|
|
||
| return result.stream() | ||
| }).collect(Collectors.toMap({ e -> e[0] }, { e -> e[1] }, { a, b -> a }, { new TreeMap()})) | ||
|
|
||
|
|
||
| nameToHrefFile.withPrintWriter('UTF-8') { out -> | ||
| out.println(new JsonBuilder(nameToHref).toPrettyString()) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| class ContributorListTask extends DefaultTask { | ||
| // Rebuild up to once an hour, unless cleaned. | ||
| @Input | ||
| final def hourOfDay = System.currentTimeMillis() / TimeUnit.HOURS.toMillis(1) | ||
| @OutputFile | ||
| final def contributorsFile = project.file("${project.projectDir}/gen-src/contributors.json") | ||
|
|
||
| @TaskAction | ||
| def run() { | ||
| def contributors = new TreeMap<String, String>() | ||
| def accessToken = project.findProperty('githubToken') | ||
| def url = 'https://api.github.com/repos/line/armeria/contributors' | ||
| def nextPattern = Pattern.compile(/<(https:\/\/api\.github\.com\/[^>]+)>; rel="next"/) | ||
| for (def i = 0; i < 10; i++) { | ||
| def req = new URL(url).openConnection() | ||
| if (accessToken?.trim()) { | ||
| req.setRequestProperty('Authorization', "token ${accessToken}") | ||
| } | ||
| def resText = req.getInputStream().getText() | ||
| if (req.getResponseCode() != 200) { | ||
| if (req.getHeaderFieldInt('X-RateLimit-Remaining', Integer.MAX_VALUE) <= 0) { | ||
| throw new Exception('Exceeded Github API rate limit. ' + | ||
| 'Specify "-PgithubToken=<personalAccessToken>" option: ' + | ||
| "${req.getResponseCode()}, ${req.getHeaderFields()}, ${resText}") | ||
| } else { | ||
| throw new Exception('Received a non-200 response from Github: ' + | ||
| 'Maybe specify "-PgithubToken=<personalAccessToken>" option: ' + | ||
| "${req.getResponseCode()}, ${req.getHeaderFields()}, ${resText}") | ||
| } | ||
| } | ||
| def res = new JsonSlurper().parseText(resText) | ||
| res.each({ | ||
| def username = it['login'] | ||
| def avatarUrl = it['avatar_url'] | ||
| if (!(username instanceof CharSequence) || !(avatarUrl instanceof CharSequence)) { | ||
| throw new Exception("Received an invalid response from Github: ${resText}") | ||
| } | ||
| contributors.put("${username}".toString(), "${avatarUrl}".toString()) | ||
| }) | ||
|
|
||
| // Handle pagination | ||
| def link = req.getHeaderField('Link') | ||
| if (link == null) { | ||
| // Last page or no link header | ||
| break | ||
| } | ||
|
|
||
| def nextLinkMatcher = nextPattern.matcher(link) | ||
| if (!nextLinkMatcher.find()) { | ||
| // No next link | ||
| break | ||
| } | ||
|
|
||
| // Jump to the next page | ||
| url = nextLinkMatcher.group(1) | ||
| } | ||
|
|
||
| contributorsFile.withPrintWriter('UTF-8') { out -> | ||
| out.println(new JsonBuilder(contributors).toPrettyString()) | ||
| } | ||
| } | ||
| } | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.