Skip to content

Commit b3eda15

Browse files
Merge pull request #144 from rakutentech/feature/file
(v2.4) adds version on nav and fixes curl command
2 parents ec08343 + e900130 commit b3eda15

File tree

7 files changed

+174
-41
lines changed

7 files changed

+174
-41
lines changed

ui/astro.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ import { defineConfig } from 'astro/config';
22
import compress from "astro-compress";
33
import react from '@astrojs/react';
44

5+
import git from 'git-rev-sync';
6+
const version = git.tag();
7+
const versionParts = version.split('.');
8+
const versionIncremented = versionParts[0] + '.' + (parseInt(versionParts[1]) + 1);
9+
console.log('Version: ' + version + ' -> ' + versionIncremented);
10+
process.env.PUBLIC_VERSION = versionIncremented;
11+
512
export default defineConfig({
13+
614
integrations: [
715
compress(),
816
react()

ui/package-lock.json

Lines changed: 100 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@heroicons/react": "^2.0.15",
1919
"astro": "^2.0.6",
2020
"fuse.js": "^6.6.2",
21+
"git-rev-sync": "^3.0.2",
2122
"react-ace": "^10.1.0",
2223
"react-anchor-link-smooth-scroll": "^1.0.12",
2324
"react-markdown": "^8.0.5",

ui/src/components/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
import React, { useEffect, useState } from 'react';
23
import TopNav from "./TopNav"
34
import Sidebar from './Sidebar';

ui/src/components/TopNav.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,18 @@ export default function TopNav(props: Props) {
9393
<header className="relative bg-none">
9494
<div className="navbar bg-base-200">
9595
<div className="flex-1">
96-
<a className="btn btn-ghost normal-case text-xl">
97-
<span className="pl-2">Laravel Request Docs</span>
98-
</a>
96+
<div className="normal-case text-xl">
97+
<span className="pl-2">
98+
<span className='title'>Laravel Request Docs</span>
99+
<sup className='pl-2'>
100+
<small>
101+
<a className="link link-info" href={`https://github.com/rakutentech/laravel-request-docs/releases/tag/${import.meta.env.PUBLIC_VERSION}`} target="_blank" rel="noreferrer">
102+
version {import.meta.env.PUBLIC_VERSION}
103+
</a>
104+
</small>
105+
</sup>
106+
</span>
107+
</div>
99108
</div>
100109
<div className="flex-none">
101110
<div className="form-control">

0 commit comments

Comments
 (0)